Skip to content

Consider adding symlink /proc/self/fds -> /dev/fds in sandbox #1610

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions