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

Fails to Build Due to Cargo Patch #91

Closed
rauljordan opened this issue Mar 4, 2023 · 3 comments
Closed

Fails to Build Due to Cargo Patch #91

rauljordan opened this issue Mar 4, 2023 · 3 comments

Comments

@rauljordan
Copy link

Hi @ralexstokes, having some difficulties building due to the patch present in Cargo.toml it seems.

System

Ubuntu 22.04.2 LTS, x86

cargo --version
cargo 1.68.0-nightly (cc0a32087 2022-12-14)

The error also happens when using the stable toolchain

Error

$ cargo build
    Updating git repository `https://github.com/ralexstokes//ssz-rs`
warning: spurious network error (2 tries remaining): remote error: 
  ralexstokes//ssz-rs is not a valid repository name
  Visit https://support.github.com/ for help; class=Net (12)
warning: spurious network error (1 tries remaining): remote error: 
  ralexstokes//ssz-rs is not a valid repository name
  Visit https://support.github.com/ for help; class=Net (12)
error: failed to load source for dependency `ssz-rs`

Caused by:
  Unable to update https://github.com/ralexstokes//ssz-rs?rev=45ff6f1

Caused by:
  failed to fetch into: /home/zodiark/.cargo/git/db/ssz-rs-50b4fc47aaa300b4

Caused by:
  failed to authenticate when downloading repository: ssh://[email protected]/ralexstokes//ssz-rs

  * attempted ssh-agent authentication, but no usernames succeeded: `git`

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  remote error: 
    ralexstokes//ssz-rs is not a valid repository name
    Visit https://support.github.com/ for help; class=Net (12)
@rauljordan rauljordan changed the title Fails to Build Due to Cargo Path Fails to Build Due to Cargo Patch Mar 4, 2023
@michaelsproul
Copy link

+1 to cleaning up the patch situation. The current approach feels really hacky and requires all downstream dependencies of mev-rs to replicate the URL patch. E.g. we have this in Lighthouse:

https://github.com/sigp/lighthouse/blob/693886b94176faa4cb450f024696cb69cda2fe58/Cargo.toml#L107-L112

I tried to get rid of that just now, but I couldn't because mev-rs doesn't pin commit hashes in the Cargo.toml:

mev-rs/mev-rs/Cargo.toml

Lines 29 to 31 in cb34b70

ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus" }
beacon-api-client = { git = "https://github.com/ralexstokes/beacon-api-client", optional = true }
ssz-rs = { git = "https://github.com/ralexstokes/ssz-rs" }

I guess this approach was taken so that the commit hash could be pinned once for the entire workspace? If that's the case I think the trade-off isn't worth it: a significant UX burden for dependencies to save a few lines of duplication.

@michaelsproul
Copy link

I had a go at enacting my idea, but ran into different kinds of dependency hell: #95. Maybe the current setup isn't so bad.

@ralexstokes
Copy link
Owner

hi @rauljordan @michaelsproul sorry for the hassle here, I'm fixing this in #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants