-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop double-wrapping --run_under commandlines with bash
On non-windows platforms, `--run_under='cd /tmp &&' -- //foo:bar` would become `/bin/bash -c '/bin/bash -c \'cd /tmp && /foo/bar\''`, now it's just `/bin/bash -c 'cd /tmp && /foo/bar'`. This is a lot cleaner and less confusing when it comes to trying to interpret or do anything novel with the command line. The double-wrapping seems to have existed because that's the way the code evolved, not necessity. See unknown commit for when the unconditional outer /bin/bash was added. This wound up being a lot more invasive than I had originally hoped, but I think the restructuring is for the better. While all of the divergent ways of doing things across and within linux and windows remain, at least they're consolidated and better documented via tests. RunCommandLine is moved to a builder to consolidate duplicate updates of args, pretty args, and args-without-residue. Command-line production is implemented via a new formatter interface, with a linux (aka non-windows) and windows implementation. Includes what I think is drive-by fix for the run executable not being escaped with --run_under. That is, while I think the previous behavior was probably functional, if we had thought about it I think we'd want to escape. There are some bug-for-bug ports of existing issues, notably windows escaping bugs. I tried to create github issues and linked TODOs for these. There's probably more cleanup that can be done, but given the invasiveness I tried to keep things focused. PiperOrigin-RevId: 624974102 Change-Id: I973d473eb5afb2fd76a5d98cc624c236396af7fa
- Loading branch information
1 parent
8bc881b
commit fbe1558
Showing
4 changed files
with
534 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.