eclipse-equinox / p2

Eclipse Public License 2.0
15 stars 41 forks source link

P2 is not supporting the effective directive properly #473

Open laeubi opened 9 months ago

laeubi commented 9 months ago

See this comment here:

https://github.com/eclipse-equinox/p2/blob/57ecc5a05ba4420f4983be2c27832fe139ab5d09/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java#L392

Currently P2 generates for example when using this manifest headers:

Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.compo
 nent)(version>=1.3.0)(!(version>=2.0.0)))",osgi.service;filter:="(obj
 ectClass=org.bndtools.headless.build.manager.api.HeadlessBuildPlugin)
 ";effective:=active;cardinality:=multiple,osgi.ee;filter:="(&(osgi.ee
 =JavaSE)(version=17))"

the following requirement: <requiredProperties namespace='osgi.service' match='(objectClass=org.bndtools.headless.build.manager.api.HeadlessBuildPlugin)' min='0'/>

this has some drawbacks so one can't choose for the effectiveness in a P2 resolve operation should apply or not.

I therefore would suggest that we transform this into something like filter="(osgi.effective.active=true)" so one can choose in the resolve context if such a requirement is to be considered or not.

chaitanyavalli-r commented 4 months ago

Do we have a fix for this? or any workaround to apply? We are also having the same constraint and the maven builds are failing. Please advise.

laeubi commented 4 months ago

I fear now one has worked on this until now, so the only option is to provide that dependency.

microwan commented 1 month ago

Same issue s [ERROR] Missing requirement: org.bndtools.headless.build.manager 7.0.0.202310060912 requires 'osgi.service; (objectClass=org.bndtools.headless.build.manager.api.HeadlessBuildPlugin)' but it could not be found [ERROR] Cannot satisfy dependency: com.st.stellar.ui.templates 1.1.0.qualifier depends on: osgi.bundle; org.eclipse.pde.ui 0.0.0 [ERROR] Cannot satisfy dependency: org.eclipse.pde.bnd.ui 1.1.100.v20240806-2133 depends on: java.package; org.bndtools.headless.build.manager.api [1.1.0,2.0.0) [ERROR] Cannot satisfy dependency: org.eclipse.pde.ui 3.15.300.v20240815-2201 depends on: osgi.bundle; org.eclipse.pde.bnd.ui 1.0.0: See log for details

merks commented 1 month ago

It's really hard to find the providers of these service registrations, but the do exist. These are all in the platform's target platform:

https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/c710615497e299557f76e4102fcfeaca26644e38/eclipse.platform.releng.prereqs.sdk/eclipse-sdk-prereqs.target#L571-L658

We don't know how you've defined your target platform. Try adding this:

https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/c710615497e299557f76e4102fcfeaca26644e38/eclipse.platform.releng.prereqs.sdk/eclipse-sdk-prereqs.target#L621-L626

You can also get them from here:

image

microwan commented 1 month ago

You are right i am on the target platform 2024-09 (eclipse official update site)

Build is OK in updating pom as below `

org.bndtools org.bndtools.versioncontrol.ignores.plugin.git 7.0.0 compile false
    <dependency>
        <groupId>org.bndtools</groupId>
        <artifactId>org.bndtools.headless.build.plugin.gradle</artifactId>
        <version>7.0.0</version>
        <scope>compile</scope>
        <optional>false</optional>
    </dependency>
</dependencies>`

I am trying to update with your update site Thank you for your support