Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 570540

Summary: Build eclipse for Mac M1 processor architecture
Product: [Eclipse Project] Platform Reporter: Sravan Kumar Lakkimsetti <sravankumarl>
Component: RelengAssignee: Sravan Kumar Lakkimsetti <sravankumarl>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bmckinlay, christian.dietrich.opensource, hubert+eclipseorg, konrad_w, lshanmug, ma.becker, mistria, njbartlett, orionllmain, tjwatson
Version: 4.19Flags: sravankumarl: review? (lshanmug)
Target Milestone: 4.20 M1   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.releng.aggregator/+/175139
https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/175140
https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/175141
https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/175142
https://git.eclipse.org/r/c/platform/eclipse.platform.swt.binaries/+/175143
https://git.eclipse.org/r/c/equinox/rt.equinox.bundles/+/175219
https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/175220
https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/175324
https://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/commit/?id=3d1cb015610bea4c73a5077f6073f79c9c120234
https://git.eclipse.org/r/c/equinox/rt.equinox.binaries/+/177650
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=fa0c1d2c524b5bd589c0e6e217d07bae1d501705
https://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=2c87374a21099c4bea7a895fbfe4e4a2dcc6a18a
https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=840c90fb18b5a6b8dcb15bcb4fada21bd381d56d
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0c6cdabf38d98204a5d6260ad963fcbb4a2cc9a1
https://git.eclipse.org/c/equinox/rt.equinox.binaries.git/commit/?id=40f689c454ae974ad1510ec1693de3c00f215199
https://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=bf1b51dd6255f9fe1007f5eea5d7258c0943a8a8
https://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=075e4d06a354e9979b98083ab2f07e0c00375965
https://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=2b2339d2a01b89d9a44f6cb9cf26d7c89b115817
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573819
Whiteboard:
Bug Depends on: 570960, 571003, 571195    
Bug Blocks: 565690    

Description Sravan Kumar Lakkimsetti CLA 2021-01-21 04:27:00 EST

    
Comment 1 Eclipse Genie CLA 2021-01-21 04:29:20 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.releng.aggregator/+/175139
Comment 2 Eclipse Genie CLA 2021-01-21 04:29:22 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/175140
Comment 3 Eclipse Genie CLA 2021-01-21 04:29:25 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/175141
Comment 4 Eclipse Genie CLA 2021-01-21 04:30:08 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/175142
Comment 5 Eclipse Genie CLA 2021-01-21 04:30:56 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt.binaries/+/175143
Comment 6 Sravan Kumar Lakkimsetti CLA 2021-01-21 04:32:33 EST
@lakshmi,

Please get these patches locally and try building aggregator locally
Comment 7 Eclipse Genie CLA 2021-01-22 10:34:10 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.bundles/+/175219
Comment 8 Eclipse Genie CLA 2021-01-22 10:35:23 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/175220
Comment 9 Eclipse Genie CLA 2021-01-25 10:21:53 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/175324
Comment 10 Sravan Kumar Lakkimsetti CLA 2021-01-29 00:17:17 EST
I tried building locally but while building  org.eclipse.equinox.p2.tests.reconciler.product, there is a dependency to org.eclipse.equinox.launcher.cocoa.macosx generated in the generated repository 

The problem here is, because bundle org.eclipse.equinox.launcher.cocoa.macosx doesn't exist, the build fails. 

I cannot figure out how this dependency is getting generated. Need help in this.

To reproduce
1. Clone https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/ with submodules
2. switch to master along with sub modules
3. apply gerrit patches attached to this bug
4. from eclipse.platform.releng.aggregator repo root, issue the following command
    mvn clean verify -DskipTests=true
Comment 11 Sravan Kumar Lakkimsetti CLA 2021-02-02 08:59:42 EST
I don't have any reference to org.eclipse.equinox.launcher.cocoa.macosx in the source. Still while generating repository for p2 reconciler product dependency to this bundle is getting generated.

@tjwatson,

Can you please help us here?
Comment 12 Mickael Istria CLA 2021-02-02 09:40:16 EST
(In reply to Sravan Kumar Lakkimsetti from comment #10)
> I cannot figure out how this dependency is getting generated. Need help in
> this.

I think this is coming from Tycho or p2 "ProductAction" which delegates to ApplicationLauncherAction . I'm not sure exactly how the "configuration" are feed by Tycho for products; this would require some debugging of Tycho.
Comment 13 Thomas Watson CLA 2021-02-02 10:28:41 EST
(In reply to Mickael Istria from comment #12)
> (In reply to Sravan Kumar Lakkimsetti from comment #10)
> > I cannot figure out how this dependency is getting generated. Need help in
> > this.
> 
> I think this is coming from Tycho or p2 "ProductAction" which delegates to
> ApplicationLauncherAction . I'm not sure exactly how the "configuration" are
> feed by Tycho for products; this would require some debugging of Tycho.

find . -type f -exec grep -q "org.eclipse.equinox.launcher.cocoa.macosx" {} \; -print
./bundles/org.eclipse.equinox.p2.ui.admin.rcp/rcp.product
./bundles/org.eclipse.equinox.p2.tests/testData/bug309717/p2/org.eclipse.equinox.p2.engine/profileRegistry/PlatformProfile.profile/1271699173550.profile
./bundles/org.eclipse.equinox.p2.tests/testData/bug300104/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile/1263582400033.profile
./bundles/org.eclipse.equinox.p2.installer/installer.product

I expect the following are the causes:

./bundles/org.eclipse.equinox.p2.ui.admin.rcp/rcp.product
./bundles/org.eclipse.equinox.p2.installer/installer.product
Comment 14 Sravan Kumar Lakkimsetti CLA 2021-02-03 03:48:13 EST
(In reply to Thomas Watson from comment #13)
> (In reply to Mickael Istria from comment #12)
> > (In reply to Sravan Kumar Lakkimsetti from comment #10)
> > > I cannot figure out how this dependency is getting generated. Need help in
> > > this.
> > 
> > I think this is coming from Tycho or p2 "ProductAction" which delegates to
> > ApplicationLauncherAction . I'm not sure exactly how the "configuration" are
> > feed by Tycho for products; this would require some debugging of Tycho.
> 
> find . -type f -exec grep -q "org.eclipse.equinox.launcher.cocoa.macosx" {}
> \; -print
> ./bundles/org.eclipse.equinox.p2.ui.admin.rcp/rcp.product
> ./bundles/org.eclipse.equinox.p2.tests/testData/bug309717/p2/org.eclipse.
> equinox.p2.engine/profileRegistry/PlatformProfile.profile/1271699173550.
> profile
> ./bundles/org.eclipse.equinox.p2.tests/testData/bug300104/p2/org.eclipse.
> equinox.p2.engine/profileRegistry/SDKProfile.profile/1263582400033.profile
> ./bundles/org.eclipse.equinox.p2.installer/installer.product
> 
> I expect the following are the causes:
> 
> ./bundles/org.eclipse.equinox.p2.ui.admin.rcp/rcp.product
> ./bundles/org.eclipse.equinox.p2.installer/installer.product

I did update these files in https://git.eclipse.org/r/c/equinox/rt.equinox.p2/+/175324 but still the reference for org.eclipse.equinox.launcher.cocoa.macosx is getting generated.
Comment 15 Sravan Kumar Lakkimsetti CLA 2021-02-05 01:38:22 EST
I suspect this is the problem.

https://git.eclipse.org/c/equinox/rt.equinox.p2.git/tree/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxLauncherCUAction.java#n61

In this method we are ignoring architecture for macos if architecture is not equal to x86_64. 

@mistria, Alex,

If we fix this problem in p2 early next week, what is the process to get this fix into tycho?
Comment 16 Mickael Istria CLA 2021-02-05 03:39:48 EST
(In reply to Sravan Kumar Lakkimsetti from comment #15)
> If we fix this problem in p2 early next week, what is the process to get
> this fix into tycho?

We usually include released versions of Equinox in Tycho. https://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-bundles/tycho-bundles-target/tycho-bundles-target.target#n11 ; but for this case, we may decide to anticipate a bit and tweak it to include a particular I-Build until newer release.
Comment 18 Eclipse Genie CLA 2021-03-12 06:03:14 EST
New Gerrit change created: https://git.eclipse.org/r/c/equinox/rt.equinox.binaries/+/177650
Comment 28 John Kozlov CLA 2021-03-13 07:58:23 EST
Hi Sravan! I was unable to run Eclipse.app from your link. My macOS says: You do have permission to open the application "Eclipse". Any ideas what I'm doing wrong?
Comment 29 Bryce McKinlay CLA 2021-03-13 15:23:36 EST
(In reply to Sravan Kumar Lakkimsetti from comment #27)
> Mac M1 build is available here
> https://download.eclipse.org/eclipse/downloads/drops4/I20210312-1540/download.php?dropFile=eclipse-SDK-I20210312-1540-macosx-cocoa-arm64.dmg

Eclipse.app from this .dmg did not work for me either:

% open -a Eclipse.app
The application /Applications/Eclipse.app cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2508, NSUnderlyingError=0x13bf26e40 {Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x13bf25ac0 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed with error: 153}}}}}
Comment 30 Sravan Kumar Lakkimsetti CLA 2021-03-13 21:40:26 EST
@lakshmi,

The build is available now. Since I don't have a machine to test need help here.
Comment 31 Lakshmi P Shanmugam CLA 2021-03-15 07:12:43 EDT
(In reply to Bryce McKinlay from comment #29)
> (In reply to Sravan Kumar Lakkimsetti from comment #27)
> > Mac M1 build is available here
> > https://download.eclipse.org/eclipse/downloads/drops4/I20210312-1540/download.php?dropFile=eclipse-SDK-I20210312-1540-macosx-cocoa-arm64.dmg
> 
> Eclipse.app from this .dmg did not work for me either:
> 
> % open -a Eclipse.app
> The application /Applications/Eclipse.app cannot be opened for an unexpected
> reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826
> "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app
> (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard,
> _LSLine=2508, NSUnderlyingError=0x13bf26e40 {Error
> Domain=RBSRequestErrorDomain Code=5 "Launch failed."
> UserInfo={NSLocalizedFailureReason=Launch failed.,
> NSUnderlyingError=0x13bf25ac0 {Error Domain=NSPOSIXErrorDomain Code=153
> "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn
> failed with error: 153}}}}}


Can you pls try running eclipse executable from the Terminal? Does it work?

cd Eclipse.app/Contents/MacOS
./eclipse
Comment 32 Sravan Kumar Lakkimsetti CLA 2021-03-15 07:18:52 EDT
(In reply to Bryce McKinlay from comment #29)
> (In reply to Sravan Kumar Lakkimsetti from comment #27)
> > Mac M1 build is available here
> > https://download.eclipse.org/eclipse/downloads/drops4/I20210312-1540/download.php?dropFile=eclipse-SDK-I20210312-1540-macosx-cocoa-arm64.dmg
> 
> Eclipse.app from this .dmg did not work for me either:
> 
> % open -a Eclipse.app
> The application /Applications/Eclipse.app cannot be opened for an unexpected
> reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826
> "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app
> (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard,
> _LSLine=2508, NSUnderlyingError=0x13bf26e40 {Error
> Domain=RBSRequestErrorDomain Code=5 "Launch failed."
> UserInfo={NSLocalizedFailureReason=Launch failed.,
> NSUnderlyingError=0x13bf25ac0 {Error Domain=NSPOSIXErrorDomain Code=153
> "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn
> failed with error: 153}}}}}

Can you try with the solution mentioned here https://stackoverflow.com/a/64887685/5074839
Comment 33 Bryce McKinlay CLA 2021-03-17 13:44:55 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #32)

> Can you try with the solution mentioned here
> https://stackoverflow.com/a/64887685/5074839

That is exactly the error I see, but none of the solutions there work. 

bryce@Bryces-Air /Applications % chmod -R 755 Eclipse.app 
bryce@Bryces-Air /Applications % cd Eclipse.app/Contents/MacOS 
bryce@Bryces-Air MacOS % uname -a
Darwin Bryces-Air 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64 arm64 MacBookAir10,1 Darwin
bryce@Bryces-Air MacOS % file ./eclipse 
./eclipse: Mach-O 64-bit executable arm64
bryce@Bryces-Air MacOS % ./eclipse 
zsh: killed     ./eclipse

It seems to be signed properly so I don't think it's a gatekeeper issue, either:

% pkgutil --check-signature /Applications/Eclipse.app
Package "Eclipse":
   Status: signed by a certificate trusted by macOS
   Certificate Chain:
    1. Developer ID Application: Eclipse Foundation, Inc. (JCDTMS22B4)
       Expires: 2024-08-26 17:23:13 +0000
       SHA256 Fingerprint:
           1B 8E 95 57 A8 0E 3B FC 44 C8 A7 6C 78 2B 76 D7 71 4C F9 2E F9 64 
           52 9B 26 52 1C 1E 2A 86 93 BE
       ------------------------------------------------------------------------
    2. Developer ID Certification Authority
       Expires: 2027-02-01 22:12:15 +0000
       SHA256 Fingerprint:
           7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03 
           F2 9C 88 CF B0 B1 BA 63 58 7F
       ------------------------------------------------------------------------
    3. Apple Root CA
       Expires: 2035-02-09 21:40:36 +0000
       SHA256 Fingerprint:
           B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C 
           68 C5 BE 91 B5 A1 10 01 F0 24
Comment 34 Lakshmi P Shanmugam CLA 2021-03-19 11:21:00 EDT
(In reply to Bryce McKinlay from comment #29)
> (In reply to Sravan Kumar Lakkimsetti from comment #27)
> > Mac M1 build is available here
> > https://download.eclipse.org/eclipse/downloads/drops4/I20210312-1540/download.php?dropFile=eclipse-SDK-I20210312-1540-macosx-cocoa-arm64.dmg
> 
> Eclipse.app from this .dmg did not work for me either:
> 
> % open -a Eclipse.app
> The application /Applications/Eclipse.app cannot be opened for an unexpected
> reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826
> "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app
> (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard,
> _LSLine=2508, NSUnderlyingError=0x13bf26e40 {Error
> Domain=RBSRequestErrorDomain Code=5 "Launch failed."
> UserInfo={NSLocalizedFailureReason=Launch failed.,
> NSUnderlyingError=0x13bf25ac0 {Error Domain=NSPOSIXErrorDomain Code=153
> "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn
> failed with error: 153}}}}}

We don't have UI access to a M1 machine yet to investigate, opened Bug 572115.
Comment 35 Lakshmi P Shanmugam CLA 2021-03-27 08:11:48 EDT
All native libraries are now ported to Arm64, can someone try the latest build and see if it works - https://download.eclipse.org/eclipse/downloads/drops4/I20210326-1800/download.php?dropFile=eclipse-SDK-I20210326-1800-macosx-cocoa-arm64.dmg
Comment 36 Bryce McKinlay CLA 2021-03-27 09:18:04 EDT
(In reply to Lakshmi P Shanmugam from comment #35)
> All native libraries are now ported to Arm64, can someone try the latest
> build and see if it works -
> https://download.eclipse.org/eclipse/downloads/drops4/I20210326-1800/
> download.php?dropFile=eclipse-SDK-I20210326-1800-macosx-cocoa-arm64.dmg

I just tried this build. It gives exactly the same error as before, unfortunately.
Comment 37 Lakshmi P Shanmugam CLA 2021-03-29 05:20:43 EDT
(In reply to Bryce McKinlay from comment #36)
> (In reply to Lakshmi P Shanmugam from comment #35)
> > All native libraries are now ported to Arm64, can someone try the latest
> > build and see if it works -
> > https://download.eclipse.org/eclipse/downloads/drops4/I20210326-1800/
> > download.php?dropFile=eclipse-SDK-I20210326-1800-macosx-cocoa-arm64.dmg
> 
> I just tried this build. It gives exactly the same error as before,
> unfortunately.

Thanks for the quick testing!