rust-lang / crater

Run experiments across parts of the Rust ecosystem!
https://crater.rust-lang.org
643 stars 90 forks source link

Add support for specifying the target to run #669

Closed wesleywiser closed 2 years ago

wesleywiser commented 2 years ago

This allows you to choose a target other than x86_64-unknown-linux-gnu on the current runners such as i686-unknown-linux-musl:

$ cargo run -- define-ex --crate-select=demo --cap-lints=forbid stable+target=i686-unknown-linux-musl beta+target=i686-unknown-linux-musl
[2022-10-06T21:09:31Z INFO  crater] command succeeded

$ cargo run -- run-graph --threads 1
...
[2022-10-06T21:00:05Z INFO  rustwide::toolchain] adding target i686-unknown-linux-musl for toolchain stable
[2022-10-06T21:00:05Z INFO  rustwide::cmd] running `Command { std: "/home/azureuser/disk1/crater/work/cargo-home/bin/rustup" "target" "add" "--toolchain" "stable" "i686-unknown-linux-musl", kill_on_drop: false }`
[2022-10-06T21:00:05Z INFO  rustwide::cmd] [stderr] info: downloading component 'rust-std' for 'i686-unknown-linux-musl'
[2022-10-06T21:00:05Z INFO  rustwide::cmd] [stderr] info: installing component 'rust-std' for 'i686-unknown-linux-musl'
...
[2022-10-06T21:00:18Z INFO  rustwide::cmd] [stderr] info: checking for self-updates
[2022-10-06T21:00:18Z INFO  rustwide::toolchain] adding target i686-unknown-linux-musl for toolchain beta
[2022-10-06T21:00:18Z INFO  rustwide::cmd] running `Command { std: "/home/azureuser/disk1/crater/work/cargo-home/bin/rustup" "target" "add" "--toolchain" "beta" "i686-unknown-linux-musl", kill_on_drop: false }`
[2022-10-06T21:00:18Z INFO  rustwide::cmd] [stderr] info: downloading component 'rust-std' for 'i686-unknown-linux-musl'
[2022-10-06T21:00:19Z INFO  rustwide::cmd] [stderr] info: installing component 'rust-std' for 'i686-unknown-linux-musl'
[2022-10-06T21:00:21Z INFO  crater::runner] running tasks in 1 threads...
...
[2022-10-06T21:13:05Z INFO  rustwide::cmd] running `Command { std: "docker" "create" "-v" "/home/azureuser/disk1/crater/work/builds/worker-0/target:/opt/rustwide/target:rw,Z" "-v" "/home/azureuser/disk1/crater/work/builds/worker-0/source:/opt/rustwide/workdir:ro,Z" "-v" "/home/azureuser/disk1/crater/work/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/home/azureuser/disk1/crater/work/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "1000:998" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:3d1cd00eb6e6ea2a7969240779edeaeff35b24be85036c63b883ba933028a15f" "/opt/rustwide/cargo-home/bin/cargo" "+beta" "test" "--frozen" "--target" "i686-unknown-linux-musl", kill_on_drop: false }`
...
[2022-10-06T21:13:05Z INFO  rustwide::cmd] [stderr]     Finished test [unoptimized + debuginfo] target(s) in 0.00s
[2022-10-06T21:13:05Z INFO  rustwide::cmd] [stderr]      Running unittests src/lib.rs (/opt/rustwide/target/i686-unknown-linux-musl/debug/deps/lazy_static-d189001dd9281e0a)
[2022-10-06T21:13:05Z INFO  rustwide::cmd] [stderr]      Running tests/no_std.rs (/opt/rustwide/target/i686-unknown-linux-musl/debug/deps/no_std-a3be84aa37faf9f2)
[2022-10-06T21:13:05Z INFO  rustwide::cmd] [stderr]      Running tests/test.rs (/opt/rustwide/target/i686-unknown-linux-musl/debug/deps/test-076bce8c3f654325)
...
Mark-Simulacrum commented 2 years ago

@bors delegate+

bors commented 2 years ago

:v: @wesleywiser can now approve this pull request

wesleywiser commented 2 years ago

@bors r=Mark-Simulacrum

bors commented 2 years ago

:pushpin: Commit b8536edfa99751382e54e81d4ccae8ed5fce54d2 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

bors commented 2 years ago

:hourglass: Testing commit b8536edfa99751382e54e81d4ccae8ed5fce54d2 with merge 060cf48629b800f0af39662049713af8408bd173...

bors commented 2 years ago

:sunny: Test successful - checks-actions Approved by: Mark-Simulacrum Pushing 060cf48629b800f0af39662049713af8408bd173 to master...