-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve target definition when non-IU locations are used #874
Comments
I had a look at it and my initial approach was to simply add a new test case to LocalTargetDefinitionTests. Except that I'm almost certain that those aren't executed as part of the integration tests... In addition, those tests would also require a m2e installation, but I'm not sure if it's a good idea to have the dependency from pde to m2e, when m2e also has a dependency to pde. Any suggestions on what would be a good way to approach this? |
Usually a Here is an example:
|
Consider the following situation: The SimRel 2023-12 repository contains FasterXML Jackson bundles with version 2.16.0, with the exception of one bundle that is still in 2.15.3. In order to ensure that all those bundles have the same version, the one in 2.15.3 is also contributed via Maven Central (imitated by a local directory), also in 2.16.0. Trying to resolve this target definition fails with: No repository found containing: osgi.bundle, com.fasterxml.jackson.module.jackson-module-jaxb-annotations, 2.16.0 Meaning PDE knows that there is a newer version available, it just doesn't know where to find it... Note that one can work around this problem by explicitly adding the missing bundle to the IU location.
That did the trick. Thank you a lot! After trying to create a small reproducer, I ended up with #957. In short, I don't think this problem is exclusive to using an unbound |
sigh, I think I'm starting to understand why this doesn't work... Consider the following target-definition:
Which, as already mentioned, fails with the error The problem itself is created within the ArtifactRequest class, but more broadly during the planner resolution in line 1104: eclipse.pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java Lines 1101 to 1107 in 5a3eebe
At this state, the provisioning context looks like this: Repositories
Extra IUs
Which already implies why the resolution fails later on. The way the repositories are resolved is by iterating over all target locations and checking whether they implement IUBundleContainer or TargetReferenceBundleContainer. But the MavenTargetLocation (as well as the DirectoryBundleContainer) extends AbstractBundleContainer and is therefore neither of those. eclipse.pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java Lines 1402 to 1414 in 5a3eebe
This means that when the IUs from other target locations are added to the provisioning context, they are added without a location where they can be downloaded from. eclipse.pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java Lines 1081 to 1085 in 3f15a1e
That's also the reason why this problem doesn't show up when one uses a second p2 software site, because then both repositories are considered during the planner resolution.
|
The solution would therefore be to (a) Adapt the target locations to extend the classes described above |
@ptziegler Option (b) is how it is done for the units (metadata) already... |
Shouldn't then all of this simply work? 🤔 In the end, something clearly doesn't work correctly. And as a result, this error makes it pretty much impossible to checkout any of our project workspaces, for which we've created tags or release branches over the past few years. |
It works for the Metadata but not for the Artifact repository as artifact repository is (not yet) implemented. |
Where can I see what the metadata looks like? Regardless, I think the focus right now should be on salvaging the current situation. With the little understanding of the p2 artifact resolution I have, I assume the process works similar to this: (1) Get the non-IU-locations into the provision context Regarding (1), I would keep the non-IU locations separate from the IU locations, similar to how it's done with the IUs themselves. It probably makes sense to change the extraIUs from List<IInstallableUnit> to Map<URI, List<IInstallableUnit> or something similar. Regarding (2) , the factories are contributed via the following extension points:
The question is whether there's a way to define a proper "suffix" (like the artifact.xml) in order to identify what type of non-IU location we're dealing with. (3) should be easy enough to do within the provision context... |
Extension points wont work as they are global to the framework and not local to the target resolution, also a (static) extension can't know about any possible local target (that even maybe only exits in memory). Please also note that You can look at One probably want to create something like Tycho |
That was also one of the things I had in mind. My apologies for not being clear enough. |
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
…e#874 Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
Given that units from non-IU locations are considered when resolving IUs, it may happen that units are contained in the resolution path, which are not contained by any repository. This may break previously functional target definitions. To resolve this problem, an in-memory artifact and metadata repository is created, based on the metadata of the non-IU locations. Those repositories are then added to the provisioning context for further processing. Amends dd321b5
As a follow-up on #867 and based on the example in #675.
Using the nightly build, the following target-platform definition is able to resolve without problems (i.e. the p2 Guava bundle can use the Maven bundle to resolve its dependencies).
The following does not work (with FailureAccess 1.0.2 instead of 1.0.1):
Setting the Guava version doesn't help, either (with Guava 32.1.2.jre and FailureAccess 1.0.2):
What does work, however, is setting the version of FailureAccess to 1.0.1 first (assuming that the Guava version is fixed), resolve the target-platform definition, update the version to 1.0.2 and then resolve it again, all without closing the editor.
I'll try to squeeze those examples into a test case, when I find the time...
The text was updated successfully, but these errors were encountered: