Skip to content

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

Closed
@taiki-e

Description

@taiki-e

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/github.com-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]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions