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

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

Closed
sfackler opened this issue Apr 24, 2020 · 7 comments · Fixed by #8175
Closed

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

sfackler opened this issue Apr 24, 2020 · 7 comments · Fixed by #8175
Assignees
Labels
C-bug Category: bug Command-package regression-from-stable-to-stable Regression in stable that worked in a previous stable release.

Comments

@sfackler
Copy link
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)`
@sfackler sfackler added the C-bug Category: bug label Apr 24, 2020
@ehuss
Copy link
Contributor

ehuss commented Apr 24, 2020

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.

@ehuss ehuss self-assigned this Apr 24, 2020
@sfackler
Copy link
Member Author

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
Copy link
Member

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

@sfackler
Copy link
Member Author

sfackler commented May 1, 2020

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

@Mark-Simulacrum
Copy link
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
Copy link
Contributor

ehuss commented May 3, 2020

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
Copy link
Member

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

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue May 4, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue May 4, 2020
…roalbini

[stable] 1.43.1 release

* [Updated openssl-src to 1.1.1g for CVE-2020-1967.][71430]
* [Fixed the stabilization of AVX-512 features.][71473]
* [Fixed `cargo package --list` not working with unpublished dependencies.][cargo/8151]

[71430]: rust-lang#71430
[71473]: rust-lang#71473
[cargo/8151]: rust-lang/cargo#8151
ehuss pushed a commit to ehuss/cargo that referenced this issue May 6, 2020
Allow `cargo package --list` even for things that don't package.

`cargo package --list` was changed in rust-lang#7905 to generate `Cargo.lock` earlier. If there is a problem, then it would fail where previously it would succeed. This changes it so that file generation is deferred until after `--list`.

This also changes it so that the "dependencies must have a version" check is deferred until after `--list` as well.

Closes rust-lang#8151
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 17, 2020
Pkgsrc changes:
 * None.

Upstream changes:

Version 1.43.1 (2020-05-07)
===========================

* [Updated openssl-src to 1.1.1g for CVE-2020-1967.][71430]
* [Fixed the stabilization of AVX-512 features.][71473]
* [Fixed `cargo package --list` not working with unpublished dependencies.]
  [cargo/8151]

[71430]: rust-lang/rust#71430
[71473]: rust-lang/rust#71473
[cargo/8151]: rust-lang/cargo#8151
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 regression-from-stable-to-stable Regression in stable that worked in a previous stable release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants