rust-lang / crater

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

Allow to specify `RUSTDOCFLAGS` independently #654

Closed Enselic closed 2 years ago

Enselic commented 2 years ago

Currently, if you to run this experiment:

cargo run -- define-ex --ex rustdoc-json-broken --mode rustdoc \
    --cap-lints warn --crate-select list:serde \
    "nightly-2022-06-01+rustflags=-Z unstable-options --output-format json" \
    "nightly+rustflags=-Z unstable-options --output-format json" \

crater will mix up RUSTFLAGS and RUSTDOCFLAGS and you will get the following error:

[INFO] [stderr]   process didn't exit successfully: `rustc - --crate-name ___ \
    --print=file-names --cap-lints=warn -Z unstable-options --output-format json \
    --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib \
    --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` \
    (exit status: 1)
[INFO] [stderr]   --- stderr
[INFO] [stderr]   error: Unrecognized option: 'output-format'

Solve this by allowing rustdoc and rustdocflags to be specified independently. After this change, this works without unexpected errors:

cargo run -- define-ex --ex rustdoc-json-ice --mode rustdoc \
    --cap-lints warn --crate-select list:serde \
    "nightly-2022-06-01+rustdocflags=-Z unstable-options --output-format json" \
    "nightly+rustdocflags=-Z unstable-options --output-format json"

Not sure if this change breaks compatibility in some way, but it seems like a rather generic and future-proof solution to me.

Mark-Simulacrum commented 2 years ago

@bors r+

bors commented 2 years ago

:pushpin: Commit 885ec83e66d499834dcca580428d505f35072cf5 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

bors commented 2 years ago

:hourglass: Testing commit 885ec83e66d499834dcca580428d505f35072cf5 with merge b21942776787fc69eee0be694c47ed9a631012a0...

bors commented 2 years ago

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

Mark-Simulacrum commented 2 years ago

This'll currently need a manual deployment, but I'll take care of that hopefully tomorrow or over the weekend.

Mark-Simulacrum commented 2 years ago

This is now deployed.