Bug 249133 - [shared] Default update site list blank in shared install
Summary: [shared] Default update site list blank in shared install
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P3 normal with 12 votes (vote)
Target Milestone: Kepler   Edit
Assignee: Pascal Rapicault CLA
QA Contact:
URL: http://dev.eclipse.org/mhonarc/lists/...
Whiteboard:
Keywords: helpwanted, polish
: 267926 282740 288021 288688 298708 325463 327955 (view as bug list)
Depends on:
Blocks: 358471
  Show dependency tree
 
Reported: 2008-09-30 11:33 EDT by James Le Cuirot CLA
Modified: 2013-05-09 14:27 EDT (History)
41 users (show)

See Also:


Attachments
Fix proposition (11.50 KB, patch)
2012-05-11 06:41 EDT, Krzysztof Daniel CLA
no flags Details | Diff
mylyn/context/zip (334.65 KB, application/octet-stream)
2012-05-11 06:41 EDT, Krzysztof Daniel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot CLA 2008-09-30 11:33:11 EDT
When running from a shared install, the list of update sites available in the update manager is blank. This does not happen when not running from a shared install. Setting osgi.configuration.cascaded to true has no effect.
Comment 1 Andrew Overholt CLA 2008-09-30 11:58:28 EDT
You mean read-only vs. non-read-only shared installs, right?
Comment 2 James Le Cuirot CLA 2008-09-30 12:05:30 EDT
Yes. Sorry, I'm not familiar with all the supported kinds of installs.
Comment 3 Simon Kaegi CLA 2008-09-30 12:12:08 EDT
The set of repos are stored in preferences which are "not" cascaded in a shared install. This is a known limitation however it's not clear that we would always want to cascade the values from the parent.
Comment 4 James Le Cuirot CLA 2008-09-30 12:20:27 EDT
Trying osgi.configuration.cascaded was just an idea I had. I think cascading may be the ideal solution because if the list is merely copied for new users and that user subsequently updates to a later version of Eclipse, they will still have the old update site instead of the new one.
Comment 5 Andrew Overholt CLA 2008-10-03 10:49:39 EDT
Hi Simon,,

Could we work around this particular issue in Linux distributions somehow?

Thanks,

Andrew
Comment 6 Simon Kaegi CLA 2008-10-03 12:07:47 EDT
Hmm... have we never had a situation where we want to share a set of initial preferences. It's a more general issue so I'd be hesitant to do something custom here.
Comment 7 Andrew Overholt CLA 2008-10-03 12:27:37 EDT
(In reply to comment #6)
> Hmm... have we never had a situation where we want to share a set of initial
> preferences. It's a more general issue so I'd be hesitant to do something
> custom here.

Okay, I'd rather not diverge so we'll have to just tell users how to add repos themselves.  Thanks for the info.
Comment 8 James Le Cuirot CLA 2009-03-21 19:15:02 EDT
This problem is still preventing a P2-enabled version of Eclipse from being officially included in Gentoo. Any news on it? How are the other distros handling this?
Comment 9 Andrew Overholt CLA 2009-03-21 22:14:55 EDT
(In reply to comment #8)
> How are the other distros handling this?

We just suck it up.  It's not the end of the world IMO.
Comment 10 John Arthorne CLA 2009-07-10 17:04:19 EDT
*** Bug 267926 has been marked as a duplicate of this bug. ***
Comment 11 John Arthorne CLA 2009-07-10 17:06:08 EDT
*** Bug 282740 has been marked as a duplicate of this bug. ***
Comment 12 Pascal Rapicault CLA 2009-08-28 22:04:14 EDT
*** Bug 288021 has been marked as a duplicate of this bug. ***
Comment 13 Remy Suen CLA 2009-09-04 19:52:35 EDT
*** Bug 288688 has been marked as a duplicate of this bug. ***
Comment 14 Gergely Nagy CLA 2009-09-05 11:16:56 EDT
(In reply to comment #5)
> Could we work around this particular issue in Linux distributions somehow?

Before P2, I used to copy the default /usr/local/eclipse/configuration dir to ~/.eclipse manually(or by a script), 
and pass it in by '-configuration'. This worked, as far as I remember.

Would this still be the only workaround?
Comment 15 James Le Cuirot CLA 2009-09-05 11:35:39 EDT
I had considered copying via a script but the default configuration directory is always suffixed with a code that is generated in quite a complex way within the Java source. I didn't know about the -configuration option though so maybe that would work.
Comment 16 Remy Suen CLA 2010-01-04 11:24:41 EST
*** Bug 298708 has been marked as a duplicate of this bug. ***
Comment 17 Remy Suen CLA 2010-03-13 21:30:53 EST
We continue to get regular traffic on IRC about this. Please consider addressing this for 3.6 (probably too late for that) or 3.7.
Comment 18 Andrew Overholt CLA 2010-03-15 09:40:24 EDT
Niels Thykier, a Debian Eclipse maintainer, suggested a wrapper script for /usr/bin/eclipse that sets this up in the user's configuration area if it's not already set up.
Comment 19 Pascal Rapicault CLA 2010-09-18 20:52:30 EDT
*** Bug 325463 has been marked as a duplicate of this bug. ***
Comment 20 Dani Megert CLA 2010-10-16 04:49:12 EDT
Definitely not JDT related.
Comment 21 Chris Aniszczyk CLA 2011-04-14 12:03:41 EDT
Ian, any thoughts on this one?

This is a bit of a PITA for us.
Comment 22 Thomas Watson CLA 2011-06-08 11:30:27 EDT
Move all 3.8 bugs to Juno.
Comment 23 Pascal Rapicault CLA 2011-06-12 00:04:55 EDT
*** Bug 327955 has been marked as a duplicate of this bug. ***
Comment 24 Gergely Nagy CLA 2011-06-24 17:23:10 EDT
(In reply to comment #17)
> We continue to get regular traffic on IRC about this. Please consider
> addressing this for 3.6 (probably too late for that) or 3.7.
Not there in 3.7.
Any chance for 3.7.2? :) 

Until then, can/do we have an official list of update sites, somewhere visible on eclipse.org near downloads?  Even better, an importable 'bookmarks.xml' would be a great painkiller for this.

The most useful source so far has been Ekke's blog: http://ekkescorner.wordpress.com/eclipse/update-sites, but there is no guarantee it will be always updated (it doesn't seem and not easy to find either).

BTW, just out of curiousity: is this a difficult bug to fix?  

BTW2, I agree with those annoyed by it; to me it means Un*x is not a first class platform (if installed in the normal way).. "we just suck it up" - would windows users suck it up to?
Comment 25 Pascal Rapicault CLA 2011-06-24 21:54:59 EDT
I'm sorry that this did not get fixed, but we have all been busy on other aspects of p2 and working on commercial products (not related to p2) for our respective employers... and you are right I'm not using linux so it is not an itch to scratch.

Code wise it is probably not very hard, but there is few details to get right. The key piece of code where the list of repositories are being stored and restored are AbstractRepositoryManager#restoreRepositories and saveToPreferences in bundle org.eclipse.equinox.p2.repository.

The most forward way to fix this is probably to change the loading code to find repositories in the shared install, add them to the list of repos, but not persist them in the local list.

Looking forward for a contribution.
Comment 26 Martin Oberhuber CLA 2011-06-28 11:06:42 EDT
Launching 
    eclipse -configuration foo
also shows an empty list of pre-configured repositories, so this might be the simplest test case.
Comment 27 JPV CLA 2011-07-09 04:18:14 EDT
Same problem with Indigo on Windows x64, non shared install.
Comment 28 Daniel Sokolowski CLA 2011-09-21 09:13:52 EDT
Same issue here with Eclipse 4.2M2 64bit, on a Windows 7 64bit machine when eclipse is installed into the 'Program Files' folder. 

A work around to get the initial software sites list loaded:

1. Temporarily copy the eclipse folder to your desktop.
2. Run eclipse from this temporary folder and open 'Help' > 'Install New Software' area.
3. Click on 'Available Software Sites', select all entries and export the list.
4. Run you eclipse installed in 'Program Files' folder, go to 'Available Software Sites' area again and import.
5. Delete your temporary eclipse.

Or see http://wiki.eclipse.org/IRC_FAQ#How_come_my_list_of_update_sites_is_completely_empty_when_other_people_says_theirs_has_stuff_in_it.3F
Comment 29 Martin Oberhuber CLA 2012-01-10 04:11:13 EST
CQ:WIND00326634

This is an important issue to look at.

With an empty list of repos, people easily try installing software from an incorrect repository. This leads to very awkward error messages that don't help understanding what's going wrong.

In our case, our product is based on Indigo but people tried getting JDT from Helios. They probably read some instructions asking to get JDT from Helios or probably didn't know that our product is now on Indigo. Result was Eclipse complaining about conflicting dependencies of pde.runtime ... not helpful at all.

I think it's really important getting a proper list of repos preconfigured even in the shared install case. The data should exist in the master configuration, so why can't eclipse initialize the local config area properly ?
Comment 30 Martin Oberhuber CLA 2012-01-10 04:13:51 EST
(In reply to comment #3)
> The set of repos are stored in preferences which are "not" cascaded

Are these "normal" Preferences which we could initialize in our product with a
plugin_customization.ini file ? Then this would be an acceptable workaround for
us as product builders.
Comment 31 DJ Houghton CLA 2012-01-10 16:23:13 EST
(In reply to comment #30)
> Are these "normal" Preferences which we could initialize in our product with a
> plugin_customization.ini file ? Then this would be an acceptable workaround for
> us as product builders.

Unfortunately the plugin_customization mechanism is only used to initialize defaults whereas these preferences are actually stored in the real location. (in the "profile" scope)  The equivalent to set them from a file would be to do a preference import but we don't offer that ability from the command-line.
Comment 32 Erik Purins CLA 2012-02-29 16:38:08 EST
On windows x64 with UAC enabled and eclipse in the "C:\program files" directory, experienced this. Followed the workaround from comment 28 (move eclipse folder to a non-UAC directory and exported/imported the bookmark list).

Was expecting the software to find this in (or save this information to) a user profile directory or other uncontrolled folder (app data or home dir).

This works fine for me when UAC is disabled.

Me-too the comments about being confused and manually entering the wrong update site by hand (which was what I was doing before I found this bug).
Comment 33 Krzysztof Daniel CLA 2012-05-10 10:06:48 EDT
Where exactly are those preferences stored?
Comment 34 Krzysztof Daniel CLA 2012-05-10 10:35:50 EDT
Just theorizing:
ProfileScope depends on a profile, and updates sites are stored next to profile
data in .data folder. In a shared configuration profile depends on a parent
profile, but preferences are stored only next to parent profile, while
ProfileScope looks for them next to user profile (f.e. in
~/.eclipse/someuniquepath/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile/.data/.settings).

I think that each profile has a reference to a parent profile. Maybe getting location of a parent profile and reading preferences that are next to it will not be that hard.
Comment 35 Krzysztof Daniel CLA 2012-05-11 06:41:03 EDT
Created attachment 215461 [details]
Fix proposition
Comment 36 Krzysztof Daniel CLA 2012-05-11 06:41:08 EDT
Created attachment 215462 [details]
mylyn/context/zip
Comment 37 Krzysztof Daniel CLA 2012-05-11 08:00:53 EDT
Pascal,

I'd appretiate if you could review the patch, even if it is not going into Juno, because Fedora is ready to ship it anyway :-).
Comment 38 Martin Oberhuber CLA 2012-05-25 06:26:21 EDT
CQ:WIND00327834

This issue continues bugging us, since shared installs are rather common and having no update sites at all (or invalid ones contributed from feature.xml files) is a bad problem. It happens just too easily that somebody either doesn't find an addon to install, or installs a wrong version from an invalid repo !

I filed bug 380633 asking the Platform to fix their outdated feature.xml files but that would still not get proper sites enabled.

Given that a patch is attached here, could that patch please be reviewed by a knowledgeable person ?
Comment 39 Ian Bull CLA 2012-06-29 12:40:47 EDT
This was not done for Juno. I'll put this on kepler since we have a patch.
Comment 40 Krzysztof Daniel CLA 2012-08-13 08:53:41 EDT
Any chance for review? It's good time now, as there will be plenty of time to revert it...
Comment 41 Pascal Rapicault CLA 2012-09-10 10:40:56 EDT
Hi Krzysztof, is there a particular reason why you chose to approach this by registering an additional service rather than directly changing the actual preference loading code?
Comment 42 Krzysztof Daniel CLA 2012-09-14 08:14:05 EDT
It's hard to say now :-( - I probably wanted to avoid any changes in the API, as I hoped to get this patch into Juno. Changing ProfileScope to support two locations (readonly master and  writable local) requires changes in AbstractScope interface (imo), and probably somewhere else.

The solution with service is a rather simple one...
Comment 43 Pascal Rapicault CLA 2012-09-14 09:05:55 EDT
Pragmatism works :)
Based on your contrib, I'll take this work from here to completion.
Comment 44 Pascal Rapicault CLA 2012-11-19 13:26:44 EST
A patch for this has been released. It will be available in the next I build.
Comment 45 Michael Osipov CLA 2013-03-23 13:37:02 EDT
This bug is far away from being fixed. I have installed 4.2.2 today and changed my config.ini with

> osgi.configuration.area=@user.home/.eclipse

A newly created workspace does not contain any update site. In other words, site list is all empty.
Comment 46 Pascal Rapicault CLA 2013-03-23 14:21:01 EDT
This bug has *not* been fixed for juno (which is 4.2.2) but only for kepler
Comment 47 Michael Osipov CLA 2013-03-23 14:27:11 EDT
(In reply to comment #46)
> This bug has *not* been fixed for juno (which is 4.2.2) but only for kepler

Thanks for this update. Can this be verified in the current 4.3 milestone?
Comment 48 Pascal Rapicault CLA 2013-03-23 14:30:31 EDT
(In reply to comment #47)
> (In reply to comment #46)
> > This bug has *not* been fixed for juno (which is 4.2.2) but only for kepler
> 
> Thanks for this update. Can this be verified in the current 4.3 milestone?

Yes, this has been in since 4.3 M4 (iirc) but I encourage you to try out 4.3 M6 (http://download.eclipse.org/eclipse/downloads/drops4/S-4.3M6-201303141330/) which also includes support to assist with the migration of plugins (http://www.rapicorp.com/2013/03/shared-installs-just-got-better.html).
Comment 49 Michael Osipov CLA 2013-03-24 11:04:00 EDT
(In reply to comment #48)
> (In reply to comment #47)
> > (In reply to comment #46)
> > > This bug has *not* been fixed for juno (which is 4.2.2) but only for kepler
> > 
> > Thanks for this update. Can this be verified in the current 4.3 milestone?
> 
> Yes, this has been in since 4.3 M4 (iirc) but I encourage you to try out 4.3
> M6
> (http://download.eclipse.org/eclipse/downloads/drops4/S-4.3M6-201303141330/)
> which also includes support to assist with the migration of plugins
> (http://www.rapicorp.com/2013/03/shared-installs-just-got-better.html).

Pascal,

verified. Default two update site are available now!
Comment 50 Martin Oberhuber CLA 2013-04-04 04:57:41 EDT
Could this fix be backported to Juno SR2+ for LTS ?

For product builders it's really a massive problem that my product's update sites are not enabled by default when my product is installed into a read-only location or into C:\Program Files .

Shall I just file a new bug for tracking the backport ?
Comment 51 Pascal Rapicault CLA 2013-04-04 10:05:35 EDT
(In reply to comment #50)
> Could this fix be backported to Juno SR2+ for LTS ?
> 
> For product builders it's really a massive problem that my product's update
> sites are not enabled by default when my product is installed into a
> read-only location or into C:\Program Files .
> 
> Shall I just file a new bug for tracking the backport ?

  From an LTS point of view, the process to follow to get this fixed in Juno is unclear. LTS has the concept of "maintenance committers" who gets paid by an LTS member company to do the work, however the process to get this started is unclear.

All I know is that at this point Ericsson has no plan to backport this bug.
Comment 52 Martin Oberhuber CLA 2013-04-04 17:50:27 EDT
If I did the backport and provided it as a patch / pullrequest / Gerrit , would it be considered for checkin to the Juno maintenance branch ?

Which contribution form do the p2 committers prefer ?
Comment 53 Pascal Rapicault CLA 2013-04-05 00:20:07 EDT
Then I can commit the patch but w/o guarantees :) 
Yet it is unclear how the LTS git repo would obtain this patch.
Comment 54 John Arthorne CLA 2013-05-09 14:27:46 EDT
(In reply to comment #53)
> Then I can commit the patch but w/o guarantees :) 
> Yet it is unclear how the LTS git repo would obtain this patch.

The public Juno maintenance branch is no longer being used for builds. There is nothing further for you to do here Pascal. If a maintenance committer wants this fix, they can cherry-pick it into the appropriate LTS branch and run their private build.