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

Manifests with a resolver field will be published even if the MSRV is less than 1.51 #10954

Closed
taiki-e opened this issue Aug 9, 2022 · 2 comments · Fixed by #10961
Closed
Labels
C-bug Category: bug Command-package P-high Priority: High regression-from-stable-to-beta Regression in beta that previously worked in stable.

Comments

@taiki-e
Copy link
Member

taiki-e commented Aug 9, 2022

Problem

On the recent nightly, it seems that cargo package and cargo publish always generate a resolver field, regardless of MSRV or edition.

This makes it impossible to compile on rustc versions such as 1.50, where the resolver field was unstable, even if the MSRV of the published crate is smaller than 1.51.

error: failed to parse manifest at `/home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/async-channel-1.7.0/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

Probably related to #10911
cc @Nemo157

Steps

To reproduce:

$ cargo new --lib repro 
$ cd repro
$ sed -i 's/edition = "2021"/edition = "2018"/' Cargo.toml
$ cargo package --allow-dirty
$ cat target/package/repro-0.1.0/Cargo.toml | grep resolver
resolver = "1"

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.65.0-nightly (4fd148c47 2022-08-03)
release: 1.65.0-nightly
commit-hash: 4fd148c47e733770c537efac5220744945d572ef
commit-date: 2022-08-03
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.79.1 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 12.5.0 [64-bit]
@taiki-e taiki-e added the C-bug Category: bug label Aug 9, 2022
@ehuss ehuss added P-high Priority: High Command-package regression-from-stable-to-beta Regression in beta that previously worked in stable. labels Aug 9, 2022
@epage
Copy link
Contributor

epage commented Aug 9, 2022

@Nemo157 would you be willing to follow up on this as its a bug in #10911 (that we all overlooked)?

Our thought is to skip resolve = "1" if that is what will be inferred anyways.

@Nemo157
Copy link
Member

Nemo157 commented Aug 9, 2022

Yep, I think I still have the commit that did that in the reflog somewhere, I'll try and find it.

@bors bors closed this as completed in 1fcbca8 Aug 10, 2022
bors added a commit that referenced this issue Aug 11, 2022
[BETA 1.64] Only override published resolver when the workspace is different

### What does this PR try to resolve?

Ensures when publishing a package that uses an implicit `resolver = "1"` to maintain an MSRV before the `resolver` key was stabilized the implicitness is retained rather than being turned into an explicit setting.

fixes #10954 (assuming that the workspace and its packages are configured with a consistent resolver)

Note: this is a backport of #10961 to beta
Amanieu added a commit to Amanieu/libc that referenced this issue Aug 11, 2022
bors added a commit to rust-lang/libc that referenced this issue Aug 11, 2022
bors added a commit to rust-lang/libc that referenced this issue Aug 11, 2022
TommyCpp added a commit to TommyCpp/opentelemetry-rust that referenced this issue Aug 13, 2022
TommyCpp added a commit to TommyCpp/opentelemetry-rust that referenced this issue Aug 13, 2022
TommyCpp added a commit to open-telemetry/opentelemetry-rust that referenced this issue Aug 14, 2022
* fix(common): clippy issue raised by 1.63

* fix(common): nightly issues

* fix(jaeger): take self reference for `collector_password`

* fix(common): pin serde to 1.0142 as workaround of rust-lang/cargo#10954

* fix(doc): fix type link in docs
tatref pushed a commit to tatref/libc that referenced this issue Mar 20, 2023
Gmanboy added a commit to Gmanboy/opentelemetry-rust that referenced this issue Aug 12, 2024
* fix(common): clippy issue raised by 1.63

* fix(common): nightly issues

* fix(jaeger): take self reference for `collector_password`

* fix(common): pin serde to 1.0142 as workaround of rust-lang/cargo#10954

* fix(doc): fix type link in docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-package P-high Priority: High regression-from-stable-to-beta Regression in beta that previously worked in stable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants