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

Bug 349877

Summary: Eclipse repository package fails to build Eclipse.App MACOSX executable on a Linux OS
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: TychoAssignee: Tobias Oberlies <t-oberlies>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: beat, eric.jain, hmalphettes, igor, jan.sievers, luchesar.cekov, marcel.bruch, mlippert, sbouchet, tonny.madsen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 352457    
Bug Blocks:    
Attachments:
Description Flags
example project to replicate error
none
Updated example project to replicate none

Description Greg Amerson CLA 2011-06-20 17:43:11 EDT
When trying to build an Eclipse product on Linux, the tycho build fails when trying to assemble the MacOSX packaged bits.  It fails with this error:

Installation failed.
An error occurred while installing the items
 session context was:(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]tycho.example.javaee.product.executable.cocoa.macosx.x86 0.0.1.v201106201435, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ChmodAction).
 The action chmod failed - file /root/github/gamerson-tycho-sandbox-18d7dd0/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/products/tycho.example.javaee.product/macosx/cocoa/x86/Tycho Java EE Product/eclipse.app/Contents/MacOS/eclipse does not exist
Application failed, log file location: /root/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0-SNAPSHOT/eclipse/configuration/1308605626984.log

I have created 3 example maven projects that demostrate this error here: https://github.com/gamerson/tycho-sandbox/tree/master/TYCHOJavaEEProduct

It works fine on Windows 7, but on Linux I get the above error.  I haven't tried on a OSX machine.
Comment 1 Greg Amerson CLA 2011-06-20 17:53:04 EDT
Created attachment 198295 [details]
example project to replicate error

Here is an example project to replicate error.  Need to build on linux to see error.
Comment 2 Greg Amerson CLA 2011-06-21 11:44:12 EDT
Created attachment 198344 [details]
Updated example project to replicate

I created a new example project zip that is simpler than previous project.  It still replicates the bug on linux OS.
Comment 3 Greg Amerson CLA 2011-06-21 11:45:39 EDT
The example project now just contains a parent pom and one single eclipse-repository package.  Its the same failure around the ChmodAction.  Here is the exact error message shown:

[INFO] Calling director with arguments: [-metadatarepository, file:/root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/publisherRepository/,file:/root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/targetPlatformRepository/, -artifactrepository, file:/root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/publisherRepository/,file:/resolution-context-artifacts@/root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository,file:/root/.m2/repository/, -installIU, tycho.example.javaee.product, -destination, /root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/products/tycho.example.javaee.product/macosx/cocoa/x86/Tycho Java EE Product, -profile, DefaultProfile, -profileProperties, org.eclipse.update.install.features=true, -roaming, -p2.os, macosx, -p2.ws, cocoa, -p2.arch, x86]
Installing tycho.example.javaee.product 0.0.1.v201106210842.
Installation failed.
An error occurred while installing the items
 session context was:(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]tycho.example.javaee.product.executable.cocoa.macosx.x86 0.0.1.v201106210842, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ChmodAction).
 The action chmod failed - file /root/github/gamerson-tycho-sandbox-a08f897/TYCHOJavaEEProduct/TYCHOJavaEEProduct-repository/target/products/tycho.example.javaee.product/macosx/cocoa/x86/Tycho Java EE Product/eclipse.app/Contents/MacOS/eclipse does not exist
Application failed, log file location: /root/.m2/repository/org/eclipse/tycho/tycho-p2-runtime/0.13.0-SNAPSHOT/eclipse/configuration/1308670848520.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tycho Java EE Product Parent ...................... SUCCESS [1.439s]
[INFO] Tycho Java EE Product Repository .................. FAILURE [1:14.856s]
[INFO] ------------------------------------------------------------------------
Comment 4 Greg Amerson CLA 2011-06-24 13:40:53 EDT
So it doesn't seem like the problem is with ChmodAction but rather some process before that, that is causing the files to not be there, /Tycho Java EE Product/eclipse.app/Contents/MacOS/eclipse in particular.
Comment 5 Greg Amerson CLA 2011-07-06 09:32:45 EDT
Are there any others out there that have a workaround on linux?  I guess an easy workaround is to use Windows environment to perform the tycho build.
Comment 6 Eric Jain CLA 2011-07-06 13:06:30 EDT
(In reply to comment #5)
> Are there any others out there that have a workaround on linux?  I guess an
> easy workaround is to use Windows environment to perform the tycho build.

Mount a case-insensitive file system?
Comment 7 Tobias Oberlies CLA 2011-07-15 04:04:42 EDT
(In reply to comment #4)
> So it doesn't seem like the problem is with ChmodAction but rather some process
> before that, that is causing the files to not be there, /Tycho Java EE
> Product/eclipse.app/Contents/MacOS/eclipse in particular.

In the end it looks as if the unzip (which is configured to run before the chmod) wasn't executed - but I don't think this is true. The p2 Engine recovers from failing installs so that when installing additional things, the previously existing installation is not corrupted. Therefore I think that the unzip is done successfully, then the chmod fails (because "Eclipse.app" is specified in lowercase), and then the unzip is undone.
Comment 8 Tobias Oberlies CLA 2011-07-15 05:00:30 EDT
The root cause for this issue is not bug 316028, but rather the fact that the EquinoxExecutableAction (used by the product publisher) generates a chmod instruction with a "eclipse.app/..." path. Unless changed through branding, the folder is called "Eclipse.app" - and hence the chmod command fails in case-sensitive file systems.

This points to another workaround: specify a launcher name different than "" or "eclipse" in the product definition (tab "Launching"). If you wanted to call your launcher "eclipse", the closest you can get is "Eclipse" with a capital e.

To fix this, this requires changes in p2, so the fix probably won't be in 0.13.
Comment 9 Greg Amerson CLA 2011-07-15 16:05:41 EDT
So if I set the launcher name to "eclipse" it should work on Linux?  Is there a way to re-introduce the custom launcher name after the fact?  Like a simple rename of the files using an ant script in the build process?
Comment 10 Greg Amerson CLA 2011-07-16 08:34:18 EDT
I don't think that changing the name of the launcher will work, because in my current product build I am changing the name of the launcher to a custom name that is neither "" or "eclipse" and it has the same error.  I can update the test project for this to show if we need to.  Any other possible workarounds?
Comment 11 Igor Fedorenko CLA 2011-07-16 10:22:20 EDT
I am able to build attached example on linux by adding name attribute (i.e. <launcher name="javaeeproduct">).
Comment 12 Eric Jain CLA 2011-07-16 12:46:49 EDT
If I rename the launcher, I can't build on macosx (unless this has been fixed): https://issues.sonatype.org/browse/TYCHO-501...
Comment 13 Igor Fedorenko CLA 2011-07-16 13:56:22 EDT
(In reply to comment #12)
> If I rename the launcher, I can't build on macosx (unless this has been fixed):
> https://issues.sonatype.org/browse/TYCHO-501...

If you still have the problem with tycho 0.13.0-SNAPSHOT, please open new bugreport and attach sample project to reproduce the problem. (this bug is specifically about building macosx rcp applications on Linux)
Comment 14 Greg Amerson CLA 2011-07-19 17:17:39 EDT
Once I update to Indigo I am able to now avoid this error by specifying a custom launcher now, which is what I was doing in my product anyways, so this works out good.  I consider my issue resolved by moving to Indigo.  But if you want to leave this open because of the default case, that is fine, either way. 

Thanks guys for your responses.
Comment 15 Tobias Oberlies CLA 2012-03-08 04:00:20 EST
The underlying p2 bug should be fixed now. It hasn't made it into an p2 I-build yet, but once that build exists, I'll update the p2 binaries included by Tycho.
Comment 16 Tobias Oberlies CLA 2012-04-13 07:33:52 EDT
Note to self: also re-test fix for bug 316028
Comment 17 Tobias Oberlies CLA 2012-04-20 03:27:31 EDT
It seems that the Eclipse project (temporarily?) only produces 4.2 I-builds (see also bug 355430), so I update the tycho-bundles-target to one of these builds [1]. I suppose that for the dependencies of Tycho, there is no difference between 3.8 and 4.2.

[1] https://git.eclipse.org/r/#/c/5626/
Comment 18 Tobias Oberlies CLA 2012-05-04 10:17:16 EDT
With the update of the p2 version [1], Tycho can now build un-branded product distributions for MacOS on a case-sensitive file system.

(In reply to comment #16)
> Note to self: also re-test fix for bug 316028
This also works (i.e. there is now an "eclipse" symlink in the root of the Mac distribution), but due to a missing Plexus feature [2], the symlink is "inlined" in the distribution archive.

[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=44a45b8f13998a4dfca3452e8bb71e42a1384d72
[2] http://jira.codehaus.org/browse/PLXCOMP-117
Comment 19 Martin Lippert CLA 2012-07-21 15:46:33 EDT
(In reply to comment #18)
> This also works (i.e. there is now an "eclipse" symlink in the root of the Mac
> distribution), but due to a missing Plexus feature [2], the symlink is
> "inlined" in the distribution archive.

Is there a workaround for the broken symlink in the distribution archive?
Comment 20 Tobias Oberlies CLA 2012-07-23 04:28:18 EDT
(In reply to comment #19)
> (In reply to comment #18)
> > This also works (i.e. there is now an "eclipse" symlink in the root of the Mac
> > distribution), but due to a missing Plexus feature [2], the symlink is
> > "inlined" in the distribution archive.
> 
> Is there a workaround for the broken symlink in the distribution archive?
None that I am aware of.