eclipse-pde / eclipse.pde

Eclipse Public License 2.0
25 stars 64 forks source link

API tool reports ficticious changes to execution environment #1301

Closed ptziegler closed 2 months ago

ptziegler commented 3 months ago

This is something that can be seen in the GEF workspace whenever we start a new release. A change in execution environment is reported for each bundle, even though the BREE hasn't been changed.

image

In short: The baseline bundles don't contain a Bundle-RequiredExecutionEnvironment header, but only a Required-Capability header.

Related to https://github.com/eclipse-equinox/equinox/issues/643

ptziegler commented 3 months ago

To briefly explain why this error shows up:

The API tool / PDE depends on the value returned by BundleDescription.getExecutionEnvironments(). When a bundle uses the Require-Capability but not the Bundle-RequireExecutionEnvironment header, this method returns an empty array.

The question is whether this should be fixed in PDE or in Equinox.

Given the documentation of this method, I believe that this behavior is wrong:

/**
 * Returns the list of execution environments that are required by this bundle.
 * Any one of the listed execution environments will allow this bundle to be
 * resolved.
 * 
 * @since 3.2
 * @return the list of execution environments that are required.
 */
public String[] getExecutionEnvironments();
laeubi commented 3 months ago

@ptziegler please take into consideration that this is

  1. "deprecated" /legacy API
  2. maybe was before Require-Capability was adopted

so if you can fix it at Equinox, go for it there is not much that can get worse here, if its too hard and there is a quick-path at API tools do it but be aware that maybe other places call this method that the needs this fix as well.

merks commented 3 months ago

FYI. I think the require capability can express a much more complex constraint than simply a list of EE. In any case, the list that PDE creates for this header really needs to match what equinox does for that same header.

laeubi commented 3 months ago

Yes effectively you need a list of EEs that you can match against the req-capability...