Closed
Description
I am trying to build Rust from source on my project's continuous integration system. I see the following error:
info: looks like you are running this command under `sudo`
and so in order to preserve your $HOME this will now
use vendored sources by default.
error: vendoring required, but vendor directory does not exist.
Run `cargo vendor` without sudo to initialize the vendor directory.
Looking at the message and #40108 it seems the intent is to prevent putting root-owned files in a non-root user's home directory.
Our CI builders use sudo to step down from root to a sandboxed user. See https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8823996676604838337/+/u/build_rust/execution_details for an example environment. I believe it should be safe to build without vendoring in this case.
bootstrap.py should skip the check if SUDO_USER is not root, or an option to bypass this check should be provided.