Bug 97165 - workspace site ends up having same URL as install site
Summary: workspace site ends up having same URL as install site
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-30 03:09 EDT by Rafael Chaves CLA
Modified: 2005-06-06 00:29 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA 2005-05-30 03:09:37 EDT
At least since m6

(not sure whether this is PDE or Update)

Update keeps sites in a dictionary keyed by URL.toExternalForm(). The site entry
for the workspace as created by PDE is the path to the workspace parent dir in
the form of a URL (having the drive letter as lowercase).

If the workspace is immediately under the install (e.g. c:\eclipse\workspace),
the site entry for the workspace will be file:/c:/eclipse/ while the site for
the install will be file:/C:/eclipse/ (note the drive letter is capitalized).

This causes a few problems:
a) the workspace site ends up having the same features as in the install (didn't
notice any bad effects)
b) now that locations are stored as relative URLs, the difference between the
URLs disappears, bringing confusion to Update (the second site to be processed
is basically ignored, since Update believes it has already been installed) - see
bug 97148.
Comment 1 Rafael Chaves CLA 2005-05-30 03:57:40 EDT
However, I am surprised that this did not cause problems on other platforms. For
instance, on Linux, if what I am saying above is true, it should be impossible
to self host if the user has the workspace under the install. I guess I am
missing some detail.
Comment 2 Wassim Melhem CLA 2005-05-30 07:48:09 EDT
Dorian, is b. an issue?  Having a workspace under the install has always been 
supported for self-hosting and never caused problems.
Comment 3 Jeff McAffer CLA 2005-05-30 09:43:19 EDT
if I understand comment 2, having the workspace under the install has long 
been the standard and has not been problematic in any way.
Comment 4 Rafael Chaves CLA 2005-05-30 10:09:52 EDT
More details on this: PDE won't add two sites for the same exact URL string
(case sensitive), so this does not cause problems when creating the
configuration. If the plug-in in the workspace and target have the same site URL
string, PDE will create a single site. If they differ in case, because
Platform.getInstallURL uses File.toURL() and PDE (LocalSite.getURL()) uses "new
URL("file:" + path.addTrailingSeparator().toString())", they will end up being
configured as different sites.

b) since now we store paths as locations relative to the install, when we read
them back, we use the same base URL to make them absolute, so the differences
disappear.

Wassim, I think Dorian won't be available today. But it is easy to verify that
sites are supposed to use different URLs by looking at
PlatformConfiguration#configureSite(ISiteEntry).
Comment 5 Rafael Chaves CLA 2005-05-31 15:42:16 EDT
See also bug 97388.
Comment 6 Rafael Chaves CLA 2005-06-01 11:12:09 EDT
Wassim, this has already been dealt with at Update level - see bug 97388. But
the fix in Update requires PDE to take the same care when comparing paths,
otherwise bad things will happen again. The affected code seems to be restricted
to org.eclipse.pde.internal.core.TargetPlatform.addToSite() - the path
comparison should ignore the case for the drive letter on Windows.
Comment 7 Wassim Melhem CLA 2005-06-01 11:17:20 EDT
I wish this device issue would get resolved at the Core level once and for all 
(bug 49516) and not have us do all these checks.
Comment 8 Wassim Melhem CLA 2005-06-02 11:13:13 EDT
DJ, before I add yet another workaround, is the filibuster still in effect for 
bug 49516?
Comment 9 Dejan Glozic CLA 2005-06-02 11:16:04 EDT
+1 for this defect - it is a bit embarrasing that we treat d:\foo\bar and 
D:\foo\bar as two different paths - long overdue to fix it.
Comment 10 DJ Houghton CLA 2005-06-02 12:48:47 EDT
Bug 49516 won't be resolved for 3.1.
Comment 11 Wassim Melhem CLA 2005-06-06 00:29:29 EDT
we now uppercase the device name if present, so that the IPath comparison 
doesn't fail.