give dependencies provided via EasyBuld priority over sysroot for Rust package in easyconfig for librsvg v2.61.0#25317
Conversation
|
Test report by @ocaisa |
| # command which gives the sysroot libraries priority over things | ||
| # in LIBRARY_PATH. The flag belows forces Rust to give higher priority to the | ||
| # locations in LIBRARY_PATH (ensuring EasyBuild dependencies are preferred) | ||
| prebuildopts = "export RUSTFLAGS=\"$(printf -- '-L native=%s ' $(echo $LIBRARY_PATH | tr ':' ' ')) $RUSTFLAGS\" && " |
There was a problem hiding this comment.
@Flamefire @Thyre This looks like another Rust situation that (longer term) is better handled in a generic way
There was a problem hiding this comment.
What exactly is "using a sysroot" in this situation? How does rust get and add it?
Am I reading this syntax correctly, that it expects RUSTFLAGS="-L native=/lib1 -L native=/lib2"? Looks like a mix of linker flags and something else
And again, similar to previous discussions and the below CARGO_HOME: We likely need framework support for cargo to allow the easyblock to do what the cargo easyblock currently does: Set env variables and possibly populate crates and their information to avoid adding CargoMesonNinja
There was a problem hiding this comment.
This is mostly based on what I have seen with this package, not on things I really know:
What exactly is "using a sysroot" in this situation? How does rust get and add it?
AFAICT Rust knows about the sysroot (in my case the EESSI compat layer) from the compiler. Once it sees a sysroot it adds the lib folders from the sysroot to the link line explicitly. The unintended impact of this is that the sysroot now has priority over the directories in LIBRARY_PATH (since the linker checks the explicitly listed locations first). This at least was my experience with this package: libfontconfig was available in the compat layer, and was being picked up even though the Pango dep loads the (correct) fontconfig as a dependency.
Am I reading this syntax correctly, that it expects
RUSTFLAGS="-L native=/lib1 -L native=/lib2"? Looks like a mix of linker flags and something else
Yes, that's correct. I did what the AI told me to do and it works, information is hard to find, but there are some examples in the Rust CI: https://github.com/rust-lang/rust/blob/main/compiler/rustc_codegen_gcc/.github/workflows/release.yml#L100
And again, similar to previous discussions and the below
CARGO_HOME: We likely need framework support for cargo to allow the easyblock to do what the cargo easyblock currently does: Set env variables and possibly populate crates and their information to avoid addingCargoMesonNinja
Agreed
There was a problem hiding this comment.
Foound some docs on -L native=...: https://doc.rust-lang.org/rustc/command-line-arguments.html#-l-add-a-directory-to-the-library-search-path
There was a problem hiding this comment.
all — Search for all library kinds in this directory, except frameworks. This is the default if KIND is not specified.
That sounds like we don't need/want native= (or anything at all)
There was a problem hiding this comment.
Seems possible...but I only found those docs 30 minutes ago.
There was a problem hiding this comment.
Indeed, that works. I'll open up a follow-up PR
|
@boegelbot Please test @ jsc-zen3 |
|
@ocaisa: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... Details- notification for comment with ID 3919462228 processed Message to humans: this is just bookkeeping information for me, |
|
Test report by @boegelbot |
|
Test report by @boegel |
|
Going in, thanks @ocaisa! |
(created using
eb --new-pr)