Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265578 - director cannot find IU if more than one repo specified
Summary: director cannot find IU if more than one repo specified
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 264868
  Show dependency tree
 
Reported: 2009-02-19 20:05 EST by Paul Webster CLA
Modified: 2009-02-20 22:31 EST (History)
3 users (show)

See Also:


Attachments
content.xml (713.60 KB, text/plain)
2009-02-19 20:05 EST, Paul Webster CLA
no flags Details
Fix (3.77 KB, patch)
2009-02-20 13:32 EST, Ian Bull CLA
pascal: iplog+
Details | Diff
mylyn/context/zip (22.09 KB, application/octet-stream)
2009-02-20 13:32 EST, Ian Bull CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2009-02-19 20:05:40 EST
Created attachment 126244 [details]
content.xml

The director cannot find the IU for org.eclipse.e4.ui.tests.feature.feature.group in the repo.  When I run it I get the error from the log.

PW
Comment 1 Paul Webster CLA 2009-02-19 20:10:29 EST
Performing this operation through the Install UI on the very same installation works.

PW
Comment 2 Paul Webster CLA 2009-02-19 20:12:10 EST
A version of the repo can (hopefully) be found in bug 265577
PW
Comment 3 Paul Webster CLA 2009-02-20 09:23:07 EST
command line:
-nosplash --launcher.suppressErrors -consoleLog -flavor tooling -installIU org.eclipse.e4.ui.feature.feature.group -p2.os linux -p2.ws gtk -p2.arch x86 -profile SDKProfile -metadataRepository file:/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/I20090220-0807/I20090220-0807/repository,file:/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/targets/galileo-repo-m5-trans -artifactRepository file:/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/I20090220-0807/I20090220-0807/repository,file:/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/targets/galileo-repo-m5-trans -destination /shared/eclipse/e4/build/e4/downloads/drops/4.0.0/I20090220-0807/tests/eclipse-testing/test-eclipse/eclipse -bundlepool /shared/eclipse/e4/build/e4/downloads/drops/4.0.0/I20090220-0807/tests/eclipse-testing/test-eclipse/eclipse
-vmargs -Declipse.p2.data.area=/shared/eclipse/e4/build/e4/downloads/drops/4.0.0/I20090220-0807/tests/eclipse-testing/test-eclipse/eclipse/p2 -Declipse.p2.MD5Check=false
Comment 4 Paul Webster CLA 2009-02-20 09:28:18 EST
org.eclipse.equinox.internal.provisional.p2.query.CompoundQueryable.query(Query, Collector, IProgressMonitor) has this line in it:

results = queryables[i].query(query, results, subMonitor.newChild(10));

But in org.eclipse.equinox.internal.p2.director.app.Application.LocationQueryable, the collector is thrown away:
public Collector query(Query query, Collector collector, IProgressMonitor monitor) {
			return ProvisioningHelper.getInstallableUnits(location, query, monitor);
		}

So my IU is found in the first repo and then when the second repo is queried, the result is thrown away.

This works in the UI, BTW.

PW
Comment 5 Andrew Niefer CLA 2009-02-20 09:50:53 EST
The javadoc on Query#perform says
"The collector returned must be the collector passed in."

I think we are going to need to be explicit on whether or not this is required for IQueryable.query
Comment 6 Paul Webster CLA 2009-02-20 10:22:19 EST
workaround: make sure the IU you want to install is in the last repo

PW
Comment 7 Ian Bull CLA 2009-02-20 11:51:12 EST
I think the LocationQueryable should be changed to:

public Collector query(Query query, Collector collector, IProgressMonitor monitor) {
	return ProvisioningHelper.getInstallableUnits(location, query, collector, monitor);
}

(note the one that takes the collector).

I will test this and prepare a patch.
Comment 8 Ian Bull CLA 2009-02-20 13:32:49 EST
Created attachment 126329 [details]
Fix

Here is a fix. Note:  In the test case I use reflection to access a private method in the director application.
Comment 9 Ian Bull CLA 2009-02-20 13:32:59 EST
Created attachment 126330 [details]
mylyn/context/zip
Comment 10 Pascal Rapicault CLA 2009-02-20 22:30:54 EST
Fix released in HEAD.