Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Weird error when using p2-installable-unit

>> I started trying to use:
>> 
>> <dependency>
>>   <type>p2-installable-unit</type>
>>   <artifactId>org.eclipse.jdt.launching.macosx</artifactId>
>>    <version>0.0.0</version>
>> </dependency>
>> 
>> But this give me this really weird error:
>> 
>> [ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.13.0:test (default-test) on project org.jboss.tools.ws.jaxrs.core.test: Execution default-test of goal org.eclipse.tycho:tycho-surefire-plugin:0.13.0:test failed: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from extra-1322304115336 0.0.0.1322304115336 to org.eclipse.jdt.launching.macosx 0.0.0.", "Unable to satisfy dependency from 1322304115347 0.0.0.1322304115347 to org.eclipse.jdt.launching.macosx 0.0.0.", "No solution found because the problem is unsatisfiable."] ->  [Help 1]
>> 
>> I don't see anywhere where that "extra-1322304115336"  is coming from ?
>> 
> 
> What environment(s) do you run the tests on? Did you put
> o.e.jdt.launching.macosx test dependency in OSX-specific profile, like
> we did for m2e tests [1]?
> 
> [1] https://github.com/sonatype/m2e-core-tests/blob/master/pom.xml

Not yet - right now i'm just trying to run it on OSX - once I get it working I'll move it out to a profile.

>> If I use:
>> 
>> <dependency>
>>   <type>eclipse-fragment</type>
>>   <artifactId>org.eclipse.jdt.launching.macosx</artifactId>
>>    <version>0.0.0</version>
>> </dependency>
>> 
>> It loads and the bundle is visible at runtime but i'm still getting test failures.
>> 
>> Thus three questions:
>> 
>> 1) Why is Tycho complaining with that error ? it also seem to happen when I just add it to even basic tests with no extra dependencies.
>> …or at least any tip on debugging where it is finding extra-* references?
> 
> extra-* is an internal installable unit tycho generates to represent
> <dependency/> elements. Just ignore it.

Yeah, I figured this out eventually when I noticed the number kept changing and then realized its java/unix timestamp.

One suggestion: Name that "extra-<timestamp>" something with tycho so one actually know that ? :)

diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java b/tycho-bundle
index 7ae582e..6484c13 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/impl/resolver/ProjectorResolutionStrategy.java
@@ -195,7 +195,7 @@ public class ProjectorResolutionStrategy extends ResolutionStrategy {
         if (!additionalRequirements.isEmpty()) {
             InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription();
             String time = Long.toString(System.currentTimeMillis());
-            iud.setId("extra-" + time);
+            iud.setId("tycho-extra-" + time);
             iud.setVersion(Version.createOSGi(0, 0, 0, time));
             iud.setRequirements(additionalRequirements.toArray(new IRequiredCapability[additionalRequirements.size()]));

(nontested patch ;)

>> 
>> 2) Any tips on tracking down which optional dependencies that are magically missing ? (eclipse got about 71 plugins marked as optional so its like looking for a needle in a haystack)
>> 
>> 3) Is there any way for a test run to enable "get all the optional dependencies" so it simulates what happens in PDE when launching with "all optional" ? At least so I can verify it actually works
>> in Tycho too when "everything" is installed ?
> 
> Not possible now, but in 0.14 there will be resolver flag that will let
> you choose between forcing all optional dependencies as required or
> ignoring them altogether (in the latter case it will still be possible
> to add specific dependencies back).
> 
> This support is currently implemented on 351842_optionalDependencies
> branch, waiting for my p2 patches to be reviewed and applied.
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=351842

Ok - cool.

But after digging some more it seem to be my target platform have "more" in it than I would like, i.e. currently i'm now getting:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.13.0:test (default-test) on project org.jboss.tools.ws.jaxrs.core.test: Execution default-test of goal org.eclipse.tycho:tycho-surefire-plugin:0.13.0:test failed: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from extra-1322486420857 0.0.0.1322486420857 to bundle org.eclipse.jdt.launching.macosx 0.0.0.", "Unable to satisfy dependency from org.eclipse.jdt.core 3.7.1.v_OTDT_r201_201109101025 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from 1322486420872 0.0.0.1322486420872 to bundle org.eclipse.jdt.launching.macosx 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]


So I somehow got org.eclipse.objectteams.otdt.* into the target platform - which is really weird.

What could help me is someway to actually see the list of bundles that are *in* the target platform after Tycho done its resolution stuff.

Is there available somewhere ? -X does not seem to print it out.

And I can't spot anything in target/work/* directory.

Is that information stored somewhere?

/max
http://about.me/maxandersen





Back to the top