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

[RFC] fix the openjdk alternatives mess #47866

Merged
merged 8 commits into from
Dec 24, 2023

Conversation

classabbyamp
Copy link
Member

@classabbyamp classabbyamp commented Dec 21, 2023

The current way the alternatives groups work for openjdk packages really sucks. They overlap and cause pkgdb errors, can get out-of-sync, and more. This approach hopes to fix (or at least improve) that.

The new package openjdk-common replaces the xbps trigger that added the profile script for openjdk (which was a flawed approach and should have never been done).

Instead of using alternative groups for specific JRE/JDK binaries, this approach uses just two symlinks, /usr/lib/jvm/default-jdk and /usr/lib/jvm/default-jre, which point to the selected JAVA_HOME (/usr/lib/jvm/openjdkN). The profile script in openjdk-common prefers default-jdk to default-jre, and just adds them to PATH and MANPATH instead of putting things in /usr/bin.

With this approach, the selected JDK and JRE can probably still get out of sync, but the preference behaviour of the profile script should help mitigate this. I don't think it's currently possible to sanely deconflict/sync the alternatives groups.

Testing the changes

  • I tested the changes in this PR: YES

[ci skip]

@ahesford
Copy link
Member

I think this is a great idea.

@classabbyamp classabbyamp marked this pull request as ready for review December 22, 2023 02:42
get rid of the openjdk profile hook. it should not have been done like this.
Replaces the xbps trigger that added the profile script for openjdk,
which was really a mistake.

Instead of using alternative groups for specific JRE/JDK binaries, use
two symlinks: /usr/lib/jvm/default-jdk and /usr/lib/jvm/default-jre,
which point to /usr/lib/jvm/${version}. Prefer default-jdk to default-jre,
and just add them to PATH and MANPATH instead of putting things in /usr/bin.
- various template cleanups
- rename /usr/lib/jvm/java-1.8-openjdk to /usr/lib/jvm/openjdk8
  for consistency
- fix manpages
- fix alternatives
this package has been useless since 106a275
make it a transitional package on openjdk11
- fix manpages
- fix alternatives
- fix manpages
- fix alternatives
@classabbyamp classabbyamp merged commit d989670 into void-linux:master Dec 24, 2023
2 checks passed
@classabbyamp classabbyamp deleted the jdk-alts branch December 24, 2023 13:39
classabbyamp added a commit that referenced this pull request Dec 31, 2023
removed in 46371e7

prevents this old, removed package from borking the new alternatives groups
introduced in #47866 by replacing it if a user has this installed and
selected as the alternative for the java group, it can make the profile
script not run because /usr/lib/jvm/default-jre doesn't exist.
zen0bit pushed a commit to oSoWoSo/VUR that referenced this pull request Jan 10, 2024
removed in 46371e7

prevents this old, removed package from borking the new alternatives groups
introduced in void-linux#47866 by replacing it if a user has this installed and
selected as the alternative for the java group, it can make the profile
script not run because /usr/lib/jvm/default-jre doesn't exist.
zen0bit pushed a commit to oSoWoSo/VUR that referenced this pull request Jan 11, 2024
removed in 46371e7

prevents this old, removed package from borking the new alternatives groups
introduced in void-linux#47866 by replacing it if a user has this installed and
selected as the alternative for the java group, it can make the profile
script not run because /usr/lib/jvm/default-jre doesn't exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants