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

[workspace] Prereleases with path dependencies fail #7007

Closed
dignifiedquire opened this issue Jun 4, 2019 · 3 comments · Fixed by #7191
Closed

[workspace] Prereleases with path dependencies fail #7007

dignifiedquire opened this issue Jun 4, 2019 · 3 comments · Fixed by #7191
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.

Comments

@dignifiedquire
Copy link

Problem

I am not certain this is a bug, but at least it is very surprising to me:

  • Using workspaces with multiple crates a and b
  • b depends on a, using a = {version = "^0.1", path = "../a"}
  • All is fine, e.g cargo test --all works
  • Bumping a to a prerelease of 0.1.1-alpha.0 triggers the following error
$ cargo test --all
error: no matching package named `a` found
location searched: /Users/dignifiedquire/opensource/cargo-workspace-prerelease/a
perhaps you meant: a
required by package `b v0.1.0 (/Users/dignifiedquire/opensource/cargo-workspace-prerelease/b)`

Steps

  1. Clone https://github.com/dignifiedquire/cargo-workspace-prerelease-bug
  2. Run cargo test --all

Possible Solution(s)

It would be great if it either worked, or at least the error message was more clear as to what the actual problem is.

Notes

Output of cargo version:

cargo version
cargo 1.36.0-nightly (c4fcfb725 2019-05-15)
@ehuss
Copy link
Contributor

ehuss commented Jun 4, 2019

I think this is to be expected, caret requirements do not select pre-release versions. The error message could definitely be better.

@ehuss ehuss added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Jun 4, 2019
@dignifiedquire
Copy link
Author

Is there any selector that would work? Neither *, nor ~0.1, nor >=0.1 work.

@sfackler
Copy link
Member

sfackler commented Jun 4, 2019

0.1.1-alpha.0 will work.

@ehuss ehuss removed the C-bug Category: bug label Jun 7, 2019
debris added a commit to debris/cargo that referenced this issue Jul 30, 2019
bors added a commit that referenced this issue Aug 1, 2019
improve error message for unmatched prerelease dependencies

fixes #7007

error message before:

```
error: no matching package named `a` found
location searched: [..]
perhaps you meant: a
required by package `b v0.1.0 ([..])`
```

error message now

```
error: no matching package named `a` found
location searched: [..]
prerelease package needs to be specified explicitly
a = { version = "0.1.1-alpha.0" }
required by package `b v0.1.0 ([..])`
```
@bors bors closed this as completed in #7191 Aug 1, 2019
alessandrod added a commit to aya-rs/aya-log that referenced this issue Apr 23, 2022
Fixes

[2022-04-23T08:19:29Z WARN ] Fatal: Invalid TOML file format: Error during execution of `cargo metadata`: error: no matching package found
    searched package name: `aya-log-common`
    prerelease package needs to be specified explicitly
    aya-log-common = { version = "0.1.3-alpha.0" }
    location searched: /home/alessandro/aya-log/aya-log-common
    required by package `aya-log v0.1.2 (/home/alessandro/aya-log/aya-log)`

See rust-lang/cargo#7007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants