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
Build SWT-natives against Java-17 JDK header files #633
Conversation
Test Results 299 files ±0 299 suites ±0 6m 0s ⏱️ -20s For more details on these failures, see this check. Results for commit 122911d. ± Comparison against base commit 710fcc5. ♻️ This comment has been updated with latest results. |
Created https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2957 to ask the Infra-team to add corresponding JDKs to the SWT-natives build machines. |
f781f88
to
eb0fc42
Compare
Jenkinsfile
Outdated
for(os in [ 'macosx', 'linux', 'win32' ]) { | ||
sh """ | ||
curl ${getJDKHeaderProviderURL(os)} -o jdk.tar.gz | ||
tar -xzf jdk.tar.gz ${ os == 'win32' ? './include/': 'include/'} |
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.
@merks can you tell why in the Windows JDKs available at https://download.eclipse.org/justj/jres/17/downloads/20230204_0657/
there is always an extra folder named .
in the tar.gz root which contains the jdk content?
For Linux and Macos the jdk is always contained directly in the zip's root.
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.
I think it's produced the same way on all platforms by this:
It should be logged here:
https://ci.eclipse.org/justj/job/build-jres/248/
But there I see the following as if the * is expanded to "." which seems rather strange behavior.
+ tar -czf ../org.eclipse.justj.openjdk.hotspot.jre.full-17.0.6-win32-x86_64.tar.gz .
It should be possible to run this script locally and reproduce such a problem. But I won't have time today or tomorrow to investigate that.
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.
Found time for a quick look...
It's this that is repackaging after signing all the executables and dlls:
I thing that should be '*' and not '.' to avoid this problem.
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.
I've kicked off a build to build new JREs that should fix this problem...
BTW, this file contains relative URIs of all the latest Java 17 JREs:
https://download.eclipse.org/justj/jres/17/downloads/latest/justj.manifest
So in principle one could use that to avoid hard coding the specific URL of a current latest...
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.
I've kicked off a build to build new JREs that should fix this problem...
Thanks a lot! The windows tar.gz at https://download.eclipse.org/justj/www/download.eclipse.org.php?file=jres/17/downloads/20230423_0633 look perfectly fine now!
I've kicked off a build to build new JREs that should fix this problem...
BTW, this file contains relative URIs of all the latest Java 17 JREs:
https://download.eclipse.org/justj/jres/17/downloads/latest/justj.manifest
So in principle one could use that to avoid hard coding the specific URL of a current latest...
Thanks for that hint. I was already wondering if there is a latest URL from which one can just download them directly.
But since actually only the C header files provided by a JDK (in the include
) are of interest in this case and I believe that they don't change often I was fine with how it is.
But I'll have a look so that always the latest tar.gz are used.
fb14c76
to
2ff304a
Compare
2ff304a
to
20f084e
Compare
5786a0f
to
4f9e7d5
Compare
e46a3f6
to
5b39bce
Compare
For me this PR is ready. |
Use the C header files and shared native libraries from minimal JustJ JDKs when building the SWT native binaries on specialized build machines. Always specify the location of the JDK providing the headers/libs using the 'SWT_JAVA_HOME' environment variable. This allows to use another JDK as the one specified in the global JAVA_HOME variable. When building the natives for individual platforms via Maven (with the 'build-individual-platform' profile active and -Dnative=<platform> specified) set the value of 'SWT_JAVA_HOME' to the location of the running JDK (which must of course be present). If one wants to use a custom JDK to build the SWT natives against, one can set set for example the Maven CLI argument -DSWT_JAVA_HOME=<path-to-desired-JDK> Because in the CI and for Maven builds that build natives now always have a JDK specified the auto-search algorithms to find one can be removed from the scripts. Fixes eclipse-platform#626
5b39bce
to
122911d
Compare
Even if this one causes some issues it's a move in the right direction so we would better merge it now and deal with possible consequences. |
As far as I can tell and as far as I have tested it, everything should be fine. But eventually we will only know for sure if we try it, therefore I'm merging this one. |
to make it usable in all stages. Since eclipse-platform#633 the JDK on the native-build-agent's PATH is not used anymore to build the natives and therefore it is not required anymore to keep the PATH untouched.
in order to replace ANT tasks with JavaScript (which require Java-11) in Jenkins pipeline. Stash native sources not-zipped to save the zip and unzip steps. Additionally move all remaining ANT tasks to run a native build in a local Maven for the running platform completely to the maven-antrun-plugin configuration. Furthermore move declaration of tools to the common Jenkins pipeline section to make them usable in all stages. Since eclipse-platform#633 the JDK on the native-build-agent's PATH is not used anymore when building the native binaries and thus it is not required anymore to keep the PATH untouched. Part of - eclipse-platform#513 - eclipse-platform#626
in order to replace ANT tasks with JavaScript (which require Java-11) in Jenkins pipeline. Stash native sources not-zipped to save the zip and unzip steps. Additionally move all remaining ANT tasks to run a native build in a local Maven for the running platform completely to the maven-antrun-plugin configuration. Furthermore move declaration of tools to the common Jenkins pipeline section to make them usable in all stages. Since eclipse-platform#633 the JDK on the native-build-agent's PATH is not used anymore when building the native binaries and thus it is not required anymore to keep the PATH untouched. Part of - eclipse-platform#513 - eclipse-platform#626
in order to replace ANT tasks with JavaScript (which require Java-11) in Jenkins pipeline. Stash native sources not-zipped to save the zip and unzip steps. Additionally move all remaining ANT tasks to run a native build in a local Maven for the running platform completely to the maven-antrun-plugin configuration. Furthermore move declaration of tools to the common Jenkins pipeline section to make them usable in all stages. Since eclipse-platform#633 the JDK on the native-build-agent's PATH is not used anymore when building the native binaries and thus it is not required anymore to keep the PATH untouched. Part of - eclipse-platform#513 - eclipse-platform#626
in order to replace ANT tasks with JavaScript (which require Java-11) in Jenkins pipeline. Stash native sources not-zipped to save the zip and unzip steps. Additionally move all remaining ANT tasks to run a native build in a local Maven for the running platform completely to the maven-antrun-plugin configuration. Furthermore move declaration of tools to the common Jenkins pipeline section to make them usable in all stages. Since #633 the JDK on the native-build-agent's PATH is not used anymore when building the native binaries and thus it is not required anymore to keep the PATH untouched. Part of - #513 - #626
As described in #626 (comment) the SWT-natives are currently build against the JDK header files for different Java versions raging from 11 to 19. Because SWT now requires Java-17 (#625), they all should be build against Java-17 headers.
This PR aims to achieve that and at the same time fixes the inconsistencies regarding the headers/libs in the natives build described in #626 (comment).
build-individual-platform
profile active and-Dnative=<platform>
specified) set the value ofSWT_JAVA_HOME
to the location of the running JDK (which must of course be present). If one wants to use a custom JDK to build the SWT natives against, one can set set for example the Maven CLI argument-DSWT_JAVA_HOME=<path-to-desired-JDK>
Because in the CI and for Maven builds that build natives now always have a JDK specified the auto-search algorithms to find one is now obsolete and removed from the scripts.
Fixes #626 (at least the part regarding the Java-11 headers).