Skip to content

fix(toolchains): use posix-compatible exec -a alternative #3010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

rickeylev
Copy link
Collaborator

The exec -a command doesn't work in dash, the default shell for Ubuntu/debian.

To work around, use sh -c, which is posix and dash compatible. This allows changing
the argv0 while invoking a different command. Also adds a test to verify the the
runtime_env toolchain works with bootstrap script.

Fixes #3009

@rickeylev rickeylev requested a review from aignas as a code owner June 19, 2025 17:55
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rickeylev rickeylev requested a review from groodt as a code owner June 20, 2025 06:04
@rickeylev rickeylev removed the request for review from groodt June 20, 2025 06:04
@rickeylev rickeylev enabled auto-merge June 20, 2025 06:24
@rickeylev rickeylev added this pull request to the merge queue Jun 20, 2025
Merged via the queue into bazel-contrib:main with commit c4543cd Jun 20, 2025
3 checks passed
@rickeylev rickeylev deleted the fix.exec.a.posix branch June 20, 2025 06:50
rickeylev added a commit that referenced this pull request Jun 20, 2025
The `exec -a` command doesn't work in dash, the default shell for
Ubuntu/debian.

To work around, use `sh -c`, which is posix and dash compatible. This
allows changing
the argv0 while invoking a different command. Also adds a test to verify
the the
runtime_env toolchain works with bootstrap script.

Fixes #3009

(cherry picked from commit c4543cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime_env_toolchain requires on exec -a support
2 participants