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

Bug 442893

Summary: tar.gz archives silently inline symbolic links if JDK6 is used
Product: z_Archived Reporter: Andreas Pakulat <andreas>
Component: TychoAssignee: Tobias Oberlies <t-oberlies>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: t-oberlies
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Andreas Pakulat CLA 2014-08-29 09:56:01 EDT
I've setup a rootFile link to be able to ship the JRE on MacOSX. On that platform a symlink from jre/Contents/MacOS to a file inside jre/Contents/Home/jre/lib/jli is needed for the JVM to start up. This works fine, the unpacked product directory contains the jre folder and the symlink.

Unfortunately the zip archive contains a full copy of that file instead of a symlink. Since not all unzip tools understand symlinks in the first place I opted to try the tar.gz archive, but this too has a full copy of the file.

This makes the roofile linking feature completely useless.
Comment 1 Andreas Pakulat CLA 2014-08-29 10:48:54 EDT
I think this one is a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=429809, not sure why my first search didn't find that. I'll try updating to tycho 0.21.0 to see if that fixes my problem.
Comment 2 Andreas Pakulat CLA 2014-08-29 11:43:55 EDT
Tries tycho 0.21.0 now, but still ending up with the same problem when using the tar.gz archiver. Extracting the generated tar.gz using tar xzf on a Linux system generates a real binary file instead of the symlink that exists in the unpacked products/<productid>/macosx/cocoa/x86_64/ folder.
Comment 3 Tobias Oberlies CLA 2014-09-01 04:03:14 EDT
AFAIK, symbolic links should be preserved in tar.gz if you running with a 1.7 or 1.8 JDK. So which JDK are you running your build with?

If you were in fact using 1.6, I would have expected a warning - but from what I can see in the code, Tycho silently switches to the tar.gz archiver which doesn't support symbolic links.
Comment 4 Andreas Pakulat CLA 2014-09-01 04:18:17 EDT
My default java/javac is:
java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-2)
OpenJDK Server VM (build 24.51-b03, mixed mode)

But I just realized that my JAVA_HOME still points to the old java6 install I have lying around. So depending on what maven picks up I may indeed have run with Java 6. Will verify that java 7 is being used and report back.
Comment 5 Andreas Pakulat CLA 2014-09-01 05:15:05 EDT
Indeed, I can confirm that after switching to Java 7 (instead of Java 6) the generated tarball has a symlink. So I'm closing this one as a dupe of the other ticket.

*** This bug has been marked as a duplicate of bug 429809 ***
Comment 6 Tobias Oberlies CLA 2014-09-01 05:25:54 EDT
mvn -v prints Maven and used Java version. Maven uses JAVA_HOME to pick the JDK.
Comment 7 Tobias Oberlies CLA 2014-09-01 06:58:51 EDT
I've proposed a change to add a warning in case the JDK version used by the build may lead to in-lined symbolic links: https://git.eclipse.org/r/#/c/32632/
Comment 8 Tobias Oberlies CLA 2014-09-02 13:23:28 EDT
Submitted the proposed change [1] (and an NPE fix [2])

@Andreas: Thanks for pointing out that silently in-lining symbolic links is confusing. The warning should make error analysis easier.

[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=645807a6d8dc5406845e7cd5ac6ce7df661895fa
[2] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=f3b0ea3cdac735dafcea58210664e9f726096986
Comment 9 Andreas Pakulat CLA 2014-09-02 16:30:10 EDT
Cool, hopefully helps the next person running into this. Always strange if you see things on disk and then something else ends up in an archive.