Repository navigation
Description
Discussed in #497
Originally posted by HannesWell December 11, 2022
The build of the SWT-binaries is a quite complex process and I have the impression that it is even more complex than it would have to be, from the fact that o.e.swt contains the sources for all platforms but the build produces a fragment for each platform that contains all, the common and platform specific compiled code and native libraries.
I'm just about the learn the entire build-process of SWT (because of #490), so please correct me if I'm wrong or missing something.
One thing that makes it IMHO complex is the usage of multiple different ant-scripts that copy sources multiple times, back and fourth and that it looks like that the java-code is compiled multiple times and that besides the standard main- and source-jar there is also a zip produced for each platform-specific fragment.
The zip seems to be the one that is presented in the SWT section of the I-build drops:
https://download.eclipse.org/eclipse/downloads/drops4/I20221209-1800/
Is it correct that the o.e.swt and platform specific swt fragments that end up in the eclipse-updates repos (like https://download.eclipse.org/eclipse/updates/4.27-I-builds/) are the regular main- and sources-jar of the corresponding maven project?
I wonder why the code is compiled twice? And from my understanding of the build-process, as described above, this means that the class-files in the jars that end up in the p2-repo are different ones than those presented as swt-zips in the drops.
In general I think that it would be good if the swt.binaries build would be more maven oriented and I think it could be just like:
- For each platform-specific fragment copy the corresponding java source-files from o.e.swt to the src folder
- Build each fragment the usual maven way
- Assemble the swt-*.zip for each fragment, but without recompiling the java-files.
This would also include that all ant based launch configs or procedures are replaced by ones that include executing a Maven build.
A second bigger point that could be improved is where/when the native-libs in each platform-specific fragment are build.
At the moment this happens in https://ci.eclipse.org/releng/job/SWT-Increment_if_needed, which is triggered in the beginning of the daily releng/I-build job.
I wonder if it would be better to migrate that job to steps that run as part of the master-branch build of this repo? The build of the native libraries (if necessary) could even be done in the beginning of the master-build so that the following verification always runs on the native libs that match it. At the moment (as far as I understand) the master branch is build against the native libs build in the last I-build. If the native libs have changed the changed lib could be committed to the swt.binaries repo in the end if the master-build succeeded.
This would allow to get rid of the SWT-Increment_if_needed and if we would use https://www.jenkins.io/doc/book/pipeline/syntax/#parallel maybe even all the platform-specific jenkins job could be removed as well (but I have not yet checked all).
This would also allow to remove the enfored qualifier for the o.e.swt Plugin:
| <forceContextQualifier>v20221208-2302</forceContextQualifier> |
It could then just use the qualifier based on the git-timestamp, just like most other Plugins do it. If that qualifier ahd changed it could then be set and committed to the
o.e.swt.binaries/binaries-parent/pom.xml, together with the changed native-libs/binaries in the end of this repos master-build.In the I-builds pipeline the
Swt build input stage could then be removed entirely.
@akurtakov, @mickaelistria, what do you think?
Maybe @SDawley or @niraj-modi are you interested in that as well?
Activity
Perform SWT-natives build as part of the master/verification build
Perform SWT-natives build as part of the master/verification build
mickaelistria commentedon Jan 3, 2023
I cannot tell for sure, but I hope so and in case it's not the case, it would be a good target to have it that way ;)
Sounds good.
At the moment, the
masterbuild is not meant to be a production build, it's only for testing. The artifact it does generate are not going through the same amount of testing and validation as I-Build, they're not as reliable.However, having the master build rebuilding the binaries instead of consuming those from I-Build as you're trying with #514 definitely sounds like an improvement.
Perform SWT-natives build as part of the master/verification build
HannesWell commentedon Jan 4, 2023
At the moment the sources for
o.e.swtare committed to this repo (eclipse.platform.swt) the regular way through PRs. In the verification builds of this repo only the binaries forgtk.linux.x86_64are build from scratch and tested with the tests in this repo. The resulting binaries are not committed to eclipse.platform.swt.binaries.In the beginning of each I-Build the Jenkins-Job releng/SWT-Increment_if_needed is triggered:
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/c2c0b2e1f87c239d1d784d6c6094f85dd7401453/JenkinsJobs/Builds/I_build.groovy#L232-L236
If there are changes in o.e.swt, that require recompilation of the SWT-binaries, then this job triggers six other jobs, one to build the swt-binaries for each platform: https://ci.eclipse.org/releng/view/SWT%20Natives/
In that case the results build by those jobs are collected and then committed to the
eclipse.platform.swt.binariesrepo. The extensive testing on all platforms happens in the end of the I-build (similar to and together with all other components of the Eclipse platform TLPs).The main goal of #514 is to perform compilation and committing of the SWT-binaries as part of the
eclipse.platform.swtpipeline. This a first step of this issue to make the build of SWT as a whole simpler. But since every task performed in regards of changing theeclipse.platform.swtandswt.binariesis then done in that pipeline this make subsequent simplifications much simpler, because one does not have to consider other jobs defined elsewhere. And it makes all seven jobs in https://ci.eclipse.org/releng/view/SWT%20Natives/ obsolete (as far as I understood them).We don't loose much in testing here, because at the moment the swt.binaries are build and committed in the very beginning of the I-builds and the tests are performed in the very end. So if there are test-failures the committed binary changes have to be reverted any way. #514 is just moving the binary compilation step from the beginning of the I-builds to the committing process of this repo (which btw. probably also allows to use git-timestamp based qualifier at least for o.e.swt). The extensive testing still happens at the end of the I-builds (just like for other eclipse TLP components as well).
If your main concern is to duplicate the agents of the
relengJIPP/JIRO used to build SWT-binaries to theplatformJIPP, we could consider to move the jobs of this repo simply fromplatformto thereleng. While this would be a break the logical 'sorting'/'assignment' of those jobs it would simplify the management of the agents (but maybe would require more other work).Personally I would choose to take the burdon to duplicate some agents in the
platformJIRO.akurtakov commentedon Jan 4, 2023
What about running SWT pipeline on releng JIPP? That way we should be able to have all benefits you listed without the extra work.
akurtakov commentedon Jan 4, 2023
One more reason to go for releng JIPP is the fact that it is configure to push to git repos which I'm not sure is done for Platform JIPP nor whether it's even desired.
HannesWell commentedon Jan 4, 2023
Yes, that should work as well, I even suggested that already and would be fine with that :)
There might be some extra configuration work necessary to move this repos pipeline to releng JIPP, but it is probably less then setting up the agents. The freeze-period check works without extra credentials/tpkens and tokens for the dash-licenses tools or alike are not necessary in this repo.
So yes from all I know and can see moving https://ci.eclipse.org/platform/job/eclipse.platform.swt/ (and maybe even https://ci.eclipse.org/platform/job/eclipse.platform.swt.binaries/) to the releng JIPP would be the simplest way.
@fredg02 do you know any obstacles?
That's a point I didn't consider yet, but yes it makes sense.
So moving to the releng JIPP seems like the best way.
fredg02 commentedon Jan 4, 2023
If the mentioned Platform SWT jobs do not deploy artifacts to Maven Central... then no.
HannesWell commentedon Jan 4, 2023
They don't. AFAIK SWT is deployed to Maven-Central together with the other parts of eclipse-platform via separate Jobs in the
relengJIPP.@akurtakov, @fredg02 so do we have consensus to move https://ci.eclipse.org/platform/job/eclipse.platform.swt/ to the
relengJIPP? The binaries repo is not necessary as far as I can tell at the moment.If yes, @fredg02 can you perform the move? Should I create a new helpdesk issue for that or can this be done under eclipsefdn/helpdesk#2448?
I can then create a PR to https://github.com/eclipse-cbi/jiro to add the required agent-labels for the
relengJIPP as suggested by you in https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2448.akurtakov commentedon Jan 4, 2023
Let's move it!
fredg02 commentedon Jan 4, 2023
I can move it, yes. I will actually copy the job and disable it on the platform JIPP until everything works as expected.
fredg02 commentedon Jan 4, 2023
=> https://ci.eclipse.org/releng/job/eclipse.platform.swt/
HannesWell commentedon Jan 4, 2023
Sounds great. Thank you! I will let you know once #514 is fully implemented and working.
HannesWell commentedon Jan 4, 2023
Thank you again! That was quick 😄
79 remaining items
HannesWell commentedon Jan 19, 2024
An even faster way and a Maven launch configuration that has it encoded is about to be added in #991.
[Build] Further stream-lining and simplifications of SWT build pipeline
[Build] Further streamlining and simplifications of SWT build pipeline
[Build] Further streamlining and simplifications of SWT build pipeline
[Build] Further streamlining and simplifications of SWT build pipeline
[Build] Further streamlining and simplifications of SWT build pipeline
[Build] Unify make targets for native binaries build
[Build] Unify make targets for native binaries build
[Build] Unify make targets for native binaries build
[Build] Unify make targets for native binaries build
SyntevoAlex commentedon Mar 26, 2024
eclipse.platform.swt/binaries/pom.xml
Line 50 in 2378112
Typo:
build-nati*t*ve-fragmentMaybe it makes sense to fix it before it becomes legacy code?
HannesWell commentedon Mar 26, 2024
That profile is not activated explicitly, only automatically where needed, so it would not be dramatic. Nevertheless thanks for spotting this, just created #1141 to fix it.
fedejeanne commentedon Apr 11, 2024
--> #1167
HannesWell commentedon Apr 13, 2025
With the current state of the build pipeline I think we can call this done.
The only thing that could be improved from my POV is https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4231, but that's nothing we can do in SWT directly.
Thanks to everyone who helped making this happen!