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

Bug 240053

Summary: product export from the ui does not generate bundles.info
Product: [Eclipse Project] PDE Reporter: Jeff McAffer <jeffmcaffer>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: aniefer, caniszczyk, darin.eclipse, mluchian
Version: 3.4Flags: jeffmcaffer: pmc_approved+
Target Milestone: 3.4.2   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on: 237662, 246391    
Bug Blocks:    
Attachments:
Description Flags
patch to build
none
org.eclipse.pde.core.patch
none
pde.core patch updated none

Description Jeff McAffer CLA 2008-07-08 14:41:28 EDT
in 3.4

When you have a product that include (directly or indirectly) the simple configurator, exporting that product from the UI does not produce a bundles.info file.  however, biulding the product with the releng build mechanism does.  This is a pretty significant issue for people trying to create products in the new world.  

Suggest looking at this for 3.4.1
Comment 1 Chris Aniszczyk CLA 2008-07-08 14:48:35 EDT
Are you sure? I believe you should get one if you don't export your product as a zip.
Comment 2 Jeff McAffer CLA 2008-07-08 14:53:42 EDT
not sure what zip vs dir has to do with this but I do happen to be exporting to a dir.
Comment 3 Jeff McAffer CLA 2008-07-08 14:54:53 EDT
I should also note that Andrew N and I looked through the code and did not see anywhere in the PDE UI code (e.g., ProductExportOperation) that was writing this file whereas in the pde build code there are some clear calls to methods that write the bundles.info file.
Comment 4 Chris Aniszczyk CLA 2008-07-08 15:03:11 EDT
Ah, Andrew is correct on export.

When we launch is when we will generate the bundles.info etc if simpleconfigurator is there.

Ideally I would just like to call PDE build to generate this file... the product export code is too complicated in UI currently.

Is there anything we can do from UI Andrew to get PDE Build to do the "magic"?
Comment 5 Andrew Niefer CLA 2008-07-08 15:41:10 EDT
Build currently generates .eclipseproduct, launcher.ini and config.ini (bundles.info) when a .product file is specified and not exporting from the UI.  It is an easy change to turn this on during export as well.  

If that is done, UI would not do any of:
			createConfigIniFile(config);
			createEclipseProductFile();
			createLauncherIniFile(config[0]);

We need to identify any differences between these UI methods and their equivalents in build's ProductGenerator.
Comment 6 Chris Aniszczyk CLA 2008-07-08 15:47:38 EDT
Tell me what I need to do and I'm there Andrew ;)

Most of the current stuff in product export is black magic on PDE UI's part... a lot of the things we should be doing should be delegated to PDE Build.. otherwise we end up with scenarios where things exported in the UI are different than in headless (PDE BUILD)
Comment 7 Chris Aniszczyk CLA 2008-07-16 15:42:16 EDT
Andrew, let's try to sync up sometime this week to get this one in for 3.5M1 and 3.4.1
Comment 8 Andrew Niefer CLA 2008-07-16 16:05:10 EDT
Chris, can you confirm that the 3 methods listed in comment #5 are equivalent to the versions in build's ProductGenerator
Comment 9 Andrew Niefer CLA 2008-07-16 16:27:30 EDT
This probably should not be done without bug 237662 being fixed first.
Comment 10 Chris Aniszczyk CLA 2008-08-18 14:56:05 EDT
(In reply to comment #9)
> This probably should not be done without bug 237662 being fixed first.

In essence, we are doing the same thing Andrew.

What are the next steps for PDE to take advantage of PDE Build for product export?
Comment 11 Chris Aniszczyk CLA 2008-08-18 16:04:20 EDT
Looking at the code, if we set org.eclipse.pde.internal.build.IXMLConstants.PROPERTY_PRODUCT somewhere when PDE generates the build.properties and point to the product file, that looks like it may do it.
Comment 12 Andrew Niefer CLA 2008-08-18 16:42:59 EDT
Created attachment 110286 [details]
patch to build

Add you need this
Comment 13 Chris Aniszczyk CLA 2008-08-18 17:24:29 EDT
(In reply to comment #12)
> Created an attachment (id=110286) [details]
> patch to build

How do you handle the JRE's defined within product files Andrew? I don't see anything in ProductGenerator
Comment 14 Andrew Niefer CLA 2008-08-18 17:47:23 EDT
We don't.  I thought there was a bug for this but I can't find it atm.  Build doesn't know about the org.eclipse.jdt.launcher.JRE_CONTAINER that you are using here.
Comment 15 Darin Wright CLA 2008-08-26 14:48:47 EDT
This is really an enhancement/missing function. Perhaps 3.4.2 if the fix is trivial, but for now moving to 3.5.
Comment 16 Jeff McAffer CLA 2008-08-27 03:04:15 EDT
Not really sure how this is an enhancement request vs a bug.  If you export a product using the UI the result does not run.  I respectfully ask that this be added back to being considered fro 3.4.1.  The comments are a bit inconclusive but it seems we have a fix in hand.
Comment 17 Darin Wright CLA 2008-08-27 09:05:46 EDT
This is Chris's call for 3.4.1 - our PDE committer is on his honeymoon :-) However, at this point it will require a rebuild request as the last 3.4.1 build has already started.
Comment 18 Chris Aniszczyk CLA 2008-08-27 11:32:24 EDT
Let me investigate this one for 3.4.1, I already had a patch I was working on but was trying to test what Andrew removing the PDE UI kill switch would do to other things. Any thoughts Andrew?
Comment 19 Chris Aniszczyk CLA 2008-08-27 11:33:04 EDT
Created attachment 111082 [details]
org.eclipse.pde.core.patch

Removes the useless PDE methods for generating product stuff now and relies on PDE Build
Comment 20 Chris Aniszczyk CLA 2008-08-29 00:31:41 EDT
There needs to be more coordination between build/ui, this will have to wait until 3.4.2
Comment 21 Andrew Niefer CLA 2008-08-29 12:05:04 EDT
Sorry, I have been on vacation and am just getting caught up now.  Given the long weekend, I am more comfortable with this in 3.4.2.

RE comment #16, I had the impression that such products were starting by either using the update.configurator or by listing everything on the bundles list.  Particularily given bug 237662, I believed we were actually better off in 3.4 without generating the bundle.info during export.
Comment 22 Jeff McAffer CLA 2008-08-30 18:40:25 EDT
agreed on the 3.4.2.  As for starting, yes but that disabled p2. So it is not really a work around. 
Comment 23 Andrew Niefer CLA 2008-09-03 10:01:16 EDT
Note that there is no install occurring during export.  Generating a bundles.info will not result in a p2 enabled RCP app.
Comment 24 Chris Aniszczyk CLA 2008-09-03 10:18:36 EDT
Andrew, can you help do a bit of PDE Build debugging after the patch is applied to see what is going on? I'm getting a couple exceptions coming from Build about files not being found for cleaning.
Comment 25 Chris Aniszczyk CLA 2008-09-04 10:58:26 EDT
Andrew, when do you have time to chat about this one? I'm dying on debugging PDE build :)
Comment 26 Andrew Niefer CLA 2008-09-04 13:37:38 EDT
Created attachment 111694 [details]
pde.core patch updated

Chris, the problem was coming from ProductExportOperation#getRootFileLocations.  Here you set up properties specifies files to be copied into the root of the product.  The last entry being set was a "temp" folder where the config.ini and other files were being generated.  By removing your config.ini, that folder never got created leading to the problems later.

Updated patch removes the temp folder from the root properties.
Also, I removed an unused instantiation of build's ProductGenerator.
Comment 27 Chris Aniszczyk CLA 2008-09-04 17:45:07 EDT
This is good stuff, just did some tests and things are good.

Andrew, what about the createBuildPropertiesFile() method?

We have logic in there to deal with launcher executable... can we replace that with something else as I believe PDE Build needs to handle this case too.
Comment 28 Chris Aniszczyk CLA 2008-09-04 17:47:04 EDT
I'm almost not see the '.eclipseproduct' come along.
Comment 29 Chris Aniszczyk CLA 2008-09-04 17:52:09 EDT
Oh Andrew, you would also have to commit your change to PDE Build for 3.4.2
Comment 30 Chris Aniszczyk CLA 2008-09-05 11:12:05 EDT
*** Bug 240084 has been marked as a duplicate of this bug. ***
Comment 31 Chris Aniszczyk CLA 2008-09-08 17:06:34 EDT
committed change to HEAD for 3.5M2 I-build
Comment 32 Jeff McAffer CLA 2008-09-09 13:13:53 EDT
should this be marked as 3.4.2 now since the bug 246391 has been deferred?

Assuming it is for 3.4.2 I approve.
Comment 33 Chris Aniszczyk CLA 2008-10-02 17:35:30 EDT
done.

> 20091002