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

Bug 424769

Summary: symbolic link missing from "Mac packages"
Product: [Technology] EPP Reporter: David Williams <david_williams>
Component: PackagerAssignee: Project Inbox <epp.packager-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: beth, gunnar, manderse, mknauer
Version: 4.4.0   
Target Milestone: 4.4.0M6   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description David Williams CLA 2013-12-30 20:10:32 EST
This bug is to follow up on the discussion started with 

http://dev.eclipse.org/mhonarc/lists/epp-dev/msg02871.html

where 'eclipse' at the command line didn't work as it did previously, because, as others reported in that thread, the 'eclipse' in directory was an executable, instead of a symbolic link to the executable at .../Eclipse.app/Contents/MacOS/eclipse
Comment 1 David Williams CLA 2013-12-30 20:42:54 EST
Bug 402052 describes what we in the Eclipse Platform learned about this issue. It include a link back to the "root problem" in some core code Tycho makes use of: 
http://jira.codehaus.org/browse/PLXCOMP-207 

The "key" is to examine your actual "target" on build machine, to see if the symbolic link exists there, and if so, sounds like it is the same issue, and is simply a matter of using a different "archiver" than the one Tycho uses. 

We, in Platform, simply use 'tar' (literally, on Linux) in a "post build" step to tar up the target directory, since it maintains symbolic links (by default), and "throw away" the tar created by Tycho/Maven (for Mac's). 

To be concrete, see 
http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/production/build-functions.shsource#n766

Ideally this could be a "post packaging" step in your Tycho/Maven scripts and use "antrun" plugin, but even then your ant script may have to call out to native tar command using 'exec' ... since I don't think Ant's tar task natively supports symbolic links either? (see apache bug https://issues.apache.org/bugzilla/show_bug.cgi?id=15244). [I would have sworn I saw a release note recently that limitation had been fixed ... but could not find it with any easy google search and instead found these old apache bug reports. So if you find out differently, let us know :) ]
Comment 2 Markus Knauer CLA 2014-01-30 07:43:20 EST
Setting target milestone to 4.4M6 - I didn't find the time to solve this in time for M5.
Comment 3 David Williams CLA 2014-02-13 05:47:34 EST
*** Bug 427827 has been marked as a duplicate of this bug. ***
Comment 4 Markus Knauer CLA 2014-03-03 03:00:05 EST
*** Bug 424488 has been marked as a duplicate of this bug. ***
Comment 5 Markus Knauer CLA 2014-03-07 16:30:22 EST
Testing required.

The solution creates tar.gz archives that contain correct symbolic links. It replaces tycho-p2-director:archive-products (which doesn't work) with a Bash shell script that is executed within the Maven build only if the build is running on a Unix operating system (where we can safely assume that tar, gzip, and zip work). After some investigation I had to find out that no Java build tool is able to create anything that looks like a valid tar archive including symlinks, not Maven, not Ant, ...

commit d237984161d39db3ee24ab5438f08194b7426aed
commit ecf0e2310eeed9b30305606ecdf79db5ad77115b
Comment 6 David Williams CLA 2014-03-08 22:34:02 EST
> After some investigation I had to find out that no Java
> build tool is able to create anything that looks like a valid tar archive
> including symlinks, not Maven, not Ant, ...
> 

In bug 402052 comment 14, Jan Sievers has pointed to bug tycho bug 429809 ... "may eventually provide a more general solution" (based on Apache's commons  compress and Java 7 file nio). Just FYI.
Comment 7 Beth Tibbitts CLA 2014-03-13 20:54:50 EDT
Works! I can now launch from Mac command line again.
Comment 8 Markus Knauer CLA 2014-03-14 02:07:32 EDT
Great! Thanks for testing/reporting back!