-
Notifications
You must be signed in to change notification settings - Fork 312
Fix cargo build when git branch is referenced #3654
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
Fix cargo build when git branch is referenced #3654
Conversation
Co-authored-by: Alex Domingo <[email protected]>
|
For visibility I'd like to discuss the alternatives we have so far here:
Advantage of 1) is that it is the flexibility: The code to print out the list can depend on e.g. the For reference a few formats from cargo docs 1 and 2 (not valid, just using the same crate as example): Cargo.toml: Cargo.lock: Given the different additional keys in |
|
That's a very good summary.
|
…ckwards compatibility
… definition in easyconfig
|
Test report by @Flamefire Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
|
This should now be ready. I'd like to unify workspace and non-workspace git crates (see Flamefire#9 (comment)) but my easy attempt failed as because in jsonpath/wasm it expects also a I assume it needs one checksum file for every Cargo.toml so the whole workspace-parsing code can be replaced by a glob. |
|
Test report by @lexming Overview of tested easyconfigs (in order)
Build succeeded for 24 out of 24 (24 easyconfigs in total) |
|
Merging, thanks @Flamefire ! |
(created using
eb --new-pr)This fixes a regression introduced by #3483 when handling cargo crates from git repositories after an issue was identified in easybuilders/easybuild-easyconfigs#22450.
Previously we replaced the git repository with
After that PR we included the revision to ensure the correct source is taken:
However a cargo crate might specify a branch instead of a revision:
jsonpath_lib = { version = "0.3", optional = true, git = "https://github.com/ritchie46/jsonpath", branch = "improve_compiled" }As the resolver is very strict it needs
branch = "improve_compiled"underrev = ...in this case. TheCargo.lockfile actually has that information but we ignored itSolution: Change the entry in the easyconfig crates list:
This PR implements support for that:
Noneor the branchbranch =if the specified branch is True-ishThis is required because our old format has no way for the revision and might use the wrong for one of those.
Using the new format here works unless the crates referenced this with a branch which should be rare enough
I also moved the offline-setup code to an own function to make it a bit easier to handle, and some refactoring of the collection code as pylint was noting e.g. that variables from the outer space are being redefined. Also the output should now be a bit more clear.