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

Better bash-less Windows support in actions.run_shell: add command_bat, command_ps #15194

Open
tetromino opened this issue Apr 7, 2022 · 4 comments
Labels
good first issue help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: feature request

Comments

@tetromino
Copy link
Contributor

tetromino commented Apr 7, 2022

Description of the feature request:

For better bash-less Windows support,ctx.actions.run_shell could add command_bat (with the same behavior as genrule's cmd_bat) and command_ps (with the same behavior as genrule's cmd_ps).

This would, in particular, considerably simplify skylib's Windows support, where currently we are forced to write and execute temporary .bat files on Windows (and attempt to deal with the ancient terror of argument quoting in .bat interpreter context - take a look at https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts if you don't mind losing some points of sanity).

Pinging potentially interested parties: @brandjon @meteorcloudy @alexeagle

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) good first issue help wanted Someone outside the Bazel team could own this and removed untriaged labels Apr 8, 2022
@meteorcloudy
Copy link
Member

Related commit is d3bacfb, this is a great feature that the community can contribute when the Build API team currently doesn't have the resource.

@sreenath-tm
Copy link

I'm interested in contributing to this issue, so before I start working it, would you mind sparing your time explaining what the issue is about and pointing me to some resources to get started.

@meteorcloudy
Copy link
Member

This is basically adding addtional APIs to ctx.actions so that it also supports run_bat, run_ps. This will allow users to write starlark rules that works on Windows without installing bash.

@brandjon brandjon added untriaged team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed team-Build-Language labels Nov 4, 2022
@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P2 We'll consider working on this in future. (Assignee optional) untriaged labels Feb 14, 2023
@comius
Copy link
Contributor

comius commented Feb 14, 2023

This is basically adding addtional APIs to ctx.actions so that it also supports run_bat, run_ps. This will allow users to write starlark rules that works on Windows without installing bash.

Adding new arguments to run_shell should be considered (not new call under ctx.actions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: feature request
Projects
None yet
Development

No branches or pull requests

5 participants