Solved [Solved] poudriere testport fail w/ Python subprocess.Popen

I am using ports-mgmt/poudriere on FreeBSD 10.0-p7 with a jail of the same version to generate build logs for a port I am submitting. There are issues when building the port with poudriere testport that I cannot replicate when building the port by hand, even from within the poudriere jail.

The software I'm trying to port runs a number of tests as part of the build process using Python. Two of the tests call compiled executables using subprocess.Popen(), for which the description in the Python documentation is:
Execute a child program in a new process. On Unix, the class uses os.execvp()-like behavior to execute the child program.
Using truss(1), I have confirmed that the executables are called using the execve(2) system call. The tests complete successfully when building from an interactive session, including within an interactive session inside the poudriere jail. However, the tests fail when using poudriere to test the port with poudriere testport with an error message of the form:
Code:
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/devel/tianocore-udk2014/work/BaseTools/Tests/TianoCompress.py", line 32, in testHelp
    result = self.RunTool('--help', logFile='help')
  File "/wrkdirs/usr/ports/devel/tianocore-udk2014/work/BaseTools/Tests/TestTools.py", line 125, in RunTool
    stdout=popenOut, stderr=subprocess.STDOUT
  File "/usr/local/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/local/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
The Python code snippet that generates the error:
Code:
        Proc = subprocess.Popen(
            args, executable=bin,
            stdout=popenOut, stderr=subprocess.STDOUT
            )
args is an array containing the basename of the executable and arguments it is to be passed, bin is the path to the executable, popenOut for one test is a file descriptor for a file open for writing and in another case has the value -1 from subprocess.PIPE. By adding some print statements to the Python code I have confirmed that the arguments are identical for execution through poudriere testport and when building the port interactively in the poudriere jail, though the former fails and the latter succeeds.

I am at a loss for where to look next so any and all suggestions would be gratefully received. Does ports-mgmt/poudriere do something special in testport mode that I'm missing?
 
Re: poudriere testport fail with Python subprocess.Popen()

Now solved. The executable being called by subprocess.Popen() was not in fact the compiled C program I expected but a shell script wrapper that calls the compiled C program. The shell script needed shells/bash to execute and it wasn't in my BUILD_DEPENDS list; this was generating the missing file error. However, it was in my RUN_DEPENDS list, which meant that when I repeated the build in the running poudriere jail, shells/bash was already installed there.
 
Back
Top