-
Notifications
You must be signed in to change notification settings - Fork 282
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
update Cargo
easyblock to extract crates into a vendor subdir and overwrite git repo URLs with local paths
#3118
Conversation
@boegelbot please test @ generoso |
@lexming: Request for testing this PR well received on login1 PR test command '
Test results coming soon (I hope)... - notification for comment with ID 1919188427 processed Message to humans: this is just bookkeeping information for me, |
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 5 out of 5 (5 easyconfigs in total) |
…instead of [sources]
@boegelbot please test @ generoso |
@lexming: Request for testing this PR well received on login1 PR test command '
Test results coming soon (I hope)... - notification for comment with ID 1920915926 processed Message to humans: this is just bookkeeping information for me, |
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 5 out of 5 (5 easyconfigs in total) |
Test case for fix1 - DeltaLake:
|
Test case for fix2 - polars:
|
@Micket this is ready on my side, not touching it any more |
Cargo
easyblock to extract crates into a vendor subdir and overwrite git repo URLs with local paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This evolved into a 2x1 PR, apologies for the added complexity.
Fix 1: extract crates into vendor subdir
Currently, the sources of the main
Cargo
package and the sources of all crates are all extracted intobuilddir
. This is known to make some installations fail. The presence of the main sources alongside its dependencies can makecargo
trip in identifying availability of vendored sources. See related comment below.Not all
Cargo
packages are affected, but it seems to happen on more complex packaging. For instance, known failure is a package with a virtual workspace distributing multiple crates plus a another package in a subdir.This PR solves this issue by extracting the list of
crates
into a separate vendor subdir without any sources of the main packages (i.e. items in thesources
list of the easyconfig). This follows the same approach carried out by thecargo vendor
command.Fix 2: overwrite crates from git repos with local paths
I hit another issue where
cargo
was failing to locate the extracted sources of a dependency pulled from a git repo. The sources are properly downloaded and extracted from the git repo and the checksuming of the local sources is done properly. However,Cargo.lock
of the main package being installed does not list any checksum for those dependencies pulled from a git repo, socargo
has no way to correlate the extracted folder to this dependency.This PR solves this issue by overwriting the repo URL of each package pulled from a git repo with the local paths to the corresponding extracted folders. This is done in the generated
.cargo/config.toml
file by using the[patch.URL]
directive as describe in the rust docs instead of[source.URL]
.For instace,
becomes
Changelog
self.builddir.easybuild_vendor
finalpath
of extracted sources by detecting.cargo/config.toml
file[source.URL]
with[patch.URL]
to overwrite git repos with local paths to extracted sources