Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify RUSTDOCFLAGS independently #654

Merged
merged 1 commit into from
Jul 28, 2022

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