Bug 188746 - PlatformConfiguration doesn't properly support other config locations
Summary: PlatformConfiguration doesn't properly support other config locations
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-Update-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 124539 175076
  Show dependency tree
 
Reported: 2007-05-23 15:40 EDT by Chris Aniszczyk CLA
Modified: 2008-06-19 14:54 EDT (History)
8 users (show)

See Also:
wassim.melhem: review+
pascal: review-
dj.houghton: review-


Attachments
org.eclipse.update.configurator.patch (5.05 KB, patch)
2007-05-23 15:40 EDT, Chris Aniszczyk CLA
no flags Details | Diff
org.eclipse.update.configurator.patch (9.66 KB, patch)
2007-06-01 21:22 EDT, Chris Aniszczyk CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-05-23 15:40:12 EDT
The platform configuration has issues when working with other config locations. An example is running a host Eclipse instance (say 3.3RC1) and then loading a config of a target location (3.3M7). What happens is that the code around the configuration makes a lot of assumptions when dealing with 'platform:/' type URLs. It always queries for the current configuration which always happens to be the one of the host, and not the target. This causes bundles not to be properly resolved for clients of this class like PDE. 

The solution here is ensuring the resolvedURL of site entries is the URL of whatever platform configuration we are truly interested in, not the "current" one. 

From the PDE point of view, this blocks a fairly major bug in my opinion. We have done thorough testing on our end to make sure this change doesn't have any negative impact.
Comment 1 Chris Aniszczyk CLA 2007-05-23 15:40:50 EDT
Created attachment 68433 [details]
org.eclipse.update.configurator.patch

Here is a patch that solves the problem.
Comment 2 Dejan Glozic CLA 2007-05-24 12:06:00 EDT
Chris, this patch is 'The Blair Witch Project' scary. It modifies some of the most sensitive classes known to (Update) men. How certain you are that we are not going to break many of the Update scenarios this late in the cycle? Did you rerun the Update JUnit tests?

DJ, Pascal, do you see what I see?
Comment 3 DJ Houghton CLA 2007-05-24 13:52:26 EDT
I agree with Dejan. We don't like changes in the update.configurator. And generally code which looks like this:
	File root = file.getParentFile().getParentFile().getParentFile();
I find a bit scary...
Comment 4 Dejan Glozic CLA 2007-05-24 13:53:19 EDT
Upon further examination, all other changes seem reasonable exept that section:

-					URL rURL = PlatformConfiguration.resolvePlatformURL(pURL);
-					String resolvedURL = rURL.toExternalForm();
+					File file = new File(this.url.getFile());
+					File root = file.getParentFile().getParentFile().getParentFile();
+					String resolvedURL = root.toURL().toExternalForm();
Comment 5 Wassim Melhem CLA 2007-05-24 13:57:10 EDT
The line that Dejan points out in comment 4 needs an explanation certainly.

However, I don't think a general 'We don't like changes to update.configurator' attitude is helpful here.

This problem needs to be fixed either now, or in 3.3.1 (when the "happiness" hits the fan), as it poses a big problem for PDE, now that it supports multiple version of the same plug-in.
Comment 6 Dejan Glozic CLA 2007-05-24 14:00:18 EDT
Wassim, are the code paths in this patch hit only during self-hosting or during regular Update use as well? My concern is mostly around Update scenarios being broken after this.
Comment 7 Wassim Melhem CLA 2007-05-24 14:13:35 EDT
I am not sure as I did not write the patch.

I do prefer if we have a solution that resulted in code only be executed by the PDE path.  

Unfortunately, Chris is not available at this time to comment.
Comment 8 Dejan Glozic CLA 2007-05-24 14:28:08 EDT
I am in favor of ensuring that this problem is fixed in 3.3. However, I would like to see more assurance that we can isolate any potential regression to the PDE scenario only and do some more testing.
Comment 9 DJ Houghton CLA 2007-05-24 14:54:35 EDT
Is this bug a duplicate of 156760, bug 141887 or bug 102190? All 4 of these bugs seem the same. 
Comment 10 Chris Aniszczyk CLA 2007-05-25 10:18:47 EDT
(In reply to comment #2)
>
lol Dejan, I thought it was just "Texas Chainsaw Massacre" scary :)

As DJ pointed out, this possibly looks like a dupe to the other bugs. DJ has an interesting patch in bug 141887, however, it looks "Hostel" scary :) DJ, was this a complete solution to the problem. Is it worth to investigate this for 3.3 inclusion, it's a fairly serious issue.

After talking to Wassim, I'm going to try to make a patch PDE is only interested and as less disruptive as possible. DJs patch in bug 156760 may help that.
Comment 11 Pascal Rapicault CLA 2007-05-25 11:31:12 EDT
The patch for bug #156760 has been applied in 3.2.1 and it allows for the platform.xml to be properly read since PDE can now discover features mentioned in platform.xml, which means that somewhere the IPlatformConfiguration object has been created. Therefore I don't understand how an additional fix in update configurator will help solving bug #124539 since in the PluginPathFinder or pde.core you already get the PlatformConfig object.
Comment 12 Chris Aniszczyk CLA 2007-06-01 21:22:50 EDT
Created attachment 69834 [details]
org.eclipse.update.configurator.patch

updated patch to be more careful about things and only include a PDE path.

In PDE, we feel this is safe for a major problem in PDE.
Comment 13 Chris Aniszczyk CLA 2007-06-01 21:23:47 EDT
oh btw Dejan, I hear you're a big fan of the phrase, "here is your damn patch"
Comment 14 Chris Aniszczyk CLA 2007-06-01 21:24:30 EDT
(In reply to comment #11)

Update configurator is still broken in regards to if you're working in self-hosting mode.
Comment 15 Chris Aniszczyk CLA 2007-06-01 21:39:38 EDT
comment 13 was in honor of Mik
Comment 16 Dejan Glozic CLA 2007-06-03 07:18:08 EDT
(In reply to comment #13)
> oh btw Dejan, I hear you're a big fan of the phrase, "here is your damn patch"

The full phrase must be preceeded with a few whiney 'Where is my patch, where is my patch', to which you add the zinger from above :-).
Comment 17 Dejan Glozic CLA 2007-06-03 07:19:20 EDT
Scheduling for RC4, reviewers to follow.
Comment 18 Chris Aniszczyk CLA 2007-06-05 09:19:01 EDT
Dejan, don't forget this one :)
Comment 19 Chris Aniszczyk CLA 2007-06-05 09:19:42 EDT
In PDE, we never forget ;)
Comment 20 Dejan Glozic CLA 2007-06-05 10:00:45 EDT
OK, at this point we have one component lead vote (Wassim) - soliciting two peer committer votes (John and Pascal).

The final incarnation of the patch makes me feel better because it is clear that these paths are less traveled (for a reason :-) - only when invoked by PDE.
Comment 21 John Arthorne CLA 2007-06-05 11:27:46 EDT
I don't think I'm the right person to review this patch. I know almost nothing about update configurator, so I can't gauge the risk/reward of this fix.  My gut says to defer this to 3.3.1 - we're a couple of days from the final planned 3.3 build, which leaves zero margin of error if this fix isn't perfect. Maybe DJ will give you a +1.
Comment 22 Dejan Glozic CLA 2007-06-05 11:44:03 EDT
This fix is part of a larger bug fix in PDE for which the PDE team feels very strongly, otherwise I would defer myself.
Comment 23 Pascal Rapicault CLA 2007-06-05 13:51:05 EDT
Could an answer be given to the question in comment #11?
Comment 24 Dejan Glozic CLA 2007-06-05 13:57:10 EDT
Pascal, I think it has been in the comment 14. I think that it fails to cover the self-hosting scenario (when Eclipse is launched by PDE as opposed to using the standard launcher).
Comment 25 Pascal Rapicault CLA 2007-06-05 16:12:09 EDT
As a stupid test, I have compiled update configurator and installed it on top of a brand new I20070605-0010 and I can't start eclipse. This is an obvious -1.
Comment 26 DJ Houghton CLA 2007-06-05 16:13:38 EDT
Agreed.
Comment 27 Chris Aniszczyk CLA 2007-06-06 03:08:44 EDT
Since there are issues still, will target to 3.3.1 and investigate remaining issues.
Comment 28 Pascal Rapicault CLA 2007-06-06 09:28:32 EDT
As you are preparing the patch, DJ and I strongly encourage you to look at the patches from the bugs mentioned in comment #9.
Comment 29 Dejan Glozic CLA 2007-06-06 10:58:47 EDT
OK, one less to worry about.

See, when I get scared it is not without reason :-).
Comment 30 Brian Bauman CLA 2007-08-21 10:56:34 EDT
I just wanted to follow up and see if getting this patch into 3.3.1 is still in the cards.
Comment 31 Dejan Glozic CLA 2007-09-05 11:14:36 EDT
Apparently not - the original concerns were not yet addressed (see above).
Comment 32 Brian Bauman CLA 2007-09-05 17:00:21 EDT
We were able to fix the patch to work in that specific case.  But this fix seems to be more of a band aid to fix a deep cut.  Instead, we would like to see if we can get bug 141887 fixed (equivalent to stitches).

The bugs this would fix for PDE in 3.3.1 are not must fix.  Therefore, Chris and I both agree it would be best to fix this once and for all the right way in 3.4 instead of applying this patch to fix certain cases.

It is our hope we can go back and clean up the 141887 patch since we are still very early in the 3.4 development cycle.  I will also need go to out and rent "Hostile" so I can understand just how scary the patch is :)
Comment 33 Mike Wilson CLA 2008-04-10 14:52:32 EDT
Given that bug 141887 is now marked fixed, can this bug be closed?
Comment 34 Mike Wilson CLA 2008-06-19 14:54:11 EDT
In the absence of further comments from the reporters, I guess the answer is yes. Closing as WONTFIX since 141877 was the bug that was actually fixed.