Skip to content

Perform SWT-natives build as part of the master/verification build - #514

Merged
HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:binariesBuildOnMaster
Mar 9, 2023
Merged

HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:binariesBuildOnMaster

Conversation

@HannesWell

@HannesWell HannesWell commented Dec 27, 2022 •

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Dec 27, 2022 •

Copy link
Copy Markdown
Contributor

Test Results

     303 files       303 suites   5m 49s ⏱️
  4 048 tests   4 035 ✔️   8 💤 4 ❌ 1 🔥
12 071 runs  11 995 ✔️ 70 💤 5 ❌ 1 🔥

For more details on these failures and errors, see this check.

Results for commit a78d1fe.

♻️ This comment has been updated with latest results.

@HannesWell
HannesWell force-pushed the binariesBuildOnMaster branch 27 times, most recently from f212a61 to 70d06d8 Compare December 27, 2022 21:00
@SyntevoAlex

SyntevoAlex commented Jan 30, 2023 •

Copy link
Copy Markdown
Member

arm64 can't be built on default 10.15, see #514 (comment)

@sravanlakkimsetti

sravanlakkimsetti commented Jan 30, 2023 •

Copy link
Copy Markdown
Member

arm64 can't be built on default 10.15, see #514 (comment)

to build arm64 you'll need Xtools 12.2. We have installed xtools 12.2 on that machine. That way we are able to build both architectures
We do build the swt using these jobs

  1. https://ci.eclipse.org/releng/view/SWT%20Natives/job/cocoa_aarch64/configure
  2. https://ci.eclipse.org/releng/view/SWT%20Natives/job/cocoa_x86_64/configure

@HannesWell

Copy link
Copy Markdown
Member Author

Since I'm not using Mac at all

Happy man

In this regard yes, but using Windows and Linux can be challenging as well. 😅

arm64 can't be built on default 10.15, see #514 (comment)

to build arm64 you'll need Xtools 12.2. We have installed xtools 12.2 on that machine. That way we are able to build both architectures

For cocoa.macosx.x86_64 which runs on b9h15-macos10.15 the xcode command line tools seem to have version 12.4 (I hope that's the right command, I just found it in the internet):

  + pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
  package-id: com.apple.pkg.CLTools_Executables
  version: 12.4.0.0.1.1610135815
  volume: /
  location: /
  install-time: 1673006002
  groups: com.apple.FindSystemFiles.pkg-group 

Fine, let's also pass -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk to compiler

$ gcc -c -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk 1.c
	Succeeds

The last successful build of SWT-natives for macosx.aarch64 does not indicate that -isysroot is specified in any way:
https://ci.eclipse.org/releng/view/SWT%20Natives/job/cocoa_aarch64/174/console
Nevertheless that build succeeded just like the ones before. But now the configuration of b9h15-macos10.15 seems to be insufficient to build macosx.aarch64 natives. Maybe something was lost when the mashine went AWOL.

Actually we can build both x86_64 and arm64 architectures using either of the machines.
[...]
you can go ahead with the upgrade. Probably you'll need to upgrade Xtools as well. and this may require some updates to swt and launcher build scripts.

OK, great. I just tried it and selected nc1ht-macos11-arm64 to build the natives for macosx.aarch64 and that worked well. So I assume it is fine to build the SWT-natives for macosx.x86_64 on nc1ht-macos11-arm64 and macosx.x86_64 on b9h15-macos10.15 (like before)?
I'll create a PR against JIRO to move the swt.natives-cocoa.macosx.aarch64 label from b9h15-macos10.15 to nc1ht-macos11-arm64.

I suggest we do that update of b9h15-macos10.15 then after this PR has been successfully merged. Because as already said I'm not familiar with macos so somebody else has to do the adjustments.

But we now have working native-builds for all six different platforms. 🎉

So now I only have to test the push procedure (will of course use another branch than master), do some polishing and then this should be ready to go.

@HannesWell

HannesWell commented Jan 30, 2023 •

Copy link
Copy Markdown
Member Author

When I try to push the results of the build to a test branch using
git push origin HEAD:refs/heads/testNativeBuildInPipeline
the command seems to be stuck forever and does nothing.

Is it possible that the releng/eclipse.platform.swt needs again permissions to push to the eclipse.platform.swt repo? Or do all jobs in the releng Jenkins have that permission already?

@HannesWell

Copy link
Copy Markdown
Member Author

When I try to push the results of the build to a test branch using git push origin HEAD:refs/heads/testNativeBuildInPipeline the command seems to be stuck forever and does nothing.

That is probably because the repo is cloned using https. Setting the SSH address as pushurl will probably fix that. Will try that.

@fredg02

fredg02 commented Jan 31, 2023

Copy link
Copy Markdown
Contributor

@sravanlakkimsetti can you confirm that the arm64 build worked on b9h15-macos10.15 before it went AWOL?

@iloveeclipse

Copy link
Copy Markdown
Member

Is the fail here (on innocent change in SWT Linux code) related?
https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/PR-537/3/console

11:32:47  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.1.0:run (normal) on project org.eclipse.swt.cocoa.macosx.x86_64: An Ant BuildException has occured: The following error occurred while executing this line:
11:32:47  [ERROR] /home/jenkins/agent/workspace/eclipse.platform.swt_PR-537/eclipse.platform.swt.binaries/bundles/binaries-parent/build.xml:14: Cannot find /home/jenkins/agent/workspace/eclipse.platform.swt_PR-537/eclipse.platform.swt.binaries/bundles/binaries-parent/${buildDirectory}/plugins/org.eclipse.swt/buildFragment.xml imported from /home/jenkins/agent/workspace/eclipse.platform.swt_PR-537/eclipse.platform.swt.binaries/bundles/binaries-parent/build.xml
11:32:47  [ERROR] around Ant part ...<ant antfile="../binaries-parent/build.xml" target="copy.cocoa.src" />... @ 5:75 in /home/jenkins/agent/workspace/eclipse.platform.swt_PR-537/eclipse.platform.swt.binaries/bundles/org.eclipse.swt.cocoa.macosx.x86_64/target/antrun/build-main.xml

@fredg02

fredg02 commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

@akurtakov @sravanlakkimsetti @HannesWell @iloveeclipse PLEASE NOTE:

Build agent b9h15-macos10.15 has been upgrade to macOS11 (Big Sur) and therefore renamed to b9h15-macos11-x86_64. Also the associated tag macos-10.15 has been replaced with the tag macos-11. The build jobs that were tied to the machine have been adapted accordingly.

Any other build jobs that reference the old name will need to be updated.

@HannesWell

Copy link
Copy Markdown
Member Author

Build agent b9h15-macos10.15 has been upgrade to macOS11 (Big Sur) and therefore renamed to b9h15-macos11-x86_64. Also the associated tag macos-10.15 has been replaced with the tag macos-11. The build jobs that were tied to the machine have been adapted accordingly.

Thank you @fredg02 for that.
It isn't affecting this PR, but looking at b9h15-macos11-x86_64 and nc1ht-macos11-arm64 I just noticed that the former is labeled with macos-11 while the latter is labeled with macos11.

@fredg02

fredg02 commented Feb 16, 2023

Copy link
Copy Markdown
Contributor

I just noticed that the former is labeled with macos-11 while the latter is labeled with macos11.

Good catch. I copied from the existing format. If @sravanlakkimsetti agrees, I can change the tag for nc1ht-macos11-arm64 to macos-11 as well.

@sravanlakkimsetti

Copy link
Copy Markdown
Member

I just noticed that the former is labeled with macos-11 while the latter is labeled with macos11.

Good catch. I copied from the existing format. If @sravanlakkimsetti agrees, I can change the tag for nc1ht-macos11-arm64 to macos-11 as well.

Yes. Please relabel them as macos-11

@HannesWell

Copy link
Copy Markdown
Member Author

@fredg02 on the b9h15-macos11-x86_64 I see the following error for the macosx.x86_64 build of SWT-natives.
Could it be that this is missing?
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

@HannesWell

Copy link
Copy Markdown
Member Author

Besides that it looks like the project is not prepared to push to the swt(-natives)-repo:

  + git push origin HEAD:refs/heads/testSWTNativesInPipeline
  [email protected]: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.

@fredg02

fredg02 commented Feb 21, 2023 •

Copy link
Copy Markdown
Contributor

@fredg02 on the b9h15-macos11-x86_64 I see the following error for the macosx.x86_64 build of SWT-natives.
Could it be that this is missing?
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

@HannesWell Please try again, and in case it's still failing, please point me to the build.

@HannesWell

Copy link
Copy Markdown
Member Author

@fredg02 on the b9h15-macos11-x86_64 I see the following error for the macosx.x86_64 build of SWT-natives.
Could it be that this is missing?
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

@HannesWell Please try again, and in case it's still failing, please point me to the build.

Looks like the initial error is fixed, but there seems to be another one on the new macos-x86_64 node:

00:04:12.118  cc -c -xobjective-c -Wall -arch x86_64 -DSWT_VERSION=4958r3   -DUSE_ASSEMBLER -DCOCOA -DATOMIC -I /Library/Java/JavaVirtualMachines/temurin-19.jdk/Contents/Home/include -I /Library/Java/JavaVirtualMachines/temurin-19.jdk/Contents/Home/include/darwin -I /System/Library/Frameworks/Cocoa.framework/Headers -I /System/Library/Frameworks/JavaScriptCore.framework/Headers os.c
00:04:12.543  In file included from os.c:19:
00:04:12.543  In file included from ./os_structs.h:18:
00:04:12.543  In file included from ./os.h:22:
00:04:12.543  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
00:04:12.543  In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
00:04:12.543  /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
00:04:12.543  - (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));

See https://ci.eclipse.org/releng/job/eclipse.platform.swt/view/change-requests/job/PR-514/136/execution/node/275/log/

@HannesWell

Copy link
Copy Markdown
Member Author

Besides that it looks like the project is not prepared to push to the swt(-natives)-repo:

  + git push origin HEAD:refs/heads/testSWTNativesInPipeline
  [email protected]: Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.

This was because I oversaw the SSH-agent setup in the existing/old SWT-Increment_if_needed job. After adding a sshagent(['github-bot-ssh']) step, the pipeline now successfully pushes to the swt and swt.binaries repo.

You can see the results here:

But while testing pushing I noticed that the automated natives-build respectively the automated enforced-qualifier commits will trigger another round of automated updates, which likely leads to an infinite update-cycle.
So I will need to think about a mechanism to detect if the latest commit was created by the automated SWT-update.
Probably based on the commit message and committer/author.
On the long run, the enforced qualifier updates should not be necessary at all, which then hopefully makes this mechanism obsolete. But I don't want to change that in this PR.

@fredg02

fredg02 commented Feb 22, 2023

Copy link
Copy Markdown
Contributor

Looks like the initial error is fixed, but there seems to be another one on the new macos-x86_64 node

That error should be fixed as well now. It required to update the MacOS Developer Command Line Tools from version 12.5 to 13.2 (with softwareupdate -i "Command Line Tools for Xcode-13.2") .

@HannesWell

Copy link
Copy Markdown
Member Author

Looks like the initial error is fixed, but there seems to be another one on the new macos-x86_64 node

That error should be fixed as well now. It required to update the MacOS Developer Command Line Tools from version 12.5 to 13.2 (with softwareupdate -i "Command Line Tools for Xcode-13.2") .

Great. Thank you! I can confirm that the mac build is now working for both architectures.

But while testing pushing I noticed that the automated natives-build respectively the automated enforced-qualifier commits will trigger another round of automated updates, which likely leads to an infinite update-cycle.
So I will need to think about a mechanism to detect if the latest commit was created by the automated SWT-update.
Probably based on the commit message and committer/author.

I prevent such self-loop now by performing a check if the HEAD commit was committed by the Eclipse Releng Bot. In that case the build simply aborts, as you can see for example in https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/testSWTNativesInPipeline/8/console.
This way and endless loop of builds where the automated update triggers a new build immediately which again triggers a new build is prevented.

So I think this is ready now. You can see the results here:

The only thing to do, before this can be submitted is to remove the last commit (which was only used to test pushing) and to squash the others.

@mickaelistria, @akurtakov or anybody else: Do you want to review this?
I assume you prefer to wait until the master branch opens for the 2023-06 before submitting this?

@mickaelistria

Copy link
Copy Markdown
Contributor

@mickaelistria, @akurtakov or anybody else: Do you want to review this?

I've personally lost track (again) on this topic and don't intend to refocus on it soon enough to give a helpful review, sorry.

I assume you prefer to wait until the master branch opens for the 2023-06 before submitting this?

Yes please.

@HannesWell

Copy link
Copy Markdown
Member Author

@mickaelistria, @akurtakov or anybody else: Do you want to review this?

I've personally lost track (again) on this topic and don't intend to refocus on it soon enough to give a helpful review, sorry.

OK, no problem. I did some more testing (changes and a few more adjust and I'm now relatively confident that this change is fine as it is.
Therefore I suggest to submit this as soon as the master opens again and if anyone encounters problems I'll try to fix them as soon as possible.
Of course everybody interested is invited to review this PR until then.

@HannesWell

Copy link
Copy Markdown
Member Author

Since the master branch is now open I plan to submit this PR tomorrow evening, unless anybody objects.

@HannesWell

Copy link
Copy Markdown
Member Author

All tests on Jenkins are green and the GH-workflow failures are the same like on previous master builds. Therefore I believe they are unrelated.
So this is ready for submission now; Merging.
I will monitor the next master branch build to verify that it behaves as expected.

Thanks to everyone that helped to make this happen, especially @fredg02!

@HannesWell

Copy link
Copy Markdown
Member Author

So the build succeeded as expected in https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/master/24/ 🎉
And as intended the subsequent master-branch triggered from the push of the updated timestamps was aborted to prevent an endless build loop: https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/master/25/

Unfortunately we will now see aborted builds in the master queue, but I didn't found an elegant way to suppress. Maybe it would be possible with adjusting the Jenkins/GH-hook configuration. But I don't have access to that.

The build procedure is based on the configurations in https://ci.eclipse.org/releng/view/SWT%20Natives/ Namely these are:

* https://ci.eclipse.org/releng/job/SWT-Increment_if_needed/configure

* https://ci.eclipse.org/releng/job/cocoa_aarch64/configure

* https://ci.eclipse.org/releng/job/cocoa_x86_64/configure

* https://ci.eclipse.org/releng/job/gtk_linux_aarch64/configure

* https://ci.eclipse.org/releng/job/gtk_linux_ppc64le/configure

* https://ci.eclipse.org/releng/job/gtk_linux_x86_64/configure

* https://ci.eclipse.org/releng/job/win32_x86_64/configure

The steps of all those jobs are now perform in the Jenkins-build of this o.e.swt repo and thus makes all the mentioned jobs obsolete. This also makes building the swt-binaries as part of the I-builds obsolete. It has also the advantage that one can get immediate feedback in verification-builds for changes that affect the SWT-binaries.

Since the mentioned seven jobs are now not necessary anymore I suggest we delete them on the long run. For some time I think it is reasonable to keep them as a reference but once we are confident everything works I think we can just delete them.
From how the jobs are configured I assume they are not used for any maintenance work, is that correct.

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.

8 participants