commit | a1c9e687c8ce80fd9baad52cbf361755bf5a84f7 | [log] [tgz] |
---|---|---|
author | Michael Cui <mlcui@google.com> | Wed Apr 30 03:13:49 2025 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Apr 30 03:13:49 2025 |
tree | 1937ecddff43ca77a94e71ce3b98dbca01919418 | |
parent | 631aef412ef5c4c0e0d2ed3febb550613b07f208 [diff] |
run_cargo: Fix `PATH`-lookup trouble by specifying `executable` This CL is a partial revert of https://crrev.com/c/5377439. In the aforementioned CL, `tools.clang.scripts.build.RunCommand` was used instead of `subprocess.run`, as on Windows, the `PATH` environment variable passed into `subprocess.run` was not used to look up the executable provided in the command line. A closer look at the `subprocess` documentation states that a fully qualified path to the executable should be used for maximum reliability. The Windows `CreateProcessW` documentation also mentions that the `PATH` environment variable used to look up executable comes from the **current process**. Provide a fully qualified path instead as `executable` instead of using `RunCommand`. This: - ensures that Cargo sees itself being run as "cargo". - removes the "Running [command]" and "Failed." print messages which are printed by `RunCommand`. - removes the use of `shell=True`, preventing shell injections and allowing passing in path-like objects into the command line. Bug: None Change-Id: I6a6a2100d9b13507c6257f1ca9b46a41c379bf3c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6326573 Commit-Queue: Michael Cui <mlcui@google.com> Reviewed-by: Ćukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/main@{#1453690}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.