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

docs.rs fails to build docs because --resource-suffix was removed from rustc in 1.58.1 #1630

Closed
michidk opened this issue Jan 28, 2022 · 6 comments

Comments

@michidk
Copy link

michidk commented Jan 28, 2022

Crate name

off-rs

Build failure link

https://docs.rs/crate/off-rs/0.1.3/builds/500166

Additional details

When pushing my crate off-rs to crates.io the docs build fails on docs.rs with the following error:

[INFO] [stderr]  Documenting off-rs v0.1.3 (/opt/rustwide/workdir)
[INFO] [stderr] thread 'rustc' panicked at 'no entry found for key', src/librustdoc/passes/collect_intra_doc_links.rs:929:16
[INFO] [stderr] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[INFO] [stderr] 
[INFO] [stderr] error: internal compiler error: unexpected panic
[INFO] [stderr] 
[INFO] [stderr] error: Unrecognized option: 'resource-suffix'
[INFO] [stderr] 
[INFO] [stderr] error: could not document `off-rs`

I haven't got it to work ever since it first failed (the first version worked). The repo is here: https://github.com/michidk/off-rs/tree/6a0146d4f2cadb1e46ce8849abd0269cd97d3528
Building the docs locally on my machine works without any issues, even on nightly.

I expected to see this happen: Docs build successfully on docs.rs

Instead, this happened: Rust panics, full log: https://docs.rs/crate/off-rs/0.1.3/builds/500166

Edit: Can replicated it locally, by using rustc v 1.58.1. With v1.58 it worked, with v1.58.1 it fails using this command rustdoc +nightly --edition=2021 --crate-type lib --crate-name off_rs src/lib.rs --target x86_64-unknown-linux-gnu -o target/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=390ff25bd5d00bc9 -L dependency=target/x86_64-unknown-linux-gnu/debug/deps -L dependency=target/debug/deps -Z unstable-options --emit=invocation-specific --resource-suffix -20220126-1.60.0-nightly-6abb6385b --static-root-path / --cap-lints warn --disable-per-crate-search --crate-version 0.1.3

Seems like --resource-suffix was removed from rust without adjusting docs.rs

@Nemo157
Copy link
Member

Nemo157 commented Jan 28, 2022

I believe the "unrecognized option" message is wrong and some side-effect of the initial error, rustdoc definitely still supports --resource-suffix otherwise all builds on docs.rs would be erroring. Running just cargo doc --no-deps complains about --crate-version not being supported 😅.

By just deleting the intra-doc-links it appears to be the [`parse`](`crate::parser::Parser::parse`) that is causing an issue; that is somehow broken on the nightly rustdoc.

@jyn514
Copy link
Member

jyn514 commented Jan 28, 2022

--resource-suffix hasn't been removed, that's just a poor error that happens when there's an ice (being fixed in rust-lang/rust#92310). The actual error is

[INFO] [stderr] thread 'rustc' panicked at 'no entry found for key', src/librustdoc/passes/collect_intra_doc_links.rs:929:16

@Shemnei
Copy link

Shemnei commented Jan 28, 2022

Could it be the (missing) lifetime in the doc comment:

[`parse`](`crate::parser::Parser::parse`) -> [`parse`](`crate::parser::Parser::<'_>::parse`)

I thought they were not required but with the anonymous lifetime added it worked.

@Nemo157
Copy link
Member

Nemo157 commented Jan 28, 2022

Not sure, I tried a tiny example with a similar setup and wasn't able to reproduce, it worked just fine without a lifetime. Would be good to open a rust-lang/rust issue to try and minimize (and even if the lifetime is necessary that should be an error/warning not an ICE).

@Shemnei
Copy link

Shemnei commented Jan 28, 2022

Opened issue for rust-lang/rust: rust-lang/rust#93428

@jyn514 jyn514 closed this as completed Jan 28, 2022
@Nemo157
Copy link
Member

Nemo157 commented Jan 31, 2022

I ran a new build since 93428 was fixed and it succeeded: https://docs.rs/off-rs/0.1.3/off_rs/ (though, I see there's been a major version bump since so probably not that important 😁).

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

No branches or pull requests

4 participants