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

Cargo panics when using -Z rustdoc-scrape-examples=examples #10545

Closed
AaronErhardt opened this issue Apr 8, 2022 · 2 comments · Fixed by rust-lang/rust#96031
Closed

Cargo panics when using -Z rustdoc-scrape-examples=examples #10545

AaronErhardt opened this issue Apr 8, 2022 · 2 comments · Fixed by rust-lang/rust#96031
Labels
C-bug Category: bug Z-scrape-examples Nightly: rustdoc scrape examples

Comments

@AaronErhardt
Copy link

Problem

Cargo (nightly) panics when I use -Z rustdoc-scrape-examples=examples. This issue first appeared yesterday in the documentation workflow of Relm4 without any changes to the CI configuration, so this must be related to a recent change in cargo or rustc.

Steps

  1. Clone Relm4
  2. Run cargo +nightly doc -Z rustdoc-scrape-examples=examples (you might need to have gtk4 installed)

Possible Solution(s)

No response

Notes

Backtrace

thread 'main' panicked at 'activated_features for invalid package: features did not find PackageId { name: "relm4-examples", version: "0.4.0", source: "/.../relm4/relm4-examples" } HostDep

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
   1: <cargo::core::resolver::features::ResolvedFeatures>::activated_features_int
   2: cargo::core::compiler::unit_dependencies::new_unit_dep_with_profile
   3: cargo::core::compiler::unit_dependencies::compute_deps
   4: cargo::core::compiler::unit_dependencies::deps_of
   5: cargo::core::compiler::unit_dependencies::deps_of
   6: cargo::core::compiler::unit_dependencies::deps_of
   7: cargo::core::compiler::unit_dependencies::deps_of_roots
   8: cargo::core::compiler::unit_dependencies::build_unit_dependencies
   9: cargo::ops::cargo_compile::create_bcx
  10: cargo::ops::cargo_compile::compile_ws
  11: cargo::ops::cargo_compile::compile
  12: cargo::ops::cargo_doc::doc
  13: cargo::commands::doc::exec
  14: cargo::cli::main
  15: cargo::main
  16: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  17: std::rt::lang_start::<()>::{closure#0}
  18: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/core/src/ops/function.rs:280:13
  19: std::panicking::try::do_call
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panicking.rs:492:40
  20: std::panicking::try
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panicking.rs:456:19
  21: std::panic::catch_unwind
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panic.rs:137:14
  22: std::rt::lang_start_internal::{{closure}}
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/rt.rs:128:48
  23: std::panicking::try::do_call
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panicking.rs:492:40
  24: std::panicking::try
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panicking.rs:456:19
  25: std::panic::catch_unwind
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panic.rs:137:14
  26: std::rt::lang_start_internal
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/rt.rs:128:20
  27: main
  28: __libc_start_call_main
  29: __libc_start_main_impl
  30: <unknown>', src/tools/cargo/src/cargo/core/resolver/features.rs:318:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at /rustc/8f36334ca939a67cce3f37f24953ff6f2d3f3d33/library/core/src/result.rs:1785:5
   3: cargo::core::compiler::unit_dependencies::new_unit_dep_with_profile
   4: cargo::core::compiler::unit_dependencies::compute_deps
   5: cargo::core::compiler::unit_dependencies::deps_of
   6: cargo::core::compiler::unit_dependencies::deps_of
   7: cargo::core::compiler::unit_dependencies::deps_of
   8: cargo::core::compiler::unit_dependencies::deps_of_roots
   9: cargo::core::compiler::unit_dependencies::build_unit_dependencies
  10: cargo::ops::cargo_compile::create_bcx
  11: cargo::ops::cargo_compile::compile_ws
  12: cargo::ops::cargo_compile::compile
  13: cargo::ops::cargo_doc::doc
  14: cargo::commands::doc::exec
  15: cargo::cli::main
  16: cargo::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


Version

cargo 1.62.0-nightly (e2e2ddd 2022-04-05)
@AaronErhardt AaronErhardt added the C-bug Category: bug label Apr 8, 2022
@ehuss ehuss added the Z-scrape-examples Nightly: rustdoc scrape examples label Apr 8, 2022
@ehuss
Copy link
Contributor

ehuss commented Apr 8, 2022

cc @willcrichton

@willcrichton
Copy link
Contributor

I will take a look, thanks for the report @AaronErhardt.

@bors bors closed this as completed in 5f400f0 Apr 9, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 14, 2022
Update cargo

11 commits in e2e2dddebe66dfc1403a312653557e332445308b..dba5baf4345858c591517b24801902a062c399f8
2022-04-05 17:04:53 +0000 to 2022-04-13 21:58:27 +0000
- Part 6 of RFC2906 - Switch the inheritance source from `workspace` to… (rust-lang/cargo#10564)
- Part 5 of RFC2906 - Add support for inheriting `rust-version` (rust-lang/cargo#10563)
- Add support for rustc --check-cfg well known names and values (rust-lang/cargo#10486)
- Reserve filename `Cargo.toml.orig` in `cargo package` (rust-lang/cargo#10551)
- Retry command invocation with argfile (rust-lang/cargo#10546)
- Add a progress indicator for `cargo clean` (rust-lang/cargo#10236)
- Ensure host units don't depend on Docscrape units, fixes rust-lang/cargo#10545 (rust-lang/cargo#10549)
- Fix docs: Bindeps env vars are passed to build script at runtime (rust-lang/cargo#10550)
- Part 4 of RFC2906 - Add support for inheriting `readme` (rust-lang/cargo#10548)
- Part 3 of RFC2906 - Add support for inheriting `license-path`, and `depednency.path` (rust-lang/cargo#10538)
- Bump to 0.63.0, update changelog (rust-lang/cargo#10544)
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 14, 2022
Update cargo

11 commits in e2e2dddebe66dfc1403a312653557e332445308b..dba5baf4345858c591517b24801902a062c399f8
2022-04-05 17:04:53 +0000 to 2022-04-13 21:58:27 +0000
- Part 6 of RFC2906 - Switch the inheritance source from `workspace` to… (rust-lang/cargo#10564)
- Part 5 of RFC2906 - Add support for inheriting `rust-version` (rust-lang/cargo#10563)
- Add support for rustc --check-cfg well known names and values (rust-lang/cargo#10486)
- Reserve filename `Cargo.toml.orig` in `cargo package` (rust-lang/cargo#10551)
- Retry command invocation with argfile (rust-lang/cargo#10546)
- Add a progress indicator for `cargo clean` (rust-lang/cargo#10236)
- Ensure host units don't depend on Docscrape units, fixes rust-lang/cargo#10545 (rust-lang/cargo#10549)
- Fix docs: Bindeps env vars are passed to build script at runtime (rust-lang/cargo#10550)
- Part 4 of RFC2906 - Add support for inheriting `readme` (rust-lang/cargo#10548)
- Part 3 of RFC2906 - Add support for inheriting `license-path`, and `depednency.path` (rust-lang/cargo#10538)
- Bump to 0.63.0, update changelog (rust-lang/cargo#10544)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Z-scrape-examples Nightly: rustdoc scrape examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants