bazelbuild / bazelbuild/bazel

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

Open
#15,194 4 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted P3 team-Rules-API type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Begin at ctx.actions.run_shell and compare its behavior with genrule's cmd_bat and cmd_ps. Check how skylib currently creates temporary .bat files for Windows support, then define completion as equivalent command_bat and command_ps behavior that removes that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, powershell
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.