Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 303936 - [planner] "Format error in file" during all installation of new features
Summary: [planner] "Format error in file" during all installation of new features
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.4.2+   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 200380 247638
Blocks:
  Show dependency tree
 
Reported: 2010-02-25 12:42 EST by DJ Houghton CLA
Modified: 2010-03-29 14:22 EDT (History)
5 users (show)

See Also:


Attachments
3.4_P2director_with_DependencyHelper (55.41 KB, patch)
2010-03-17 12:29 EDT, Natalia Bartol CLA
no flags Details | Diff
p2.director feature patch (333.08 KB, application/zip)
2010-03-22 05:45 EDT, Natalia Bartol CLA
no flags Details
3.4_P2director_with_DependencyHelper (improved) (55.62 KB, patch)
2010-03-24 05:27 EDT, Natalia Bartol CLA
john.arthorne: iplog+
Details | Diff
patch (50.37 KB, patch)
2010-03-25 11:09 EDT, DJ Houghton CLA
no flags Details | Diff
patch (50.27 KB, patch)
2010-03-25 16:50 EDT, DJ Houghton CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2010-02-25 12:42:27 EST
Cloned to track progress of backporting this fix to the 3.4.x maintenance branch.

+++ This bug was initially created as a clone of Bug #247638 +++

Currently whenever I try to install a new feature I get the following error in the Install dialog shown when an error is detected (picture attached).

Format error in file: C:\Users\Tonny\AppData\Local\Temp\p2Encoding49788.opb.

The problem seems to be related to the code in org.eclipse.equinox.internal.p2.director.Projector, but... this code is nearly impossible to debug :-(
Comment 1 DJ Houghton CLA 2010-03-12 11:15:29 EST
Pascal, did you mean to close this? Did you release code to fix this in the 3.4.x stream?
Re-opening. Please close again if you did make the necessary code changes or if the changes are a part of a fix for another bug which was already released.
Thanks.
Comment 2 Pascal Rapicault CLA 2010-03-12 17:03:35 EST
I thought we had addressed this and forgot to release it, but I did not pay attention to the date at which it had been opened.
Comment 3 Natalia Bartol CLA 2010-03-17 12:29:29 EDT
Created attachment 162317 [details]
3.4_P2director_with_DependencyHelper

Usage of DependencyHelper added to p2.director.Projector class. 

We need to use higher version of SAT4J, version 2.0.3 does not include DependencyHelper. I added the latest version 2.2.0 to the manifest.
Comment 4 John Arthorne CLA 2010-03-17 15:27:36 EDT
Natalia can you describe this patch? Did you copy the entire projector code from 3.6 stream, or is this a customized port of the 3.4.x code to use DependencyHelper? If copied from 3.6, what version is it based on - 3.6 M6, or something older?
Comment 5 Natalia Bartol CLA 2010-03-18 05:31:48 EDT
(In reply to comment #4)
> Natalia can you describe this patch? Did you copy the entire projector code
> from 3.6 stream, or is this a customized port of the 3.4.x code to use
> DependencyHelper? If copied from 3.6, what version is it based on - 3.6 M6, or
> something older?


I've tried to create patch with the smallest change needed to introduce DependencyHelper. It is based on Projector revision 1.24.2.17, but I use RequiredCapability instead of IRequiredCapability. Besides changes in Projector class I added Explanation class from 3_5 stream (replacing IRequiredCpability with RequiredCapability) and few messages to Messages class and messages.properties.
Comment 6 Pascal Rapicault CLA 2010-03-18 17:09:53 EDT
This is insane.
Comment 7 Natalia Bartol CLA 2010-03-19 06:12:03 EDT
(In reply to comment #6)
> This is insane.

Pascal, 

Is my approach totally incorrect? Could you give any hint how DependencyHelper should be backported to 3_4 stream?
Comment 8 Robert Erwin CLA 2010-03-19 20:19:06 EDT
Not to derail this bugzilla, but, Pascal/DJ/Anyone, I tried dropping the org.eclipse.equinox.internal.p2.director into the dropins/ folder of an unzipped eclipse classic but it does not get picked up. Why does that happen? Is there any way via dropins to get this plugin loaded?
Comment 9 Pascal Rapicault CLA 2010-03-19 22:22:58 EDT
The problem is that you are backporting some code that has some fundamental behavioural changes and putting in production something that has not even been used into a final release and put this back into a maintenance release.
Comment 10 Natalia Bartol CLA 2010-03-22 05:41:50 EDT
(In reply to comment #8)
> Not to derail this bugzilla, but, Pascal/DJ/Anyone, I tried dropping the
> org.eclipse.equinox.internal.p2.director into the dropins/ folder of an
> unzipped eclipse classic but it does not get picked up. Why does that happen?
> Is there any way via dropins to get this plugin loaded?

You need to create a feature patch for org.eclipse.equinox.p2.user.ui that includes org.eclipse.equinox.internal.p2.director. This works for me with dropins directory.
Comment 11 Natalia Bartol CLA 2010-03-22 05:45:33 EDT
Created attachment 162649 [details]
p2.director feature patch

Here is an example feature patch with sat4j 2.2.0 and p2.director with DependencyHelper.
Comment 12 Natalia Bartol CLA 2010-03-24 05:27:44 EDT
Created attachment 162851 [details]
3.4_P2director_with_DependencyHelper (improved)

I've prepared improved version of patch. I added code to optimization function
to put more weights on the installation of optional packages, as it is done in
3.5 - based on Daniel's comment:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=301446#c23

Test case Bug302582d passes with this patch and solver's timeout on conflicts increased from 1000 to 3000 (initially bug 301446).
Comment 13 DJ Houghton CLA 2010-03-25 11:09:02 EDT
Created attachment 162996 [details]
patch

Updated patch. This patch keeps the current code path by default. (although it does use the new version of SAT4J)

If the user sets the eclipse.p2.newProjector System property to true then we will use the projector class included in the previous patch.
Comment 14 DJ Houghton CLA 2010-03-25 16:50:00 EDT
Created attachment 163040 [details]
patch

Updated patch.
Comment 15 DJ Houghton CLA 2010-03-25 17:13:50 EDT
Committed latest patch to 3.4.x maintenance branch.
Also updated Orbit map file to fetch the new version of SAT4J.
Comment 16 John Arthorne CLA 2010-03-29 14:22:02 EDT
Comment on attachment 162851 [details]
3.4_P2director_with_DependencyHelper (improved)

Marking for iplog. This patch was incorporated into the patch that DJ eventually released.