Skip to content

Conversation

@TroyKomodo
Copy link
Contributor

What type of PR is this?

Uncomment one line below and remove others.

Bug fix

What does this PR do? Why is it needed?

Use the sh_toolchain to find the path to bash instead of bazel.

Which issues(s) does this PR fix?

Fixes #4352

Other notes for review

@TroyKomodo TroyKomodo requested a review from dzbarsky October 2, 2025 16:28
@TroyKomodo
Copy link
Contributor Author

Can this be merged?

@fmeum fmeum force-pushed the troy/sh_toolchain branch from 78753ba to 2fdd0bf Compare October 9, 2025 13:49
Copy link
Member

@fmeum fmeum left a comment

Choose a reason for hiding this comment

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

I support this, but I hope that it goes away sooner rather than later. While this is the right solution to the problem, it is applied in the "wrong" location - rules_shell should offer an appropriate run_shell as a subrule that other rules can use instead of the semi-broken builtin ctx.actions.run_shell.

@TroyKomodo
Copy link
Contributor Author

In a perfect world, we should be able to do this without breaking the cache. right now when running this if the path to bash changes the cache will invalidate this file.

@fmeum fmeum merged commit 74199c9 into bazel-contrib:master Oct 9, 2025
1 check passed
@fionera
Copy link
Contributor

fionera commented Nov 2, 2025

This sadly broke our build because there is no PATH propagated without use_default_shell_env

@fmeum
Copy link
Member

fmeum commented Nov 2, 2025

Sorry, I totally missed that consequence.

@TroyKomodo Could you send a PR that preserves the run_shell call if the experimental flag isn't enabled?

monogon-bot pushed a commit to monogon/monogon that referenced this pull request Nov 20, 2025
The cache-fix patch has been upstreamed and therefore is removed.
bazel-contrib/rules_go#4465 modified the shell behavior, which currently
requires use-default-shell-env.patch for correctly passing PATH to the
script.

Change-Id: Id123137e7e234ee80680efedb6eae3ed0595ec15
Reviewed-on: https://review.monogon.dev/c/monogon/+/4725
Reviewed-by: Lorenz Brun <[email protected]>
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <[email protected]>
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.

Incompatible shebang for NixOS

4 participants