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

resolver in Cargo.toml changed MSRV #2603

Closed
TheBlueMatt opened this issue Aug 25, 2023 · 5 comments
Closed

resolver in Cargo.toml changed MSRV #2603

TheBlueMatt opened this issue Aug 25, 2023 · 5 comments

Comments

@TheBlueMatt
Copy link

More an FYI than a bug, I think, but #2602 said the following, which doesn't appear true for us:

But that's fine and the published serde crate won't be affected.

For our CI, building serde on rustc 1.48 and 1.49 now fails with:

   Downloaded serde v1.0.187
error: failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.187/Cargo.toml`

Caused by:
  feature `resolver` is required

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can add
  `cargo-features = ["resolver"]` to enable this feature
@dtolnay
Copy link
Member

dtolnay commented Aug 26, 2023

Thanks, I didn't realize Cargo would propagate that field from the workspace manifest into serde's manifest during publish. I don't understand why it does that — the choice of resolver is controlled by the top-level crate/workspace being built; serde as a dependency has no say in this.

I'll revert that change.

@epage
Copy link

epage commented Aug 31, 2023

We propagate the resolver version so that cargo install of a bin carries forward the expected behavior from the developer. See rust-lang/cargo#11047

@dtolnay
Copy link
Member

dtolnay commented Aug 31, 2023

I'd prefer if it did not do that for packages not containing any bin crates.

@epage
Copy link

epage commented Aug 31, 2023

At this time, the code responsible does not have that knowledge. However, I've been wanting to change our publish code to to explicitly list all auto targets at which point it would be possible to determine that. There still might be enough nuance to be annoying because examples are considered installable.

@dtolnay
Copy link
Member

dtolnay commented Aug 31, 2023

As an easier fix that still eliminates resolver-related breakage for libraries, could we make sure Cargo disregards any value of resolver in the manifest of library dependencies?

I tried editing $CARGO_HOME/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.188/Cargo.toml to add resolver = "100", and that currently makes crates depending on serde as a library fail with this error, on current nightly:

error: failed to download `serde v1.0.188`

Caused by:
  unable to get packages from source

Caused by:
  failed to download replaced source registry `crates-io`

Caused by:
  failed to parse manifest at `$CARGO_HOME/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.188/Cargo.toml`

Caused by:
  `resolver` setting `100` is not valid, valid options are "1" or "2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants