build fails #5

Closed
opened 2 years ago by jahway603 · 20 comments
Collaborator

To reproduce:

git clone https://git.hush.is/hush/SilentDragonPaper
cd SilentDragonPaper/cli
cargo build --release

System(s) tested
OS: Arch Linux & Debian 11 Bullseye

Expectation:

  • Build works and binary ./SilentDragonPaper gets created

Actual resulting error:

It fails and spits this out at the end...

    Updating crates.io index
    Updating git repository `https://git.hush.is/hush/librustzcash`
error: failed to select a version for the requirement `aes = "^0.2"`
candidate versions found which didn't match: 0.8.1, 0.8.0, 0.7.5, ...
location searched: crates.io index
required by package `zcash_primitives v0.0.0 (https://git.hush.is/hush/librustzcash?rev=5a48d179b8434a0318e7e19dda506e245a904092#5a48d179)`
    ... which satisfies git dependency `zcash_primitives` of package `silentdragonpaper v0.2.0 (/mnt/mydata/AUR/silentdragonpaper/test/src/silentdragonpaper/lib)`
    ... which satisfies path dependency `silentdragonpaper` of package `SilentDragonPaper v0.2.0 (/mnt/mydata/AUR/silentdragonpaper/test/src/silentdragonpaper/cli)`
==> ERROR: A failure occurred in build().
    Aborting...
To reproduce: ``` git clone https://git.hush.is/hush/SilentDragonPaper cd SilentDragonPaper/cli cargo build --release ``` System(s) tested OS: Arch Linux & Debian 11 Bullseye Expectation: - Build works and binary ./SilentDragonPaper gets created Actual resulting error: It fails and spits this out at the end... ``` Updating crates.io index Updating git repository `https://git.hush.is/hush/librustzcash` error: failed to select a version for the requirement `aes = "^0.2"` candidate versions found which didn't match: 0.8.1, 0.8.0, 0.7.5, ... location searched: crates.io index required by package `zcash_primitives v0.0.0 (https://git.hush.is/hush/librustzcash?rev=5a48d179b8434a0318e7e19dda506e245a904092#5a48d179)` ... which satisfies git dependency `zcash_primitives` of package `silentdragonpaper v0.2.0 (/mnt/mydata/AUR/silentdragonpaper/test/src/silentdragonpaper/lib)` ... which satisfies path dependency `silentdragonpaper` of package `SilentDragonPaper v0.2.0 (/mnt/mydata/AUR/silentdragonpaper/test/src/silentdragonpaper/cli)` ==> ERROR: A failure occurred in build(). Aborting... ```
Collaborator

@jahway603 Confirmed I get the same error on Debian 11. I was getting the same error when I tried building several months ago.

@jahway603 Confirmed I get the same error on Debian 11. I was getting the same error when I tried building several months ago.
Collaborator

I have the same error on the latest Linux Mint machine. Last time I was using SDP a year ago it was working fine.

Update: rustc 1.56.0

I have the same error on the latest Linux Mint machine. Last time I was using SDP a year ago it was working fine. Update: `rustc 1.56.0`
Owner

@onryo @jahway603 @fekt please report the version of Rust you are using. This is most likely caused by not pinning our version of Rust and the versions of dependencies we need not being compatible with the latest versions of Rust

@onryo @jahway603 @fekt please report the version of Rust you are using. This is most likely caused by not pinning our version of Rust and the versions of dependencies we need not being compatible with the latest versions of Rust
Owner

./build.sh must be used, which does pin the version of Rust to 1.48, which is compatible with our dependencies. Just built it fine on Ubuntu

`./build.sh` must be used, which does pin the version of Rust to 1.48, which is compatible with our dependencies. Just built it fine on Ubuntu
Poster
Collaborator

On Debian 11, rustc 1.58.1
On Arch, rustc 1.56.0

  • I can also run ./build.sh on either Debian 11 or Arch and this will build SDP with a pinned rustc 1.48.0 -- this also fails

  • I can also run rustup default 1.48.0 and then run cargo build --release which builds using 1.48.0 -- that also fails

On Debian 11, rustc 1.58.1 On Arch, rustc 1.56.0 - I can also run ./build.sh on either Debian 11 or Arch and this will build SDP with a pinned rustc 1.48.0 -- this also fails - I can also run `rustup default 1.48.0` and then run `cargo build --release` which builds using 1.48.0 -- that also fails
Owner

I just updated the instructions in README to be more useful

I just updated the instructions in README to be more useful
Poster
Collaborator

./build.sh must be used, which does pin the version of Rust to 1.48, which is compatible with our dependencies. Just built it fine on Ubuntu

Which Ubuntu version? This might require a docker for that version so everyone can build it.

> `./build.sh` must be used, which does pin the version of Rust to 1.48, which is compatible with our dependencies. Just built it fine on Ubuntu Which Ubuntu version? This might require a docker for that version so everyone can build it.
Owner

Ok, we tracked this down to crates.io hating backward compatibility and purposefully breaking existing code by deleting old packages we depend on. At least aes and hmac and likely more

Ok, we tracked this down to crates.io hating backward compatibility and purposefully breaking existing code by deleting old packages we depend on. At least `aes` and `hmac` and likely more
Owner

~/.cargo/registry/src/ has cached crate versions

i think we can take a cached crate version, add it to our repo, and update Cargo.toml to use a file path instead of a crate name. I think that is likely our best option that is the least work

~/.cargo/registry/src/ has cached crate versions i think we can take a cached crate version, add it to our repo, and update Cargo.toml to use a file path instead of a crate name. I think that is likely our best option that is the least work
Owner

One alternate plan, that is very easy to try:

Upgrade the versions of aes/hmac and possibly others to the oldest version still on crates.io, and see if things work. That is easier than adding cached crate versions to our repo, and is better for technical debt, but could introduce weird bugs.

One alternate plan, that is very easy to try: Upgrade the versions of aes/hmac and possibly others to the oldest version still on crates.io, and see if things work. That is easier than adding cached crate versions to our repo, and is better for technical debt, but could introduce weird bugs.
Poster
Collaborator

One alternate plan, that is very easy to try:

Upgrade the versions of aes/hmac and possibly others to the oldest version still on crates.io, and see if things work. That is easier than adding cached crate versions to our repo, and is better for technical debt, but could introduce weird bugs.

I had that thought too.

> One alternate plan, that is very easy to try: > > Upgrade the versions of aes/hmac and possibly others to the oldest version still on crates.io, and see if things work. That is easier than adding cached crate versions to our repo, and is better for technical debt, but could introduce weird bugs. I had that thought too.
Owner

I am working on this. I created a dev branch of librustzcash, since it didn't have one, and I am seeing what it takes to increase our versions of some crates. It requires updating Cargo.toml in various places. I also just created https://git.hush.is/hush/blake2-rfc which is a mirror of https://github.com/cesarb/blake2-rfc because we were depending on an older zcash fork of that repo, and reducing our dependence on Github is good.

I am working on this. I created a `dev` branch of librustzcash, since it didn't have one, and I am seeing what it takes to increase our versions of some crates. It requires updating Cargo.toml in various places. I also just created https://git.hush.is/hush/blake2-rfc which is a mirror of https://github.com/cesarb/blake2-rfc because we were depending on an older zcash fork of that repo, and reducing our dependence on Github is good.
Owner

I went down somewhat of a rabbit hole, but fixed the issue with aes dependency. Now it complains about this:

$ cargo build
    Updating crates.io index
    Updating git repository `https://git.hush.is/hush/librustzcash`
    Updating git repository `https://git.hush.is/hush/blake2-rfc`
    Updating git repository `https://git.hush.is/hush/blake2-rfc`
error: failed to select a version for the requirement `hmac = "^0.4"`
candidate versions found which didn't match: 0.12.1, 0.12.0, 0.11.0, ...
location searched: crates.io index
required by package `hmac-drbg v0.1.0`
    ... which is depended on by `libsecp256k1 v0.2.2`
    ... which is depended on by `silentdragonpaper v0.2.0 (.../SilentDragonPaper/lib)`
    ... which is depended on by `SilentDragonPaper v0.2.0 (.../SilentDragonPaper/cli)`

I have been testing by running cargo build in librustzcash directly, and it gets a different error that we also likely need to fix:

hush/librustzcash#3

I am starting to think that maybe we should just include old cached code versions directly in our repo, but I am willing to push this forward a bit more. From what I see on crates.io, most old crates are still there, only a few are missing.

I went down somewhat of a rabbit hole, but fixed the issue with `aes` dependency. Now it complains about this: ``` $ cargo build Updating crates.io index Updating git repository `https://git.hush.is/hush/librustzcash` Updating git repository `https://git.hush.is/hush/blake2-rfc` Updating git repository `https://git.hush.is/hush/blake2-rfc` error: failed to select a version for the requirement `hmac = "^0.4"` candidate versions found which didn't match: 0.12.1, 0.12.0, 0.11.0, ... location searched: crates.io index required by package `hmac-drbg v0.1.0` ... which is depended on by `libsecp256k1 v0.2.2` ... which is depended on by `silentdragonpaper v0.2.0 (.../SilentDragonPaper/lib)` ... which is depended on by `SilentDragonPaper v0.2.0 (.../SilentDragonPaper/cli)` ``` I have been testing by running `cargo build` in librustzcash directly, and it gets a different error that we also likely need to fix: https://git.hush.is/hush/librustzcash/issues/3 I am starting to think that maybe we should just include old cached code versions directly in our repo, but I am willing to push this forward a bit more. From what I see on crates.io, most old crates are still there, only a few are missing.
Owner

hmac issue is now fixed on dev, now stuck with this "with_params" issue:

error[E0599]: no function or associated item named `with_params` found for struct `Blake2s` in the current scope
hmac issue is now fixed on `dev`, now stuck with this "with_params" issue: ``` error[E0599]: no function or associated item named `with_params` found for struct `Blake2s` in the current scope ```
Owner

FYI I did try the route of importing old code versions into our repo, I did it with aes-0.2.0, which did work, but then dependencies of aes-0.2.0 also needed to be added, because Rust core devs removed those too (which are all in the same git repo) and I stopped there.

FYI I did try the route of importing old code versions into our repo, I did it with aes-0.2.0, which did work, but then dependencies of aes-0.2.0 also needed to be added, because Rust core devs removed those too (which are all in the same git repo) and I stopped there.
Poster
Collaborator

zcash has same issue with their paper wallet

zcash has [same issue](https://github.com/adityapk00/zecpaperwallet/issues/14) with their paper wallet
Poster
Collaborator

My goal is to make this build with cargo build --offline

My goal is to make this build with `cargo build --offline`
Poster
Collaborator

This issue is fixed in commit 80584c3832, so closing this issue.

This issue is fixed in commit https://git.hush.is/hush/SilentDragonPaper/commit/80584c3832bc2dd8f546baca2da362e86efaec2f, so closing this issue.
jahway603 closed this issue 1 year ago
Poster
Collaborator

I was able to get it to build on Arch, but then updating the Arch package failed. I tested this on both Debian 11 and Ubuntu 20.04 and they both failed - so re-opening issue until I get this working on everything.

I was able to get it to build on Arch, but then [updating the Arch package failed](https://git.hush.is/jahway603/AUR-packages/issues/3). I tested this on both Debian 11 and Ubuntu 20.04 and they both failed - so re-opening issue until I get this working on everything.
jahway603 reopened this issue 1 year ago
Poster
Collaborator

The new SDP build process works and is documented in the README.md. It was successfully tested with rust 1.64.0 on Arch Linux (installed via rustup) and with rust 1.65.0 on Ubuntu 20.04 (installed via apt). Unfortunately, rustc 1.48 no longer builds this, so Issue #9 has been created to track and fix that.

The new SDP build process works and is documented in the README.md. It was successfully tested with rust 1.64.0 on Arch Linux (installed via rustup) and with rust 1.65.0 on Ubuntu 20.04 (installed via apt). Unfortunately, rustc 1.48 no longer builds this, so Issue https://git.hush.is/hush/SilentDragonPaper/issues/9 has been created to track and fix that.
jahway603 closed this issue 1 year ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.