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

rust-gmp dependency build break #20

Closed
ggutoski opened this issue Mar 25, 2021 · 1 comment
Closed

rust-gmp dependency build break #20

ggutoski opened this issue Mar 25, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ggutoski
Copy link
Contributor

The build is currently broken on master: https://github.com/axelarnetwork/tofnd/runs/2196540191

#25 125.5 error[E0463]: can't find crate for `serde_derive`
#25 125.5   --> /usr/local/cargo/git/checkouts/rust-gmp-ec80bc1e51a8ce8f/641a89f/src/lib.rs:13:1
#25 125.5    |
#25 125.5 13 | extern crate serde_derive;
#25 125.5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
#25 125.5 
#25 125.5 error: aborting due to previous error
@ggutoski ggutoski added the bug Something isn't working label Mar 25, 2021
@ggutoski ggutoski self-assigned this Mar 25, 2021
@ggutoski
Copy link
Contributor Author

Notes

curv repo tag v0.2.6 build breaks with the following error:

error[E0463]: can't find crate for `serde_derive`
--> /Users/gus/.cargo/git/checkouts/rust-gmp-ec80bc1e51a8ce8f/641a89f/src/lib.rs:13:1
|
13 | extern crate serde_derive;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

The problem is that the Cargo.toml for that tag specifies dependency

[dependencies.rust-gmp]
version = "0.5.0"
features = ["serde_support"]
git = "https://github.com/KZen-networks/rust-gmp"
optional = true

Now that rust-gmp has upgraded to 0.5.1 this breaks the build. Need to set version = "=0.5.0".

This commit to rust-gmp repo was pushed only 6 hours ago. Seems like the culprit: Merge pull request #1 from nmahendru/v0.5.1 · ZenGo-X/rust-gmp@641a89f. I left a comment on the guilty github PR.

tofn depends on multi-party-ecdsa tag v0.4.3, which in turn depends on curv tag v0.2.6, which is broken. So I would expect multi-party-ecdsa tag v0.4.3 also to be broken, but it's not.

In multi-party-ecdsa/Cargo.toml at v0.4.3 · ZenGo-X/multi-party-ecdsa I see

[patch.crates-io]
rust-gmp = { version = "0.5.0", features = ["serde_support"], git = "https://github.com/KZen-networks/rust-gmp" }

so this must be what fixes the build. Unfortunately, this doesn't work in tofnd or tofn.

Docs: See The [patch] section in Overriding Dependencies - The Cargo Book

Almost helpful: Patching dependencies does not work if it's for the same location but a different branch · Issue #5478 · rust-lang/cargo

The fix

Add --locked to the cargo install command in the Dockerfile for tofnd. This tells cargo not to ignore the Cargo.lock file. This file points to the right version of rust-gmp and so the project builds.

See SemVer-breaking patch release breaks the build from Dependency Resolution - The Cargo Book

Binary projects can alternatively recommend users to use the --locked flag with cargo install to use the original Cargo.lock that contains the known good version.

Docs for the --locked flag: cargo install - The Cargo Book

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant