-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 cannot merge crates with the same lockfile commit and rev commit hash #15252
Comments
Thanks for the bug report. By just skimming at the two “Compiling” statuses, I think this is a duplicate of this issue: Cargo as of now considers different git URLs as different sources. Going to close as a dup of #7497, if you don't mind. |
I'm saying the rev attitude causes this problem, this is a bug with that. |
Sorry not being clearer. That was exactly what I was talking about. If you have two git dependency of the same package on the same revision, but the |
If this is not the issue you are talking about, please give a minimal reproducible example so we can investigate. |
When I was testing this, the length did not make a difference. |
the three rust projects above are versioned at the correct commits to test and play around with to see what I was describing, I could never get rev to work. |
I'll give it a shot when I am available. If you could show a reproduction of how you specify the full hash but still not working, it would be great. |
I made these changes to those projects iced aw diff --git a/Cargo.toml b/Cargo.toml
index 11abb3d..997130c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -70,14 +70,15 @@ web-time = "1.1.0"
[dependencies.iced]
version = "0.14.0-dev"
git = "https://github.com/iced-rs/iced.git"
-# rev = "beddf49c"
+rev = "beddf49c76f3b43e7b33452831e1293cad28fd89"
default-features = false
features = ["advanced", "wgpu"]
[dependencies.iced_fonts]
version = "0.2.0"
-git = "https://github.com/redhawk18/iced_fonts.git"
-branch = "next"
+# git = "https://github.com/redhawk18/iced_fonts.git"
+# branch = "next"
+path = "../iced_fonts/"
# [profile.dev.package."*"]
# opt-level = 2 iced fonts diff --git a/Cargo.toml b/Cargo.toml
index 7500cda..73ce729 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,8 +23,8 @@ iced_core = "0.14.0-dev"
iced_widget = "0.14.0-dev"
[patch.crates-io]
-iced_core = { git = "https://github.com/iced-rs/iced.git" }
-iced_widget = { git = "https://github.com/iced-rs/iced.git" }
+iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" }
+iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" }
[package.metadata.docs.rs]
features = ["required", "full"] kuiper diff --git a/Cargo.toml b/Cargo.toml
index a1b4a83..d7d73cb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -50,5 +50,7 @@ iced = { git = 'https://github.com/iced-rs/iced.git' }
iced_core = { git = 'https://github.com/iced-rs/iced.git' }
iced_runtime = { git = 'https://github.com/iced-rs/iced.git' }
iced_widget = { git = 'https://github.com/iced-rs/iced.git' }
-iced_aw = { git = 'https://github.com/redhawk18/iced_aw.git' }
-iced_fonts = { git = 'https://github.com/redhawk18/iced_fonts.git', branch = "next" }
+# iced_aw = { git = 'https://github.com/redhawk18/iced_aw.git' }
+iced_aw = { path = "../iced_aw/" }
+# iced_fonts = { git = 'https://github.com/redhawk18/iced_fonts.git', branch = "next" }
+iced_fonts = { path = "../iced_fonts/" } Also please notice that kuiper compiles before you apply these patch files, so the double crates causes compiler errors. |
Ahh! saw some common mistakes in your previous attempt. First, run $ cargo tree -i iced_core
error: There are multiple `iced_core` packages in your project, and the specification `iced_core` is ambiguous.
Please re-run this command with one of the following specifications:
git+https://github.com/iced-rs/iced.git?rev=beddf49c76f3b43e7b33452831e1293cad28fd89#iced_core@0.14.0-dev
git+https://github.com/iced-rs/iced.git#iced_core@0.14.0-dev And then disambiguate it $ cargo tree -i git+https://github.com/iced-rs/iced.git#iced_core@0.14.0-dev
iced_core v0.14.0-dev (https://github.com/iced-rs/iced.git#beddf49c)
|-- iced v0.14.0-dev (https://github.com/iced-rs/iced.git#beddf49c)
| `-- kuiper_gui v0.1.0 (/workspace/kuiper/gui)
| `-- kuiper v0.1.0 (/workspace/kuiper)
|-- iced_fonts v0.2.0 (/workspace/iced_fonts)
| |-- iced_aw v0.12.1 (/workspace/iced_aw)
| | `-- kuiper_gui v0.1.0 (/workspace/kuiper/gui) (*)
| `-- kuiper_gui v0.1.0 (/workspace/kuiper/gui) (*)
|-- iced_futures v0.14.0-dev (https://github.com/iced-rs/iced.git#beddf49c)
| |-- iced v0.14.0-dev (https://github.com/iced-rs/iced.git#beddf49c) (*)
... So it is clearly that Since The solution should be simple: updating [patch.crates-io]
-iced = { git = 'https://github.com/iced-rs/iced.git' }
-iced_core = { git = 'https://github.com/iced-rs/iced.git' }
-iced_runtime = { git = 'https://github.com/iced-rs/iced.git' }
-iced_widget = { git = 'https://github.com/iced-rs/iced.git' }
+iced = { git = 'https://github.com/iced-rs/iced.git', rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" }
+iced_core = { git = 'https://github.com/iced-rs/iced.git', rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" }
+iced_runtime = { git = 'https://github.com/iced-rs/iced.git', rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" }
+iced_widget = { git = 'https://github.com/iced-rs/iced.git', rev = "beddf49c76f3b43e7b33452831e1293cad28fd89" } |
Problem
There should only be one version of this crate
Steps
Possible Solution(s)
I did fix this, I just wanted to ask if this is a bug or not with cargo because if it's not it's still silly and needs to be fixed either way.
What I had to do is remove all rev attributes and rely on the Cargo.lock file instead, this is my collection of my application first and then the libraries.
https://github.com/Redhawk18/kuiper/blob/08ebe8d0102ee21a0e23ba611ef97813129c9ca0/Cargo.toml#L48
https://github.com/Redhawk18/iced_aw/blob/4a77e45464b03bb8bd93f92e8c13f1d58670ae3f/Cargo.toml#L70
https://github.com/Redhawk18/iced_fonts/blob/df5e170b74dae255107f3966f1e34dce8b96365a/Cargo.toml#L21
Notes
No response
Version
The text was updated successfully, but these errors were encountered: