-
Notifications
You must be signed in to change notification settings - Fork 162
[Win32] Add explicit supported OS version check and set to build 14393 #2054
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
base: master
Are you sure you want to change the base?
[Win32] Add explicit supported OS version check and set to build 14393 #2054
Conversation
Test Results 539 files ±0 539 suites ±0 30m 48s ⏱️ -2s For more details on these failures, see this check. Results for commit 780d4b9. ± Comparison against base commit 28fdeb6. ♻️ This comment has been updated with latest results. |
bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java
Outdated
Show resolved
Hide resolved
2bb2a2b
to
9e2dbad
Compare
Currently, there is no explicit minimum version required for executing SWT applications. However, some versions are implicitly not supported anymore as library methods are linked that are not present in older OS versions. In addition, we still have some methods dynamically linked and their execution guarded by a version constraint for version that are out of support. In particular, this holds for every Windows version older than build 14393, which is the 1607 update for Windows 10 and the release of Windows Server 2016, the latter being the latest still supported server version of Windows except for the extended support of Windows Server 2012. This change adds an explicit Windows version check at initialization to avoid that applications fail to start with incomprehensible linkage errors but a proper error message. It sets the minimum required Windows version to build 14393. To this end, it adds an additional SWT DLL only for retrieving the OS version, as the required Windows API call will no be executable on unsupported OS versions otherwise, as the ordinary SWT DLL will fail to load before executing the version check. This change also adds a check for SWT libraries being loadable (in particular in terms of a matching OS) on startup for every OS.
…ipse-platform#2011 With introducing an explicit minimum supported OS version for Windows, all code guards for older than the minimum supported Windows version became obsolete. This change removes those guards and those OS methods that became unused. It also makes those methods, whose calls are not version-guarded anymore, statically instead of dynamically linked. This fixes some issue with wrong values returned by the AdjustWindowRectExForDpi method when used via dynamic linking. Fixes eclipse-platform/eclipse.platform.ui#2852 Fixes eclipse-platform#2011
a733d33
to
780d4b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. I tested it locally with Win11 and it worked as expected. I tested the error case by adjusting the expected Windows version.
Failing test is unrelated: #2063 |
This PR is ready, but I converted it back to draft just to indicate that it should not be merged right now, as this one requires a build of the natives, which is currently not possible without Jenkins being available. If we merged now, SWT master state would be broken for everyone checking it out. |
Currently, there is no explicit minimum version required for executing SWT applications. However, some versions are implicitly not supported anymore as library methods are linked that are not present in older OS versions. In addition, we still have some methods dynamically linked and their execution guarded by a version constraint for version that are out of support. In particular, this holds for every Windows version older than build 14393, which is the 1607 update for Windows 10 and the release of Windows Server 2016, the latter being the latest still supported server version of Windows except for the extended support of Windows Server 2012.
This change adds an explicit Windows version check at initialization to avoid that applications fail to start with incomprehensible linkage errors but a proper error message. It sets the minimum required Windows version to build 14393. To this end, it adds an additional SWT DLL only for retrieving the OS version, as the required Windows API call will no be executable on unsupported OS versions otherwise, as the ordinary SWT DLL will fail to load before executing the version check.
With that explicit minimum supported OS version for Windows, all code guards for older than the minimum supported Windows version became obsolete. This change removes those guards and those OS methods that became unused. It also makes those methods, whose calls are not version-guarded anymore, statically instead of dynamically linked. This fixes some issue with wrong values returned by the AdjustWindowRectExForDpi method when used via dynamic linking.
This change also adds a check for SWT libraries being loadable (in particular in terms of a matching OS) on startup for every OS.
See also #2026 (comment)
Supercedes and thus closes #2026
Fixes eclipse-platform/eclipse.platform.ui#2852
Fixes #2011
Note
As a follow-up change, I will remove the methods added to the
OsVersion
class from theOS
class to reduce duplication.