commit | fbe1558ceb8f5a714353009c5469d0bbbac27e28 | [log] [tgz] |
---|---|---|
author | Googler <michajlo@google.com> | Mon Apr 15 08:47:33 2024 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Apr 15 08:49:21 2024 -0700 |
tree | c2fcde538abd158b09dc666d63ebf555125f6238 | |
parent | 8bc881b5b6db4816f439015c420ea09a5422f81f [diff] |
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
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md