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

Move Equinox Launcher to Java-17 #829

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HannesWell
Copy link
Member

Move Equinox Launcher to Java-17 as suggested in #782 (comment).
And leverage the new language features to modernize the code a bit.

@HannesWell HannesWell requested a review from tjwatson February 1, 2025 15:46
@eclipse-equinox-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.equinox.launcher.cocoa.macosx.aarch64/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.launcher.win32.win32.aarch64/META-INF/MANIFEST.MF
bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From fcc1e3415197487aca205ec22c4a9771c57e9ea6 Mon Sep 17 00:00:00 2001
From: Eclipse Equinox Bot <[email protected]>
Date: Sat, 1 Feb 2025 15:49:10 +0000
Subject: [PATCH] Version bump(s) for 4.35 stream


diff --git a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.aarch64/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.aarch64/META-INF/MANIFEST.MF
index 472ef2036..e49a4d69e 100644
--- a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.aarch64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.aarch64/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.equinox.launcher.cocoa.macosx.aarch64;singleton:=true
-Bundle-Version: 1.2.1100.qualifier
+Bundle-Version: 1.2.1200.qualifier
 Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.7.0,1.8.0)"
 Eclipse-PlatformFilter: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=aarch64) )
 Bundle-Localization: launcher.cocoa.macosx.aarch64
diff --git a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/META-INF/MANIFEST.MF
index d03494cff..d8a8b4551 100644
--- a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.equinox.launcher.cocoa.macosx.x86_64;singleton:=true
-Bundle-Version: 1.2.1100.qualifier
+Bundle-Version: 1.2.1200.qualifier
 Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.7.0,1.8.0)"
 Eclipse-PlatformFilter: (& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=x86_64) )
 Bundle-Localization: launcher.cocoa.macosx.x86_64
diff --git a/bundles/org.eclipse.equinox.launcher.win32.win32.aarch64/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher.win32.win32.aarch64/META-INF/MANIFEST.MF
index 65607fc21..40d63f586 100644
--- a/bundles/org.eclipse.equinox.launcher.win32.win32.aarch64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.launcher.win32.win32.aarch64/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.equinox.launcher.win32.win32.aarch64;singleton:=true
-Bundle-Version: 1.2.1100.qualifier
+Bundle-Version: 1.2.1200.qualifier
 Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.7.0,1.8.0)"
 Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=aarch64))
 Bundle-Localization: launcher.win32.win32.aarch64
diff --git a/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/META-INF/MANIFEST.MF
index 14642bb39..3285f78fb 100644
--- a/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-SymbolicName: org.eclipse.equinox.launcher.win32.win32.x86_64;singleton:=true
-Bundle-Version: 1.2.1100.qualifier
+Bundle-Version: 1.2.1200.qualifier
 Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.7.0,1.8.0)"
 Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))
 Bundle-Localization: launcher.win32.win32.x86_64
-- 
2.48.1

Further information are available in Common Build Issues - Missing version increments.

@vogella
Copy link
Contributor

vogella commented Feb 1, 2025

Thanks for this work @HannesWell

What is the reason not to jump directly to Java 21? I think @tjwatson indicated that that would also be fine

@laeubi
Copy link
Member

laeubi commented Feb 1, 2025

I can see that org.eclipse.equinox.launcher is used in some places in Tycho to support running eclipse applications, so one should make sure that it is still possible to launch older eclipse installations.

What is the reason not to jump directly to Java 21? I think @tjwatson indicated that that would also be fine

Large parts of Eclipse/Equinox can still run on Java 17, so what would be the immediate benefits here to break those?

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

I would wait until next release for this change, at least warnings/deprecation should be fixed and not suppressed.

@@ -2609,6 +2592,7 @@ private void setMultiValueProperty(String property, String[] values) {
* nobody will actually call them (unless they casted the policy to EclipsePolicy and
* called our methods)
*/
@SuppressWarnings({"removal", "deprecation"})
Copy link
Member

Choose a reason for hiding this comment

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

If we have new warnings due to updated java version it should not be suppressed but fixed along side with the java update.

Copy link
Member Author

Choose a reason for hiding this comment

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

The new warning is because the Policy class is deprecated along with the SecurityManager. I'd more than happy to just remove it, but I assume that's not yet desired, is it?

Copy link
Member

Choose a reason for hiding this comment

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

🙈

Copy link
Contributor

Choose a reason for hiding this comment

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

I do think there are scenarios (ant?) that still optionally set a security manager when using Java 21 so I don't think we can really remove this policy stuff just yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ant isn't such scenario as it just sets the security-manager if the running JVM is blow 18:

But there could be other scenarios that require it. So I assume that part should stay as long as the security-manager code is removed.
Btw. is there a plan for how to deal with that? Or is the plan to keep it as long as it works/compiles on all released Java versions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw. is there a plan for how to deal with that? Or is the plan to keep it as long as it works/compiles on all released Java versions?

It depends on the component. For the most part, there should be little references to the actual SecurityManager or Policy in our code itself. The Framework itself has many places it is referenced, but they should be able to be contained into an internal utility that fails gracefully on a future JVM where the actual classes are removed.

The biggest issue is code all over the place that have references to java.security.AccessController.doPrivileged(PrivilegedAction<String>, AccessControlContext) and hundreds of implementations of java.security.PrivilegedAction<T> or java.security.PrivilegedExceptionAction<T>

My suspicion is that these APIs will be around much longer than the SecurityManager and Policy classes, but will become no-op methods when calling doPrivileged. I don't see them being able to truly remove the doPrivileged APIs until all the long term support of Java 8 finally end.

Copy link

github-actions bot commented Feb 1, 2025

Test Results

  669 files  ±0    669 suites  ±0   1h 13m 23s ⏱️ -10s
2 223 tests ±0  2 176 ✅ ±0   47 💤 ±0  0 ❌ ±0 
6 813 runs  ±0  6 670 ✅ ±0  143 💤 ±0  0 ❌ ±0 

Results for commit 652ea3f. ± Comparison against base commit e35221a.

@HannesWell
Copy link
Member Author

I would wait until next release for this change, at least warnings/deprecation should be fixed and not suppressed.

I'm fine postponing the entire change to the next dev-cycle, I don't think it's urgent. Maybe I'll add some follow-up changes in separate commits in the meantime, but they can later be moved to separate PRs as well.

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.

5 participants