Skip to content

Restructure RPATH and elf interpreter setting for Java, and add the LIBRARY_PATH to the additional RPATH and separate java awt libs#3583

Open
casparvl wants to merge 34 commits intoeasybuilders:developfrom
casparvl:separate_java_awt_libs
Open

Restructure RPATH and elf interpreter setting for Java, and add the LIBRARY_PATH to the additional RPATH and separate java awt libs#3583
casparvl wants to merge 34 commits intoeasybuilders:developfrom
casparvl:separate_java_awt_libs

Conversation

@casparvl
Copy link
Copy Markdown
Contributor

@casparvl casparvl commented Feb 7, 2025

Supersedes #3571

Caspar van Leeuwen added 30 commits January 29, 2025 22:55
…g extra RPATHS. Also, fix syntax for call to logging
…Also, set bin_lib_subdirs so that also the files in lib/server are patched
@lexming
Copy link
Copy Markdown
Contributor

lexming commented Feb 21, 2025

@casparvl all development is on 5.0 now, can you please move the target of this PR to the branch 5.0.x?

@boegel
Copy link
Copy Markdown
Member

boegel commented Feb 26, 2025

@casparvl all development is on 5.0 now, can you please move the target of this PR to the branch 5.0.x?

If this can wait a bit, there's no need to, soon the 5.0.x branch will be collapsed into develop...

# using patchelf, see e.g. https://github.com/easybuilders/easybuild-easyblocks/pull/3571
# The option run_rpath_sanity_check supports a gradual transition where binary installs that properly
# patch the RPATH can start running the sanity check
'run_rpath_sanity_check': [False, "Whether or not to run the RPATH sanity check", CUSTOM],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be needed not to break any existing rpath sanity checking that's going on. But, that may no longer be the case: the default RPATH sanity check has been relaxed https://docs.easybuild.io/easybuild-v5/changes/#rpath . So, unless people actively filter LD_LIBRARY_PATH in their Easybuild config, the sanity check wouldn't fail anyway.

extra_vars.update({
# Overwrite the default value for run_rpath_sanity_check to True, since we have RPATH patching with
# patchelf for Java
'run_rpath_sanity_check': [True, "Whether or not to run the RPATH sanity check", CUSTOM],
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can (probably) be removed, see above.

@laraPPr
Copy link
Copy Markdown
Contributor

laraPPr commented Mar 9, 2026

@casparvl do you have the time to sync this pr with develop. Or should we close it and start anew?

Comment on lines +230 to +239
# Then, add paths from sysroot to the extra RPATH
if add_sysroot_libdirs_to_rpath:
sysroot = build_option('sysroot')
sysroot_lib_paths = glob.glob(os.path.join(sysroot, 'lib*'))
sysroot_lib_paths += glob.glob(os.path.join(sysroot, 'usr', 'lib*'))
sysroot_lib_paths += glob.glob(os.path.join(sysroot, 'usr', 'lib*', 'gcc', '*', '*'))
if sysroot_lib_paths:
self.log.info("List of library paths in sysroot %s to add to RPATH section: %s", sysroot,
sysroot_lib_paths)
extra_rpaths += sysroot_lib_paths
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are changing the dynamic linker, this should not be necessary since these are locations that are searched by default.

@ocaisa
Copy link
Copy Markdown
Member

ocaisa commented Mar 9, 2026

@casparvl Maybe we can spar on this? There are a couple of things that I don't think are being taken into account (and I was looking into them last week):

  • LIBRARY_PATH is a good starting place, but there are things that need to be excluded (like stubs locations which are meant to be resolved at runtime)
  • We explicitly want to include some locations in the RPATH (EasyBuild has a setting for this, and we use it to allow for our MPI injection approach)
    • This requires additional options to protect these when using --shrink-rpath (and we also need to think a bit about using this option to account for temporary locations that resolve libraries but do not exist after installation)
  • patchelf can be unstable, you only want to call it once so you need to collect all the options

@casparvl
Copy link
Copy Markdown
Contributor Author

Yes, let's meet on this. Just a heads-up: this is a bit less pressing to me right now, so I don't think I'll be able to put a lot of time in implementing a solution. But I know that it may be relevant for you from an EFP point of view. We can definitely brainstorm on this, and then maybe you can do the (re-)implementation of this idea - and I could review/test? Anyway, let's get in touch on chat to set a meeting,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix EESSI Related to EESSI project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants