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)... Details- 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)... Details- 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
This evolved into a 2x1 PR, apologies for the added complexity.
Fix 1: extract crates into vendor subdir
Currently, the sources of the main
Cargopackage 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 makecargotrip in identifying availability of vendored sources. See related comment below.Not all
Cargopackages 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
cratesinto a separate vendor subdir without any sources of the main packages (i.e. items in thesourceslist of the easyconfig). This follows the same approach carried out by thecargo vendorcommand.Fix 2: overwrite crates from git repos with local paths
I hit another issue where
cargowas 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.lockof the main package being installed does not list any checksum for those dependencies pulled from a git repo, socargohas 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.tomlfile by using the[patch.URL]directive as describe in the rust docs instead of[source.URL].For instace,
becomes
Changelog
self.builddir.easybuild_vendorfinalpathof extracted sources by detecting.cargo/config.tomlfile[source.URL]with[patch.URL]to overwrite git repos with local paths to extracted sources