Using Bst 1.6.4 to wrap the test suite of a proprietary component I am working on.
The tests are run using a command similar to this.
/bin/bash "-c" "/bin/mkdir -p ${TEST_OUTPUT}/mytest mytest > >(tee ${TEST_OUTPUT}/mytest/stdout.log) 2> >(tee ${TEST_OUTPUT}/mytest/stderr.log >&2)"
Bash version in the sandbox is 4.2.26.
The tests all fail when run inside bst build, with this error:
/bin/bash: /dev/fd/62: No such file or directory
Bash tries to use /dev/fd for the >() redirects, and this fails as it does not exist.
I found an old newsgroup post saying that this is by design: https://gnu.bash.bug.narkive.com/waCuOLkA/dev-fd-62-no-such-file-or-directory. I haven't tested if newer Bash versions have the same issue.
Workaround:
- Run the tests in
bst shell instead, so the /dev from the host is bind-mounted with its /dev/fd symlink
- Use a custom element plugin to run the tests, which can set
SandboxFlags.INTERACTIVE and get the same effect as above.
Not possible:
- Create the
/dev/fd symlink in the sandbox - /dev is readonly.
Proposed solution:
- Make a
/dev/fd symlink in every sandbox. It seems harmless and would prevent this strange breakage when using Bash shell.
Using Bst 1.6.4 to wrap the test suite of a proprietary component I am working on.
The tests are run using a command similar to this.
Bash version in the sandbox is 4.2.26.
The tests all fail when run inside
bst build, with this error:Bash tries to use
/dev/fdfor the>()redirects, and this fails as it does not exist.I found an old newsgroup post saying that this is by design: https://gnu.bash.bug.narkive.com/waCuOLkA/dev-fd-62-no-such-file-or-directory. I haven't tested if newer Bash versions have the same issue.
Workaround:
bst shellinstead, so the/devfrom the host is bind-mounted with its/dev/fdsymlinkSandboxFlags.INTERACTIVEand get the same effect as above.Not possible:
/dev/fdsymlink in the sandbox - /dev is readonly.Proposed solution:
/dev/fdsymlink in every sandbox. It seems harmless and would prevent this strange breakage when using Bash shell.