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

Bug 402052

Summary: The eclipse file is no longer symbolically linked to the real one from the Eclipse.app folder
Product: [Eclipse Project] Platform Reporter: Thomas Watson <tjwatson>
Component: RelengAssignee: Paul Webster <pwebster>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, david_williams, jan.sievers, john.arthorne, markus.kell.r, pwebster, thanh.ha
Version: 4.3   
Target Milestone: 4.3 M6   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 372792, 393922    
Attachments:
Description Flags
Workaround for the mac - tar none

Description Thomas Watson CLA 2013-02-28 14:13:28 EST
Build: 4.3.0.I20130227-2000

The eclipse-SDK-I20130227-2000-macosx-cocoa.tar.gz download.

The CBI based build seems to be placing a copy of the eclipse executable into the root of the eclipse/ folder.  Previously this file was symbolically linked to the real executable located in the Eclipse.app/Contents/MacOS/eclipse:

Previously:
ls -l eclipse
lrwxr-xr-x@  1 xxx yyy     34 Jan 27  2012 eclipse -> Eclipse.app/Contents/MacOS/eclipse

Build: 4.3.0.I20130227-2000
ls -l eclipse
-rwxr-xr-x   1 xxx yyy  65496 Feb 27 21:25 eclipse


This would not be that noticeable, but it now causes a failure to launch eclipse if you use the one located in the root eclipse/ folder with the following error:

Alert
The Eclipse executable launcher was unable to locate its companion shared library.

This is because the eclipse.ini is not available to the eclipse launcher at that location.
Comment 1 Thanh Ha CLA 2013-02-28 19:01:36 EST
I noticed even Tycho's demo RCP project [1] does not create a symbolic link for me. I posted this issue on tycho-users [2].


[1] http://wiki.eclipse.org/Tycho/Demo_Projects/RCP_Application
[2] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg04062.html
Comment 2 Jan Sievers CLA 2013-03-01 02:36:55 EST
is the problem only in the created tar archive (but the symlink is presetn under under target/products/ ) ?

If so, this is probably http://jira.codehaus.org/browse/PLXCOMP-117
Comment 3 Thanh Ha CLA 2013-03-01 09:08:07 EST
(In reply to comment #2)
> is the problem only in the created tar archive (but the symlink is presetn
> under under target/products/ ) ?
> 
> If so, this is probably http://jira.codehaus.org/browse/PLXCOMP-117

Yes, the symlink is present in the directory but not in the archive. I guess we're hitting the Plexus bug.
Comment 4 Jan Sievers CLA 2013-03-01 09:19:52 EST
(In reply to comment #3)
> Yes, the symlink is present in the directory but not in the archive. I guess
> we're hitting the Plexus bug.

given that
http://jira.codehaus.org/browse/PLXCOMP-117

is reported since 4 years, I think we need a short-term plan B here.
first thing that comes to my mind is using 
http://ant.apache.org/manual/Tasks/tar.html

and maven antrun plugin (*if* ant tar supports symlinks).

I may find time to investigate if we can propose a fix for the plexus archiver bug (I did this in the past for another similar bug http://jira.codehaus.org/browse/PLXCOMP-207 ) but this will definitely take time until it's accepted and released.
Comment 5 Jan Sievers CLA 2013-03-01 09:26:25 EST
I can't help wonder why this was not detected earlier as the plexus bug has always been there.
Comment 6 Thanh Ha CLA 2013-03-01 09:49:18 EST
(In reply to comment #5)
> I can't help wonder why this was not detected earlier as the plexus bug has
> always been there.

I believe symbolic links are only created for the Mac OSX packages and we haven't had very many Mac testers until now so it likely slipped through the cracks.
Comment 7 Thomas Watson CLA 2013-03-01 10:28:19 EST
(In reply to comment #6)
> (In reply to comment #5)
> > I can't help wonder why this was not detected earlier as the plexus bug has
> > always been there.
> 
> I believe symbolic links are only created for the Mac OSX packages and we
> haven't had very many Mac testers until now so it likely slipped through the
> cracks.

That and the typical Mac user is not going to invoke the symbolically linked executable.  Only crazies like me that want to get console output from the start to debug or get an osgi> prompt in a console.
Comment 8 Jan Sievers CLA 2013-03-04 04:56:16 EST
(In reply to comment #4)
> (In reply to comment #3)
> first thing that comes to my mind is using 
> http://ant.apache.org/manual/Tasks/tar.html

although ant tar seems to have support for symlinks on implementation level

- it does not pick up symlinks from the filesystem and it seems there is no way to configure them [1]
- worse, it does not pick up unix permissions from file system [2] and you would have to configure e.g. execute permissions for each file explicitly (as opposed to plexus tar where this works out of the box)

[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=40059
[2] http://stackoverflow.com/questions/1517297/how-can-i-use-the-ant-tar-task-and-preserve-file-permissions

the way I see it the only short term workaround is to go antrun > exec with native tar
Comment 9 Paul Webster CLA 2013-03-13 11:01:24 EDT
Tom, could you try the version at http://build.eclipse.org/eclipse/builds/eclipse-SDK-test-macosx-cocoa.tar.gz

PW
Comment 10 Thomas Watson CLA 2013-03-13 11:33:01 EDT
(In reply to comment #9)
> Tom, could you try the version at
> http://build.eclipse.org/eclipse/builds/eclipse-SDK-test-macosx-cocoa.tar.gz
> 
> PW

It works for me.  I see the link file there and it points to the correct executable.
Comment 11 Paul Webster CLA 2013-03-13 11:56:29 EDT
Created attachment 228361 [details]
Workaround for the mac - tar

David, what about this workaround for M6?  Update the production script to use build.eclipse.org tar to get the correct symbolic links.

PW
Comment 12 David Williams CLA 2013-03-13 12:28:44 EDT
(In reply to comment #11)
> Created attachment 228361 [details]
> Workaround for the mac - tar
> 
> David, what about this workaround for M6?  Update the production script to
> use build.eclipse.org tar to get the correct symbolic links.
> 
> PW

I don't like it (having to work around someone else's bug) but won't object. 

I know in PDE build we often used "native zip" instead of ant's, for similar reasons. 

But, I'll let you commit. 

Thanks for the work around.
Comment 13 Paul Webster CLA 2013-03-13 12:40:46 EDT
Released as http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/commit/?id=413247308aadd0b08ab558a96f949672df229ddb

Will the change to build-functions.sh be picked up by the next build?

PW
Comment 14 Jan Sievers CLA 2014-03-06 14:31:51 EST
 tycho bug 429809 may eventually provide a more general solution