Skip to content

Allow to specify RUSTDOCFLAGS independently#654

Merged
bors merged 1 commit intorust-lang:masterfrom
Enselic:rustdocflags
Jul 28, 2022
Merged

Allow to specify RUSTDOCFLAGS independently#654
bors merged 1 commit intorust-lang:masterfrom
Enselic:rustdocflags

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Jul 25, 2022

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.

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"
```
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 28, 2022

📌 Commit 885ec83 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 28, 2022

⌛ Testing commit 885ec83 with merge b219427...

@bors
Copy link
Contributor

bors commented Jul 28, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing b219427 to master...

@bors bors merged commit b219427 into rust-lang:master Jul 28, 2022
@Mark-Simulacrum
Copy link
Member

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

@Mark-Simulacrum
Copy link
Member

This is now deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments