Skip to content

add support for %(rpath_enabled)s template value#4670

Merged
jfgrimm merged 3 commits intoeasybuilders:developfrom
boegel:rpath_template
Oct 10, 2024
Merged

add support for %(rpath_enabled)s template value#4670
jfgrimm merged 3 commits intoeasybuilders:developfrom
boegel:rpath_template

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Oct 6, 2024

There are situations where we should be able to detect in an easyconfig file whether or not RPATH linking is used.

This can be leveraged in easyconfigs where pre-built binaries or libraries are included, like (for example):

postinstallcmds = [
    "if %(rpath_enabled)s; then patchelf %(installdir)s/...; fi",
]

@boegel boegel added this to the 5.0 milestone Oct 6, 2024
@boegel boegel added the EasyBuild-5.0 EasyBuild 5.0 label Oct 6, 2024
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 7, 2024

One use case for this is NextPolish-1.4.1-GCCcore-12.3.0.eb, which includes pre-built libraries like nextpolish1.so which don't have an RPATH section, so the sanity check fails on them.
Rightfully so, because if $LD_LIBRARY_PATH is not set, they're relying on libraries provided by the OS, like /lib64/libbz2.so.1, /lib64/liblzma.so.5, and /lib64/libz.so.1.

@boegel boegel changed the base branch from 5.0.x to develop October 8, 2024 18:59
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 8, 2024

I've re-targeted this to develop, since it would be useful short term in the context of easybuilders/easybuild-easyconfigs#21588

cc @jfgrimm

@boegel boegel removed the EasyBuild-5.0 EasyBuild 5.0 label Oct 9, 2024
@jfgrimm
Copy link
Copy Markdown
Member

jfgrimm commented Oct 9, 2024

as suggested in the conf call, this example could be shortened to:

postinstallcmds = [
    "if true; then patchelf %(installdir)s/...; fi",
]

if we set it to true or false

Alternatively, we could consider a different approach and do something more like the ARCH constant we have in easyconfigs? e.g. from UCX-1.15.0-GCCcore-13.2.0.eb

if ARCH == "riscv64":                                                                                                   
    patches += ['UCX-1.15.0-add_riscv_support.patch']                                                                   
    checksums += [{'UCX-1.15.0-add_riscv_support.patch':                                                                
                   '700640d469f441f3ee2c9d42e3a533f78f0c892c1d3c221aebd41279668d118e'}]                                 
    preconfigopts = 'autoreconf -fi && '

we could similarly have:

if USE_RPATH:
    postinstallcmds = ...

@boegel boegel changed the title add support for %(rpath)s template value add support for %(rpath_enabled)s template value Oct 9, 2024
@boegel
Copy link
Copy Markdown
Member Author

boegel commented Oct 9, 2024

@jfgrimm The USE_RPATH constant is a good one, but doesn't work, because it's possible that the RPATH linking is being selectively disabled (through a hook for example) for a particular installation, so it's not a session-wide constant value (that's different from ARCH, which is fixed for the entire session since it's tied to the system you're on)

@boegel boegel modified the milestones: 5.0, release after 4.9.4 Oct 9, 2024
@jfgrimm
Copy link
Copy Markdown
Member

jfgrimm commented Oct 10, 2024

@boegel fair enough, I had thought it might be awkward with the potential that people hook on a case-by-case basis

@jfgrimm jfgrimm merged commit 3b01ba9 into easybuilders:develop Oct 10, 2024
@boegel boegel deleted the rpath_template branch October 15, 2024 11:10
@boegel boegel modified the milestones: release after 4.9.4, release after 5.0.0, 5.0.0 Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants