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

Bug 233159

Summary: P2Installer doesn't work on a Mac
Product: [Eclipse Project] Platform Reporter: Alex Blewitt <alex.blewitt>
Component: RelengAssignee: Kim Moir <kim.moir>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: aniefer, jeffmcaffer, kim.moir, pascal, tjwatson, wong
Version: 3.4Flags: pascal: review+
tjwatson: review+
jeffmcaffer: review+
Target Milestone: 3.4 RC3   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 234032    
Bug Blocks:    
Attachments:
Description Flags
workaround patch none

Description Alex Blewitt CLA 2008-05-21 04:08:02 EDT
I downloaded the installer from:

 http://download.eclipse.org/eclipse/equinox/drops/S-3.4RC1-200805161333/index.php#Provisioning

and when running it, it doesn't install the SDK as the documentation suggests:

 http://wiki.eclipse.org/Equinox_p2_Installer

* Get the installer for your platform from the equinox download page.
* Unzip the installer anywhere on your local disk
* Run the "p2installer" executable
* In the install wizard, select where you want to install the software

Shows a dialog with "Where do you want to install null?"

I had a look at the p2installer.ini:

-showsplash
org.eclipse.platform
-vmargs
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.internal.carbon.smallFonts

The download page points to a wrong URL:

http://wiki.eclipse.org/Equinox_p2_Installer

While the installer by default will install the Eclipse SDK, the installer itself is entirely generic. The installer knows what to install by reading an install description specified in p2installer.ini:
 -vmargs -Dorg.eclipse.equinox.p2.installDescription=http://update.eclipse.org/eclipse/testUpdates/sdk-installer.properties
If you look at sdk-installer.properties in a Web browser, you will see:
 eclipse.p2.rootId=sdk
 eclipse.p2.metadata=http://update.eclipse.org/testUpdates/
 eclipse.p2.artifacts=http://update.eclipse.org/testUpdates/
 ... and other properties ...
The 'rootId' attribute describes what to install, and the next two attributes describe where to get the metadata and artifacts to be installed. By changing those attributes, you can make the installer install a different piece of software, or install from a different repository.

Even with Jeff's advice, and using the right URL,

The doc is wrong.  The correct URL is
       http://download.eclipse.org/eclipse/testUpdates/sdk-installer.properties

and adding that entry into the p2installer.ini, I still didn't get any joy. (Is it even reading the p2installer.ini?) However, finally, when I add the system property on the command line:

apple[MacOS] ./p2installer -vmargs -Dorg.eclipse.equinox.p2.installDescription=http://download.eclipse.org/eclipse/testUpdates/sdk-installer.properties

I finally get some joy, and can install Eclipse.

So it appears to be a packaging issue, in that (1) it doesn't appear to be reading the p2installer.ini, (2) there's no definition of the sdk-installer.properties, and (3) the documentation giving some clue as to where it should be points to the wrong place.

Note that if the only testing has been done by JNLP, you won't have noticed this, since the way of setting up the properties is different for JNLP files than by the double-clicking executable launcher.
Comment 1 Pascal Rapicault CLA 2008-05-21 15:05:40 EDT
Ben, Jeff, could you please investigate.
Comment 2 Benson Wong CLA 2008-05-22 10:16:21 EDT
I think the installer from http://download.eclipse.org/eclipse/equinox/drops/S-3.4RC1-200805161333/index.php#Provisioning wasn't built properly.

I checked out the installer code and ran it, it worked fine. I exported it using the export wizard and ran it, it worked fine. 

The p2installer.ini that I exported was different, it only had:
-vmargs
-Dorg.eclipse.equinox.p2.installDescription=http://download.eclipse.org/eclipse/testUpdates/sdk-installer.properties
Comment 3 Jeff McAffer CLA 2008-05-22 23:03:00 EDT
yeah, hte instlaler on the download site clearly has the .ini file from the SDK not one that is appropriate for the installer.  It is not clear how the installer is being built.  If it is via some sort of product export/build then there may well be a bug in pde build as the product file has the right markup and exporting from the workspace on a Mac works fine.

Alternatives:
- there may be a whacky build story for the installers and somehwo it is out of date (note that I believe that previous versions of the Mac installer worked)

- there may be an issue with crossplatform build and/or deltapacks.  
Comment 4 Kim Moir CLA 2008-05-23 16:41:27 EDT
I don't know why this is happening since the 
org.eclipse.equinox.p2.installer\installer.product specifies the vm arguments for all the drops.  All three installer platforms are built in the same way.

Andrew do you have any ideas?
Comment 5 Andrew Niefer CLA 2008-05-23 17:39:58 EDT
Depending on how the metadata is being generated for the installer, this could be caused by bug 222126.  This could be the problem if the metadata is being generated by running the generator over the built installer product (like the old style p2 build did for sdk).  The fix would be some variation on providing the .product file to the generator or generating the metadata through the pde.build integration like the sdk does.

I will take a look on Monday.
Comment 6 Jeff McAffer CLA 2008-05-26 15:54:03 EDT
the problem still occurs in RC2.  Just get the installer download and look in the p2installer.ini file to see the incorrect content.
Comment 7 Andrew Niefer CLA 2008-05-26 17:07:27 EDT
Created attachment 102049 [details]
workaround patch

caused by bug 234032.  Patch is a workaround.
Comment 8 Kim Moir CLA 2008-05-26 17:18:59 EDT
I hacked the test build that I'm running now for bug 224278 to include this fix as well.
Comment 9 Kim Moir CLA 2008-05-27 08:57:21 EDT
Test build was successful, thanks Andrew.

Jeff, Pascal, Tom, please +1 for inclusion in RC3.
Comment 10 Jeff McAffer CLA 2008-05-27 09:04:00 EDT
Teh patch itself looks fine.  Some related questions:
- is the workaround sufficient for 3.4?  
- Will others run into the same problem?  
- Is there something that needs to go in a migration guide etc?

Comment 11 Thomas Watson CLA 2008-05-27 09:46:51 EDT
+1, but please confirm my understanding of the patch.  It simply deletes the incorrect eclipse.ini file from the executable feature from the collectingFolder before the files from the collectinFolder are added to the installer.  This prevents the good eclipse.ini from getting overwritten in the installer.  Correct?
Comment 12 Kim Moir CLA 2008-05-27 10:09:38 EDT
regarding comment #11, yes Tom this is correct
Comment 13 Andrew Niefer CLA 2008-05-27 11:13:41 EDT
(In reply to comment #10)
> Teh patch itself looks fine.  Some related questions:
> - is the workaround sufficient for 3.4?  
> - Will others run into the same problem?  
> - Is there something that needs to go in a migration guide etc?
> 

I will fix bug 234032 so others won't have the same problem.  I think the workaround is a good idea so that Kim does not have to wait for the fix and then update her basebuilder this close to release.
Comment 14 Andrew Niefer CLA 2008-05-27 11:22:36 EDT
(In reply to comment #11)
> +1, but please confirm my understanding of the patch.  It simply deletes the
> incorrect eclipse.ini file from the executable feature from the
> collectingFolder before the files from the collectinFolder are added to the
> installer.  This prevents the good eclipse.ini from getting overwritten in the
> installer.  Correct?
> 

Just to clarify, at the time this delete runs, the collectingFolder looks something like:

Eclipse.app/Contents/MacOS/eclipse
Eclipse.app/Contents/MacOS/eclipse.ini
p2installer.app/Contents/MacOS/p2installer.ini

Immediately after this, the pde.build branding task is going to rename the "eclipse" launcher to "p2installer" and move it over to the p2installer.app.  Similarly for the .ini which ends up overwriting the correct p2installer.ini

Comment 15 Kim Moir CLA 2008-05-28 09:09:40 EDT
released for I20080528-2000.