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

"Unrecognized option: 'crate-version'" panic when building docs with uuid feature enabled #1670

Closed
whirm opened this issue Feb 3, 2022 · 4 comments

Comments

@whirm
Copy link

whirm commented Feb 3, 2022

└──> cargo doc                               
 Documenting sqlx-core v0.5.10
 Documenting sqlx-macros v0.5.10
 Documenting sqlx v0.5.10
thread 'rustc' panicked at 'no entry found for key', src/librustdoc/passes/collect_intra_doc_links.rs:930:16
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

error: could not document `sqlx`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2018 --crate-type lib --crate-name sqlx /home/whirm/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-0.5.10/src/lib.rs --cap-lints allow -o /tmp/sqlx-bug/target/doc --cfg 'feature="_rt-tokio"' --cfg 'feature="default"' --cfg 'feature="macros"' --cfg 'feature="migrate"' --cfg 'feature="runtime-tokio-rustls"' --cfg 'feature="sqlite"' --cfg 'feature="sqlx-macros"' --cfg 'feature="uuid"' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat -C metadata=ad6092f1216a489d -L dependency=/tmp/sqlx-bug/target/debug/deps --extern sqlx_core=/tmp/sqlx-bug/target/debug/deps/libsqlx_core-01fccaefa1e46b1d.rmeta --extern sqlx_macros=/tmp/sqlx-bug/target/debug/deps/libsqlx_macros-5428b88dc0924617.so --crate-version 0.5.10` (exit status: 1)

Reproduceable in nightly with a new crate and the following Cargo.toml:

[package]
name = "sqlx-bug"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sqlx = { version = "0.5.10", features = ["runtime-tokio-rustls", "sqlite", "macros", "uuid"] }

If I try with this Cargo.toml it works fine:

[package]
name = "sqlx-bug"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sqlx = { version = "0.5.10", features = ["runtime-tokio-rustls", "sqlite", "macros"] }

Thanks for your work!

@abonander
Copy link
Collaborator

That seems like something on your end. We never manually invoke rustdoc to my knowledge.

Do you have something weird going on with your PATH? Perhaps it's trying to use rustdoc from an older Rust install.

@whirm
Copy link
Author

whirm commented Feb 4, 2022

I've only got the one:

└──> sudo find / -name rustdoc -type f -executable 
/var/tmp/.whirm/unburden/whirm/rustup-toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustdoc
/home/whirm/.cargo/bin/rustdoc
└──> /var/tmp/.whirm/unburden/whirm/rustup-toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustdoc -V
rustdoc 1.60.0-nightly (4e8fb743c 2022-02-03)
└──> /home/whirm/.cargo/bin/rustdoc -V                                                               
rustdoc 1.60.0-nightly (4e8fb743c 2022-02-03)
└──> rustdoc -V 
rustdoc 1.60.0-nightly (4e8fb743c 2022-02-03)

I uninstalled all toolchains and then installed nightly just to be sure.

A crate with just the same version of uuid as a dependency works fine, a much bigger crate I'm developing with a couple dozen direct dependencies, uuid among others, and sqlx as a transitive dependency (from sea-orm) can document the direct uuid dependency but fails with the transitive one.

After some more testing, I realized it works fine with the stable toolchain!

Could you see if you can reproduce it with current nightly before I report it upstream?

Thanks!

@jplatte
Copy link
Contributor

jplatte commented Feb 4, 2022

This has already been reported upstream and there's a PR that should fix it as of three days ago.

@whirm
Copy link
Author

whirm commented Feb 4, 2022

Nice! closing this one then.

Thanks!

@whirm whirm closed this as completed Feb 4, 2022
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

3 participants