Skip to content
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

Feature request: rules_shell should support hermetic toolchain #4

Open
BoleynSu opened this issue Oct 5, 2024 · 5 comments
Open

Feature request: rules_shell should support hermetic toolchain #4

BoleynSu opened this issue Oct 5, 2024 · 5 comments

Comments

@BoleynSu
Copy link

BoleynSu commented Oct 5, 2024

No description provided.

@BoleynSu
Copy link
Author

BoleynSu commented Nov 8, 2024

@fmeum is this something rules_shell can consider? I know bash is kind of special as it is also used by Bazel itself, so it might be more complicated than other rules.

@fmeum
Copy link
Collaborator

fmeum commented Nov 9, 2024

Yes, but getting it right requires some thought and design work:

  • rules_shell so far only provides a shell runtime toolchain. Making that hermetic is nice, but I would consider introducing a hermetic exec toolchain (for ctx.actions.run_shell) to be more impactful. It's not completely clear how to wire this up in Java though.
  • On non-Windows platforms, shell scripts are executed directly without any kind of launcher. A hermetic toolchain would probably require introducing one as shebangs must be absolute and have length restrictions.

@BoleynSu
Copy link
Author

BoleynSu commented Nov 16, 2024

Agree there will be lots of thought and design work. For run_shell, seems to me it is quite related to the above issue I just linked too, i.e. just different direction.

@EdSchouten
Copy link

Can't we deprecate ctx.actions.run_shell() altogether?

@fmeum
Copy link
Collaborator

fmeum commented Nov 18, 2024

Can't we deprecate ctx.actions.run_shell() altogether?

That is an appealing option, but we would still need a well-designed replacement that makes it easy to supply hermetic tools. ape and rules_sh can provide inspiration.

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

No branches or pull requests

3 participants