cargo not built when a target is specified
./x.py build src/tools/cargo completes without error and without building cargo when a target is specified via the command line or via a config.toml. I'd expect that cargo would build the same regardless of what target is specified, but instead it does not build at all when a target is specified.
Example:
➜ rust git:(master) ✗ ./x.py build src/tools/cargo --target=x86_64-unknown-fuchsia
Updating submodules
Finished dev [unoptimized] target(s) in 0.0 secs
Build completed successfully in 0:00:04
➜ rust git:(master) ✗ ./x.py build src/tools/cargo
Updating submodules
Finished dev [unoptimized] target(s) in 0.0 secs
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage0 test from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
Finished release [optimized] target(s) in 0.0 secs
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 test artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage1 test from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Finished release [optimized] target(s) in 0.0 secs
Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 codegen artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu, llvm)
Finished release [optimized] target(s) in 0.0 secs
Assembling stage2 compiler (x86_64-unknown-linux-gnu)
Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Uplifting stage1 test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 test from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage2 tool cargo (x86_64-unknown-linux-gnu)
Compiling cargo v0.26.0 (file:///usr/local/google/home/cramertj/src/rust/src/tools/cargo)
Finished release [optimized] target(s) in 13.21 secs
Build completed successfully in 0:00:23
cc @pylaligand
This is caused by the
run_host_onlyflag, so it seems this is expected behavior. Why is this desirable?Taylor Cramer at 2018-01-30 19:44:22
@cramertj I'm not sure this default was ever thought through, it goes back to the initial commit of bootstrap. Enabling it for cross-compiling seems ok to me :) are you interested in making a PR for that? I think it would be simple as flipping the boolean in https://github.com/rust-lang/rust/blob/11e002a001348e7ea035c0cb2665be806e2a832e/src/bootstrap/tool.rs#L602
jyn at 2023-02-03 07:49:57
@cramertj I'm not sure this default was ever thought through, it goes back to the initial commit of bootstrap. Enabling it for cross-compiling seems ok to me :) are you interested in making a PR for that? I think it would be simple as flipping the boolean in https://github.com/rust-lang/rust/blob/11e002a001348e7ea035c0cb2665be806e2a832e/src/bootstrap/tool.rs#L602
jyn at 2023-02-03 07:49:57