Package Collision & gitsubmodule

Hi, here is my issue.
I have three packages:

  1. The app called preamp-manager
  2. A first lib called lib-pap
  3. A second lib called lib_pap_proto

Each package has is own git repository. I use gitsubmodules to include the libs in the app and use them.

The app depends on the first lib and the second lib. But the the second lib depends on the first lib.

diag

When I try to build the app, I have a package collision.

gmichel@ubuntu:~/rust/102781_jam_preamp_manager/app/files$ cargo test
warning: unused manifest key: package.author
    Updating crates.io index
error: package collision in the lockfile: packages lib-pap v0.1.0 (/home/gmichel/rust/102781_jam_preamp_manager/libs/102782_preamp_proto/generate/rust/libs/102789_lib_pap_rust/files) and lib-pap v0.1.0 (/home/gmichel/rust/102781_jam_preamp_manager/libs/102789_lib_pap_rust/files) are different, but only one can be written to lockfile unambiguously

It says that the gitsubmodules lib-pap and the git submodule lib-pap of the gitsubmodule lib_pap_proto are different, but unless I am misstaken they are the same.

gmichel@ubuntu:~/rust/102781_jam_preamp_manager/app/files$ diff -r /home/gmichel/rust/102781_jam_preamp_manager/libs/102782_preamp_proto/generate/rust/libs/102789_lib_pap_rust/files /home/gmichel/rust/102781_jam_preamp_manager/libs/102789_lib_pap_rust/files

return nothing

I also used git submodule status:

gmichel@ubuntu:~/rust/102781_jam_preamp_manager$ git submodule status
 a6b93b8735370f33f0bad82d09ad089381e0b7f5 libs/102782_preamp_proto (heads/bugfix/NGJ_DNCI-710-fix-fetch-error-of-lib-pap-proto_0.1.0.bb)
 6a90b3b3a4ed66e2d6f75bbd90c119f527d468d0 libs/102789_lib_pap_rust (heads/develop)
gmichel@ubuntu:~/rust/102782_preamp_proto$ git submodule status
 6a90b3b3a4ed66e2d6f75bbd90c119f527d468d0 generate/rust/libs/102789_lib_pap_rust (heads/develop)

I hope I'm clear.
Thanks

You don’t need to use submodules; just specify git dependencies via cargo

Specifying Dependencies - The Cargo Book

Thanks for your reply.
I know that using gitsubmodules make it more complex than just importing a package from git by using a git URL in the cargo.toml. Yet its not a personal project. The choice of using git submodules is not mine.

What do your workspace's Cargo.tomls looks like ?

For the App

[package]
name = "preamp-manager"
version = "0.1.0"
edition = "2018"
author = ["SBY"]
repository = ********

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
num-traits = "0.2"
num-derive = "0.2"
num_enum = "0.5.4"
bytes = "1.0.1"
crc = "2.0.0"
lib_pap_proto = *******

for the lib 2

[package]
name = "lib_pap_proto"
version = "0.1.0"
edition = "2018"
author = ["GML"]
repository =  ********

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
prost = "0.8.0"
prost-types = "0.8"
lib-pap = {version = "0.1.0", path = "libs/102789_lib_pap_rust/files"}


[build-dependencies]
prost-build = "0.8.0"

for the lib 1

[package]
name = "lib-pap"
version = "0.1.0"
edition = "2018"
author = ["SBY"]
repository = ****************



[dependencies]
crc = "2.0.0"
bytes = "1.0.1"
num_enum = "0.5.4"

Edit: I reorganize my code to avoid the package collision

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.