Bug 1000740

Summary: Broken symlinks in /usr/lib64/eclipse/plugins/
Product: [Fedora] Fedora Reporter: Gerard Ryan <gerard>
Component: eclipseAssignee: Alexander Kurtakov <akurtako>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akurtako, andjrobins, jerboaa, kdaniel, overholt, rgrunber, swagiaal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-30 16:03:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 879999    

Description Gerard Ryan 2013-08-24 20:28:43 UTC
Description of problem:
I rawhide and f20, there appear to be 2 broken symbolic links:

javax.servlet.jsp_2.2.1.jar -> /usr/share/java/glassfish-jsp-api.jar
 -- should point to /usr/share/java/glassfish-jsp-api/javax.servlet.jsp-api.jar

org.apache.felix.gogo.runtime_0.10.0.jar -> /usr/share/java/felix/org.apache.felix.gogo.runtime.jar
 -- should point to /usr/share/java/felix/felix-gogo-runtime.jar

Version-Release number of selected component (if applicable):
4.3.0-11.1.fc21.x86_64
felix-gogo-runtime-0.10.0-10.fc20.noarch
glassfish-jsp-api-2.2.1-8.fc20.noarch

Additional info:
I think this is causing bug #879999 to reappear (I closed it earlier, but it still seems to be a problem).

Comment 1 Roland Grunberg 2013-08-26 14:29:58 UTC
Looks like the symlinks for these packages were updated to the latest packaging guidelines (use XMvn) and as a result the jar names have changed. This will require small modifications in %%{SOURCE1) at org.eclipse.linuxtools.eclipse-build/dependencies/replace_platform_plugins_with_symlinks.sh . There's some other things I need to do but hopefully I'll have a chance to get to this as well.

Comment 2 Roland Grunberg 2013-08-27 20:47:05 UTC
I was thinking it might be easier to create compatibility symlinks in the updated packages given that there may be more packages that switch over to XMvn which are likely to result in slightly different jar locations. Either way I've pushed a build http://koji.fedoraproject.org/koji/taskinfo?taskID=5862471 . Let me know if this fixes the issue.

Comment 3 Gerard Ryan 2013-08-29 20:39:15 UTC
(In reply to Roland Grunberg from comment #2)
> I was thinking it might be easier to create compatibility symlinks in the
> updated packages given that there may be more packages that switch over to
> XMvn which are likely to result in slightly different jar locations.

Easier, maybe. I think it would be cleaner to find and fix all the references though, otherwise we may end up with lots of compatibility links all over the place.

> Either way I've pushed a build
> http://koji.fedoraproject.org/koji/taskinfo?taskID=5862471 . Let me know if
> this fixes the issue.

Almost! :) I've found two more references that need to be updated in /usr/lib64/eclipse/dropins/jdt/plugins/ 

I've fixed those links in a local mock env, and everything appears to work fine after that, so updating them in rawhide/f21 should fix all the things.

Thanks!

Comment 4 Gerard Ryan 2013-08-29 20:59:56 UTC
(In reply to Gerard Ryan from comment #3)
> Almost! :) I've found two more references that need to be updated in
> /usr/lib64/eclipse/dropins/jdt/plugins/ 

By the by, it's the same two jars that are linked in here that are broken too. i.e.:
javax.servlet.jsp_2.2.1.jar
org.apache.felix.gogo.runtime_0.10.0.jar

Comment 5 Roland Grunberg 2013-08-29 21:51:16 UTC
The only symlinks I see in that folder are :

junit.jar -> /usr/share/java/junit.jar
org.hamcrest.core_1.3.0.v201303031735.jar -> /usr/share/java/hamcrest/core.jar

The latest versions on rawhide (hamcrest-1.3-5.fc20, junit-4.11-7.fc21) both use those paths.

I'm basically testing this on rawhide by doing a 'mock -r fedora-rawhide-i386 --install eclipse-jdt' and confirming that the packages mentioned have symlinks and are the latest version. Can you confirm that the latest version of Eclipse was grabbed by your mock environment ?

Comment 6 Gerard Ryan 2013-08-29 23:23:03 UTC
As we discussed in IRC, it was in release -11.1 that I saw those strange symlinks. All is working now, thanks.

I'll leave it to you to close this bug, in case you would like to use it to track why the strange symlinks ended up in dropins/jdt/plugins/

Comment 7 Roland Grunberg 2013-08-30 13:54:00 UTC
So the problem seems to be happening because of a small bug in 'replace_platform_plugins_with_symlinks.sh' and the error gets compounded in 'move_JDT_PDE_to_dropins.sh'.

The '_symlink' function in 'replace_platform_plugins_with_symlinks.sh' assumes the file must exist (either in SCL_JAVA_DIR or /usr/share/java). If the file doesn't exist this will create a broken symlink in /usr/share/java. (The koji build logs also confirm this is happening : http://kojipkgs.fedoraproject.org//packages/eclipse/4.3.0/11.fc20/data/logs/i686/build.log )

After this, 'move_JDT_PDE_to_dropins.sh' attempts to determine what is part of the JDT and what is part of PDE. To do this it takes a basic eclipse installation, makes a duplicate, and installs a specific feature (eg. -installIU org.eclipse.jdt.feature.group). Now the dropins location will receive every bundle that is in the new installation, but not in the old one. (eg. jdt dropins = (platform + jdt) - (platform)). The problem is that the files in the new installation are listed with 'ls' and their existence is checked with [ -e  $file ]. A symlink will get listed, but it doesn't actually exist so it becomes part of that particular dropins location.

Comment 8 Roland Grunberg 2013-08-30 16:03:49 UTC
I've fixed this upstream with http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.eclipse-build.git/commit/?id=fd2b404fed299a1f2af8c183d86c0cfc4bfc63e9 . A non-existent target for a symlink should fail the build rather than create a potentially broken one. This will eventually end up in Fedora eventually.

I'm going to close this as RAWHIDE given that the problem is resolved for now on rawhide. If more broken symlinks are found as dependent packages get updated, feel free to reopen this bug.