Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible request for /usr/lib/jvm/jdkXX symlink #2912

Closed
sxa opened this issue Feb 1, 2023 · 6 comments
Closed

Ansible request for /usr/lib/jvm/jdkXX symlink #2912

sxa opened this issue Feb 1, 2023 · 6 comments
Assignees
Labels

Comments

@sxa
Copy link
Member

sxa commented Feb 1, 2023

The current java install on UNIX platforms puts a symlink into /usr/lib/jvm/jdk-XX (except JDK 8 which uses /usr/lib/jvm/jdk8) This issue is proposing changing that to /usr/lib/jvm/jdkXX for two reasons:

  1. It will make the other versions consistent with JDK8
  2. The openjdk build process will, by default, search in /usr/lib/jvm/jdkXX for a suitable boot JDK, so it would make our configurations more standardised and potentially reduce the amount of logic needed in the platform-specific-configuration scripts scripts.
    e.g.
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk11)
checking for Boot JDK... /usr/lib/jvm/jdk11
checking Boot JDK version... openjdk version "11.0.18" 2023-01-17 OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10) OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)

The decision here would need to be based on whether we want to be explicit about the boot JDK used (And we generally do use "one version back" which would be inconsistent with the autodetection) - or let it be autodetected (with the note that configure can still pick up things like /usr/lib/jvm/jdk-11.0.18+10 even without the short version)

This is partially driven by the fact that many of our static docker containers are set up with /usr/lib/jvm/jdk17 as the jenkins agent VM so we should aim to be consistent one way or another.

Given that the autodetection will pick up a full path like /usr/lib/jvm/jdk-11.0.18+10 regardless, I don't think there's a disadvantage to allowing /usr/lib/jvm/jdk11 and would recommend we change what's in the playbooks and build scripts to use that path.

@sxa sxa added the ansible label Feb 1, 2023
@gdams
Copy link
Member

gdams commented Feb 1, 2023

+1 from me

@AdamBrousseau
Copy link
Contributor

Thanks for the heads up. +1 from me.

@Haroon-Khel Haroon-Khel self-assigned this Oct 8, 2024
@sxa
Copy link
Member Author

sxa commented Oct 8, 2024

@Haroon-Khel I was just thinking about this after our call earlier. I think for now we should retaing both the jdk-XX and jdkXX links. While adding the jdkXX one shouldn't cause a problem for now in cases where the machine will retain the old one, as soon as we put in a PR for the update the platforms using build docker images will all be regenerated with ONLY the new one, and I'd prefer us to be able to do a bit more testing on that before making it live.

For example, this line:

https://github.com/adoptium/temurin-build/blob/25f24f457ae6567049fc7386098324f673458251/build-farm/platform-specific-configurations/linux.sh#L306

looks specifically for the location with the - at the moment (and it can also be overridden by a variable in the jenkins configuration, some of which may have a version with the -.

@Haroon-Khel
Copy link
Contributor

At the moment I am testing builds with and without the hyphen in the symlink in our build containers. The scripts run fine with and without the hyphen (it detects the correct bootjdk) as long as the appropriate edit is made in linux.sh

Therefore this infra pr needs to be coupled with a build pr which makes the appropriate changes in linux.sh and mac scripts

@sxa
Copy link
Member Author

sxa commented Oct 15, 2024

At the moment I am testing builds with and without the hyphen in the symlink in our build containers. The scripts run fine with and without the hyphen (it detects the correct bootjdk) as long as the appropriate edit is made in linux.sh

Therefore this infra pr needs to be coupled with a build pr which makes the appropriate changes in linux.sh and mac scripts

That's true, but the important thing for us to verify to ensure this change is useful is to ensure that if you're not using those scripts then running ./configure in the openjdk source directory can pick up the JDK automatically, otherwise there's no point in this change :-) I'm just slightly nervous after looking at the code.

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Oct 24, 2024

Running bash configure on the centos7 and alpine3 build images after applying the symlink changes, using the upstream repos https://github.com/openjdk/

Centos7 build image

JDK11u

configure: (Your Boot JDK version must be one of: 10 11)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk11)
checking for Boot JDK... /usr/lib/jvm/jdk11
checking Boot JDK version... openjdk version "11.0.24" 2024-07-16 OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8) OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode)

JDK21u

configure: (Your Boot JDK version must be one of: 20 21)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk21)
checking for Boot JDK... /usr/lib/jvm/jdk21
checking Boot JDK version... openjdk version "21.0.4" 2024-07-16 LTS OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)

JDK22u

configure: (Your Boot JDK version must be one of: 21 22)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk21)
checking for Boot JDK... /usr/lib/jvm/jdk21
checking Boot JDK version... openjdk version "21.0.4" 2024-07-16 LTS OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)

Alpine3 build image

JDK11u

configure: (Your Boot JDK version must be one of: 10 11)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk11)
checking for Boot JDK... /usr/lib/jvm/jdk11
checking Boot JDK version... openjdk version "11.0.24" 2024-07-16 OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8) OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode)

JDK17u

configure: (Your Boot JDK version must be one of: 16 17)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk17)
checking for Boot JDK... /usr/lib/jvm/jdk17
checking Boot JDK version... openjdk version "17.0.12" 2024-07-16 OpenJDK Runtime Environment Temurin-17.0.12+7 (build 17.0.12+7) OpenJDK 64-Bit Server VM Temurin-17.0.12+7 (build 17.0.12+7, mixed mode, sharing)

JDK21u

configure: (Your Boot JDK version must be one of: 20 21)
configure: Found potential Boot JDK using well-known locations (in /usr/lib/jvm/jdk21)
checking for Boot JDK... /usr/lib/jvm/jdk21
checking Boot JDK version... openjdk version "21.0.4" 2024-07-16 LTS OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)

Looks like it finds them easy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Status: Done
Development

No branches or pull requests

4 participants