Implement run_shell in Starlark - #64
Open
fmeum wants to merge 3 commits into
Open
Conversation
- Load bzl_library in shell/toolchains/BUILD (was a build failure) - Correct run_shell ctx docstring to reference the exec toolchain type and document shadowed_action/resource_set - Guard the Unix sh_exec_toolchain target on a non-empty shell path, matching the Windows template; fix "runtim" typo - Route run_shell_script_args and run_shell_helper_script_args through the new run_shell wrapper, and add the missing exec toolchain to those rules - run_shell forwards `arguments` into the spilled helper script, so update the helper_script_args_spilled golden and comments accordingly, fixing bazelbuild/bazel#29365 - Misc comment/grammar fixes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Now that run_shell forwards arguments into the spilled helper script, the output path no longer needs to be embedded directly in the command. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
@dzbarsky This is ready for a first review :-) |
fmeum
marked this pull request as ready for review
June 9, 2026 17:08
dzbarsky
approved these changes
Jun 17, 2026
| _UNIX_SH_TOOLCHAIN_TEMPLATE = """ | ||
| _UNIX_SH_TOOLCHAINS_TEMPLATE = """ | ||
| sh_toolchain( | ||
| name = "{os}_sh", |
There was a problem hiding this comment.
maybe we rename this one to _target and alias the old name?
| toolchain = ":{os}_sh", | ||
| toolchain_type = "@rules_shell//shell:toolchain_type", | ||
| toolchain_type = SH_TOOLCHAIN_TYPE, | ||
| target_compatible_with = [ |
There was a problem hiding this comment.
oh, i had never looked at this before, didn't realize it was always target-only. I'm surprised this ever really worked :)
| build, for example, "Compiling foo.cc to create foo.o". The message | ||
| may contain `%{label}`, `%{input}`, or `%{output}` patterns, which | ||
| are substituted with label string, first input, or output's path, | ||
| respectively. Prefer to use patterns instead of static strings, |
There was a problem hiding this comment.
nit: "Prefer to use patterns instead of concatenated strings" or similar? A true static string is fine :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.