Skip to content

resolve symlinks in paths used for patchelf in Java easyblock, and make sure they are unique#2995

Merged
boegel merged 1 commit intoeasybuilders:developfrom
ocaisa:java_patchelf_fix
Sep 6, 2023
Merged

resolve symlinks in paths used for patchelf in Java easyblock, and make sure they are unique#2995
boegel merged 1 commit intoeasybuilders:developfrom
ocaisa:java_patchelf_fix

Conversation

@ocaisa
Copy link
Copy Markdown
Member

@ocaisa ocaisa commented Sep 6, 2023

Some build failures have been seen in EESSI/software-layer#327 due to this. Not exactly sure why though...

edit: this is a follow-up for the changes made in #2557

@boegel boegel changed the title Make sure paths for patchelf in Java are real and unique resolve symlinks in paths used for patchelf in Java easyblock, and make sure they are unique Sep 6, 2023
@boegel boegel added the bug fix label Sep 6, 2023
@boegel boegel added this to the next release (4.8.1?) milestone Sep 6, 2023
@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 6, 2023

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS Java-1.8.0_311.eb
  • SUCCESS Java-1.8.eb
  • SUCCESS Java-8.362.eb
  • SUCCESS Java-8.eb
  • SUCCESS Java-11.0.20.eb
  • SUCCESS Java-11.eb
  • SUCCESS Java-15.0.1.eb
  • SUCCESS Java-17.0.6.eb

Build succeeded for 8 out of 8 (8 easyconfigs in total)
node3109.skitty.os - Linux RHEL 8.6, x86_64, Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (skylake_avx512), Python 3.6.8
See https://gist.github.com/boegel/cb874ce292faac7055ffb00ec530e419 for a full test report.

@ocaisa
Copy link
Copy Markdown
Member Author

ocaisa commented Sep 6, 2023

Ok, for whatever reason, it is running patchelf --set-rpath on the same file twice that was causing the problem. Starting from a working installation:

[EESSI pilot 2023.06] $ patchelf --print-rpath /project/def-sponsor00/easybuild/software/Java/11.0.18/lib64/jli/libjli.so
$ORIGIN:$ORIGIN/..:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/lib64:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/usr/lib64

[EESSI pilot 2023.06] $ chmod +w /project/def-sponsor00/easybuild/software/Java/11.0.18/lib64/jli/libjli.so
[EESSI pilot 2023.06] $ patchelf --set-rpath '$ORIGIN:$ORIGIN/..:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/lib64:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/usr/lib64:/usr/lib'  /project/def-sponsor00/easybuild/software/Java/11.0.18/lib64/jli/libjli.so
[EESSI pilot 2023.06] $ javac -help
Segmentation fault (core dumped)

[EESSI pilot 2023.06] $ patchelf --print-rpath /project/def-sponsor00/easybuild/software/Java/11.0.18/lib64/jli/libjli.so
$ORIGIN:$ORIGIN/..:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/lib64:/cvmfs/pilot.eessi-hpc.org/versions/2023.06/compat/linux/x86_64/usr/lib64:/usr/lib

I wonder does shrinking the rpath mean it cannot be further expanded.

This PR will at least fix that issue for Java, if something like this move to framework we'll need to be a bit more careful (like not trying to update the RPATH if sysroot already appears there).

Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

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

Tested in EESSI pilot 2023.06, this indeed fixes the problem observed when using Java easyblock from #2557 👍

@boegel boegel merged commit e9af2cf into easybuilders:develop Sep 6, 2023
@boegel boegel added the EESSI Related to EESSI project label Sep 7, 2023
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.

2 participants