Skip to content

cargo package --list requires all dependencies to be published in 1.43.0 #8151

Closed
@sfackler

Description

@sfackler
Member

I have some internal distribution packaging logic that uses cargo package --list to find the set of files it should bundle up along with the binary (respecting gitignore, include/exclude, etc).

However, in 1.43 it appears that the command now requires any dependencies of the crate be published for it to work.

Test repository: https://github.com/sfackler/package-regression

On 1.42.0:

$ cargo package --list
warning: manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
.cargo_vcs_info.json
.gitignore
Cargo.lock
Cargo.toml
src/main.rs

On 1.43.0:

warning: manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
    Updating crates.io index
error: no matching package named `subcrate` found
location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `package-regression v0.1.0 (/Users/sfackler/package-regression)`

Activity

ehuss

ehuss commented on Apr 24, 2020

@ehuss
Contributor

Yea, the problem is that it now tries to generate Cargo.lock from the package-ready Cargo.toml where the path entries have been removed (here). This was changed in #7905. I'll take a look at deferring that or making it lazy so that it doesn't affect --list.

self-assigned this
on Apr 24, 2020
sfackler

sfackler commented on Apr 24, 2020

@sfackler
MemberAuthor

If you're poking around, there's also this check that'd be great to remove from --list:

error: all path dependencies must have a version specified when packaging.
dependency `subcrate` does not specify a version.
alexcrichton

alexcrichton commented on Apr 24, 2020

@alexcrichton
Member

@sfackler I think that warning/error is addressed by rust-lang/rfcs#2906

added a commit that references this issue on Apr 28, 2020

Auto merge of #8175 - ehuss:allow-package-list, r=alexcrichton

ade4c7b
sfackler

sfackler commented on May 1, 2020

@sfackler
MemberAuthor

Any chance of folding the fix for this into 1.34.1? cc @Mark-Simulacrum

Mark-Simulacrum

Mark-Simulacrum commented on May 2, 2020

@Mark-Simulacrum
Member

I'm happy to do so on release team side, @ehuss or @rust-lang/cargo, can someone sign off on that? I can work on a backport and such tomorrow.

ehuss

ehuss commented on May 3, 2020

@ehuss
Contributor

Seems fine to me. @Mark-Simulacrum or @sfackler are you ok with submitting all the PRs? At a minimum, #8138 will also need to be included to get CI to pass. I think stable will also need #8080, and maybe #8098. There might be others.

Mark-Simulacrum

Mark-Simulacrum commented on May 3, 2020

@Mark-Simulacrum
Member

I will try to do the legwork (most likely self approving if no one objects) later today.

added a commit that references this issue on May 4, 2020
5cd6285
added a commit that references this issue on May 6, 2020

Auto merge of rust-lang#8175 - ehuss:allow-package-list, r=alexcrichton

f42ed7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @ehuss@alexcrichton@sfackler@Mark-Simulacrum

    Issue actions

      cargo package --list requires all dependencies to be published in 1.43.0 · Issue #8151 · rust-lang/cargo