rust-lang / rust-lang/rust

Regression affecting `static-init` versions 1.0.1-1.0.3: "failed to resolve: use of unresolved module or unlinked crate `parking_lot`"

Open
#150,646 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug regression-from-stable-to-stable relnotes S-has-bisection T-cargo
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

[INFO] [stdout] error[E0433]: failed to resolve: use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/static_init-1.0.3/src/lazy_sequentializer.rs:336:13
[INFO] [stdout]     |
[INFO] [stdout] 336 |         use parking_lot::lock_api::GetThreadId;
[INFO] [stdout]     |             ^^^^^^^^^^^ use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]     |
[INFO] [stdout]     = help: if you wanted to use a crate named `parking_lot`, use `cargo add parking_lot` to add it to your `Cargo.toml`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0433]: failed to resolve: use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/static_init-1.0.3/src/lazy_sequentializer.rs:371:21
[INFO] [stdout]     |
[INFO] [stdout] 371 |                 use parking_lot::lock_api::GetThreadId;
[INFO] [stdout]     |                     ^^^^^^^^^^^ use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]     |
[INFO] [stdout]     = help: if you wanted to use a crate named `parking_lot`, use `cargo add parking_lot` to add it to your `Cargo.toml`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0433]: failed to resolve: use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/static_init-1.0.3/src/lazy_sequentializer.rs:338:13
[INFO] [stdout]     |
[INFO] [stdout] 338 |             parking_lot::RawThreadId.nonzero_thread_id().into(),
[INFO] [stdout]     |             ^^^^^^^^^^^ use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]     |
[INFO] [stdout]     = help: if you wanted to use a crate named `parking_lot`, use `cargo add parking_lot` to add it to your `Cargo.toml`
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error[E0433]: failed to resolve: use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/static_init-1.0.3/src/lazy_sequentializer.rs:372:26
[INFO] [stdout]     |
[INFO] [stdout] 372 |                 if id == parking_lot::RawThreadId.nonzero_thread_id().into() {
[INFO] [stdout]     |                          ^^^^^^^^^^^ use of unresolved module or unlinked crate `parking_lot`
[INFO] [stdout]     |
[INFO] [stdout]     = help: if you wanted to use a crate named `parking_lot`, use `cargo add parking_lot` to add it to your `Cargo.toml`

This regression appears to affect the static-init crate versions 1.0.1-1.0.3, when built with debug_assertions on.

Explanation of the regression (Edit: This explanation is wrong), according to @cuviper, copied from zulip:

  • static-init's feature "debug_order" enables parking-lot
  • the code that uses it is gated on cfg(debug_mode) (not feature)
  • the build script sets cfg "debug_mode" for feature "debug_order" or for debug_assertions, until 1.0.4 removed the latter
  • thus it was trying to use parking-lot in all debug builds until 1.0.4 fixed that

and I think it's clearly the intention of #149273 that they shouldn't have been able to use parking-lot implicitly before

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Crater logs and the failure in static_init-1.0.3/src/lazy_sequentializer.rs at lines 336-372. Compare the affected 1.0.1-1.0.3 behavior with the 1.0.4 change and issue #149273, then reproduce a debug build; done means the affected crates no longer fail because parking_lot is unresolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.