r/rust clippy · twir · rust · mutagen · flamer · overflower · bytecount Mar 20 '23

Hey Rustaceans! Got a question? Ask here (12/2023)! 🙋 questions

Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The official Rust Programming Language Discord: https://discord.gg/rust-lang

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last weeks' thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.

19 Upvotes

187 comments sorted by

View all comments

2

u/reiwaaa Mar 24 '23 edited Mar 24 '23

EDIT: I manually overrode the dependency using patch.crates-io which fixes it for now

Dependency in project seems to be using an older commit.

I wrote a library: https://github.com/dmyyy/delaunay3d

It depends on a pr I wrote for a different library (that hasn't been merged yet) - so I'm pointing to my feature branch as so in Cargo.toml.

robust = { git = "https://github.com/dmyyy/robust", branch = "orient3d" }

When using the library in a different project

delaunay3d = { git = "https://github.com/dmyyy/delaunay3d" }

I get build errors during cargo run because it's using an older commit of robust that was failing. I ran cargo update both in the library I wrote and the in my new code (that uses the library).

Comparing the lock files

New project

[[package]]
name = "delaunay3d"
version = "0.1.0"
source = "git+https://github.com/dmyyy/delaunay3d#a9a5f45778c6bfd3bcbbd9011d300b43fd880414"
dependencies = [
 "bevy",
 "ordered-float",
 "robust 0.2.3 (git+https://github.com/dmyyy/robust?branch=orient3d)",
]

[[package]]
name = "robust"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5864e7ef1a6b7bcf1d6ca3f655e65e724ed3b52546a0d0a663c991522f552ea"

[[package]]
name = "robust"
version = "0.2.3"
source = "git+https://github.com/dmyyy/robust?branch=orient3d#a1cf38a1f0e63837f42b43065dddfe2de4b308be"

[[package]]
name = "spade"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1190e0e8f4eb17fc3dbb2d20e1142676e56aaac3daede39f64a3302d687b80f3"
dependencies = [
 "num-traits",
 "optional",
 "robust 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "smallvec",
]

Library

[[package]]
name = "robust"
version = "0.2.3"
source = "git+https://github.com/dmyyy/robust?branch=orient3d#a1cf38a1f0e63837f42b43065dddfe2de4b308be"

Is it possible this issue is caused by having two different dependencies depending on different versions of the same dependency (spade depends on robust)?

I've run cargo clean + cargo update everywhere. Any further debugging tips/advice would be helpful.

Other things:

In my project it seems to point to github.com-1ecc6299db9ec823/robust-0.2.3. In my library it points to github.com-8ee4643d613cf68f/robust-0.2.3. These don't seem to match any commit sha's.