| Summary: | [publisher] ExecutablesDescriptor fails to rename a launcher for macos | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Hugues Malphettes <hmalphettes> | ||||||||||
| Component: | p2 | Assignee: | P2 Inbox <equinox.p2-inbox> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | bsd, bugs.eclipse.org, christian.georgi, eric.jain, hmalphettes, irbull, jamesblackburn+eclipse, jeffmcaffer, mail, steffen.pingel, t-oberlies | ||||||||||
| Version: | 3.6 | ||||||||||||
| Target Milestone: | 3.7 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Linux | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 331974 | ||||||||||||
| Attachments: |
|
||||||||||||
(In reply to comment #0) > Also we probably need to code to update the Info.plist's CFBundleExecutable key > to the name of the executable when it is not 'eclipse' I take that back: BrandingIron is already taking care of Info.plist. I have done a really cheap patch that hardcodes this special case and the rest of the renaming of the executable for macosx is working fine. Created attachment 169700 [details]
Suggested patch
This patch deals with the macosx executable extracted from the equinox launcher feature without changing to much code.
Created attachment 170116 [details]
new patch no camel case attempts
Created attachment 170121 [details]
Testcase
Import this project in the workspace of a PDE.
It contains a launch configuration that runs the ProductPublisher for a product file with a single plugin. The configuration will run out of the box: no need to edit the pathes in the p2 parameters.
It also contains a trimmed down delta-pack with only the cocoa files.
On 3.6M7 it crashes with the exception reported in the bug and inside the published repository folder the binary folder contains a 0 byte long file for the cocoa executable.
With the patch applied to director it behaves as expected.
Created attachment 170475 [details]
New patch
The previous patch was not working when the launcher name was 'eclipse' or 'launcher'.
This patch supports all launcher names.
It does respect the best practice for macosx where the ".app" folder starts with an upper case letter which is also the practice that BrandingIron follows.
I have tested this patch with a tycho build and was able to generate a product archive for macosx with director.
To complete the macosx launcher support with Publisher, the last thing that was missing for me was the symbolic link at the root of the installation. Here is the bug with a patch for that: bug 316028 The maven tycho community is now working on this area and they are facing those bugs with the BrandingIron in p2: https://issues.sonatype.org/browse/TYCHO-520 Ian, what is the future of the p2-publisher's BrandingIron? Do you recommend that we look into using the PDEBuild version instead? For jetty we forked Tycho and I built tycho with a patched version of the p2-publisher. we are looking forward to be able to use the version of tycho that is maintained by the community and this bug is standing on our way. Thanks for your attention! *** Bug 331721 has been marked as a duplicate of this bug. *** Huh, I didn't find this bug before submitting bug 331721; my search only turned up bug 325301 against Buckminster. To repeat Jeff's comment on bug 331721: > I believe this is a dupe of bug 313997. We should look at the patch here and > patch there, the one in Buckminster and what they have done in Tycho to see if > unification is possible. Buckminster has also forked the p2 publisher's code and fixed the .ini issue as well as handling icons too. I ported their patch to the current p2 publisher as attachment 184413 [details] (attached to bug 331721). Hi everyone, It's not clear if this is still a problem with all the publisher work that was done recently. I will look at this for 3.7.1 I have seen this working: when specifying a launcher name, e.g. "myrcp", the launcher in the installed product is in "myrcp.app/Contents/MacOS/myrcp". In fact, this is a workaround for bug 352457. AFAIK, the only missing feature for Mac products is the symlink to the launcher from the installation root, but there is a separate bug for this: bug 316028. I believe the issue described in this bug has been resolved in 3.7. This issue has been resolved through other changes which are part of the 3.7 release. |
When invoking the PublishProduct application outside of the PDEBuilder, I see the following stack trace: Generating metadata for .. java.io.FileNotFoundException: /tmp/p2.brandingIron3758427379227508132/Eclipse.app/Contents/MacOS/eclipse.ini (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zipFile(FileUtils.java:357) at org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:286) at org.eclipse.equinox.internal.p2.core.helpers.FileUtils.zip(FileUtils.java:251) at org.eclipse.equinox.p2.publisher.AbstractPublisherAction.publishArtifact(AbstractPublisherAction.java:469) at org.eclipse.equinox.p2.publisher.eclipse.EquinoxExecutableAction.publishExecutableIU(EquinoxExecutableAction.java:129) This was reported here: http://www.eclipse.org/newsportal/article.php?id=6608&group=eclipse.technology.equinox#6608 It looks like the org.eclipse.equinox.internal.p2.publisher.eclipse#ExecutablesDescriptor does not work for macoxs when the executable is created from the equinox executable feature. In that case the launcher is called "launcher" (hardcoded line 63 of ExecutablesDescriptor) and it is not related to the ini file (named "eclipse.ini"). The method updateExecutableName assumes that the ini file is derived from the launcher name. Also we probably need to code to update the Info.plist's CFBundleExecutable key to the name of the executable when it is not 'eclipse' Let me know if I missed something. I can contribute a patch if that helps.