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

import dependency errors #4063

Closed
0xNineteen opened this issue Mar 9, 2023 · 2 comments
Closed

import dependency errors #4063

0xNineteen opened this issue Mar 9, 2023 · 2 comments
Labels
question Further information is requested

Comments

@0xNineteen
Copy link

0xNineteen commented Mar 9, 2023

Description

trying to import lighthouse deps into another rust project leads to failed version requirements.

eg, trying to add the lighthouse_network crate using cargo add --path ../lighthouse/beacon_node/lighthouse_network leads to the error: error: failed to select a version for the requirement eth2_ssz = "^0.4.1" bc the crates link only goes up to 0.4.0.

note: this isnt a problem when building the project because eth2_ssz = "^0.4.1" is defined locally in consensus/ssz/Cargo.toml

~ cat consensus/ssz/Cargo.toml
[package]
name = "eth2_ssz"
version = "0.4.1"

Version

stable

Steps to resolve

i think changing the eth2_ssz requirements (and other local dependencies which have this same problem) to be path dependent would solve this problem but open to other solns

also happy to to open a PR and fix this myself when i get confirmation this is the right approach to fix - thanks! :)

@michaelsproul
Copy link
Member

It's possible to work-around the errors by using a [patch] section in your repo that follows the [patch] section in Lighthouse's top-level Cargo.toml. For examples of this, see these two external repos:

Long-term, our aim is to remove the [patch] section entirely by publishing our utility crates to crates.io. This will make it easier to use crates from Lighthouse (no more patch section) and the published crates can be used independently. You could even do this now if you are only interested in e.g. ssz or tree_hash. See this PR: #3890

@michaelsproul michaelsproul added the question Further information is requested label Mar 9, 2023
@0xNineteen
Copy link
Author

ah ok thanks!

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

No branches or pull requests

2 participants