-
Notifications
You must be signed in to change notification settings - Fork 66
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
StateBuilder should consider Constant.REQUIRE_CAPABILITY when calculating BREE for BundleDescription #643
Comments
Unless there are any objections, I'll try to create a prototype over the next few days... |
This sounds very similar to this issue Though in the case there is nothing at all except what PDE adds implicitly. |
Isn't the problem here that the system bundle created for the state doesn't have the system capabilities set for it to provide the necessary
|
See Lines 981 to 990 in 343e816
Where it is expecting to get these extra capabilities from the platform properties. |
I'm afraid I can't follow your explanation. From the debugger, I can tell that the system bundle has loaded the JavaSE-17 profile, which is what I expected. So assuming that this is required by a bundle, it should be possible to satisfy this capability. However, the issue is that, given the manifest mentioned above, I would expect that after I've created the BundleDescription object, a call to Lines 275 to 283 in 343e816
But this is only the case when the manifest is using the |
I do think PDE is processing this differently than in Equinox. I’ll help review proposed changes. |
The PDE state, which uses the equinox resolver, in general supports EE requirements and it works when resolving such bundles in the target platform. So maybe this is a problem laying somewhere in-between. Before drawing conclusions where to solve this best, could you create a minimal reproducer and create a PDE issue for API-tools with that? |
I've created eclipse-pde/eclipse.pde#1301 and a test case via eclipse-pde/eclipse.pde#1302 |
It’s really impressive how often you dive deeply to fix problems wherever they may lurk. |
At the end of the day, this is already something that bothered me the last time I saw this. Of course I could just increase the version numbers whenever it shows up, but that would probably frustrate me even more... I just generally believe it's better to speak up rather than to keep quiet, whenever something doesn't run as smoothly as it should. 😅 |
With this change, the BundleDescription instance that is returned by the StateBuilder now also contains the execution environments that are required by the Require-Capability header, rather than only the Bundle-RequireExecutionEnvironment header. Previously, a call to getExecutionEnvironments() would always return an empty array, if a bundle lacks the Bundle-RequireExecutionEnvironment header, even though a minimum version is required as a capability. Resolves eclipse-equinox#643
With this change, the BundleDescription instance that is returned by the StateBuilder now also contains the execution environments that are required by the Require-Capability header, rather than only the Bundle-RequireExecutionEnvironment header. Previously, a call to getExecutionEnvironments() would always return an empty array, if a bundle lacks the Bundle-RequireExecutionEnvironment header, even though a minimum version is required as a capability. Resolves eclipse-equinox#643
With this change, the BundleDescription instance that is returned by the StateBuilder now also contains the execution environments that are required by the Require-Capability header, rather than only the Bundle-RequireExecutionEnvironment header. Previously, a call to getExecutionEnvironments() would always return an empty array, if a bundle lacks the Bundle-RequireExecutionEnvironment header, even though a minimum version is required as a capability. Resolves eclipse-equinox#643
With this change, the BundleDescription instance that is returned by the StateBuilder now also contains the execution environments that are required by the Require-Capability header, rather than only the Bundle-RequireExecutionEnvironment header. Previously, a call to getExecutionEnvironments() would always return an empty array, if a bundle lacks the Bundle-RequireExecutionEnvironment header, even though a minimum version is required as a capability. Resolves eclipse-equinox#643
With this change, the BundleDescription instance that is returned by the StateBuilder now also contains the execution environments that are required by the Require-Capability header, rather than only the Bundle-RequireExecutionEnvironment header. Previously, a call to getExecutionEnvironments() would always return an empty array, if a bundle lacks the Bundle-RequireExecutionEnvironment header, even though a minimum version is required as a capability. Resolves eclipse-equinox#643
Since eclipse-pde/eclipse.pde#1302 is submitted I think this is obsolete. |
This is quite a convoluted problem, so let's start from the very beginning...
At the start of every release, we see the following error popping up in the GEF workspace, which is produced by the PDE API tool:
The cause of this error is, as the description suggests, that the execution environment has changed; Except that this is not the case. In the previous release, we built against Java 17 and this is still the case now.
What's happening internally is that the API tool loads the BREE of the baseline plugin and compares it to the workspace plugin. The BREE of the workspace plugin is "JavaSE-17", but the BREE of the baseline plugin is an empty string => Error.
Or in other words, the baseline BREE is not calculated correctly.
The bundle description through which the BREE is loaded is created via the following method in the BundleComponent class, which delegates to the StateObjectFactory and from there to the StateBuilder:
The reason no BREE is found for the baseline plugin is because the manifest is using the "Require-Capability" header, instead of the deprecated "Bundle-RequiredExecutionEnvironment" header, with the former not (yet) being supported by the StateBuilder:
equinox/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateBuilder.java
Lines 131 to 132 in 343e816
This is obviously something that could be fixed in PDE, but I think it makes sense to fix it directly at the source...
For reference, this is what our manifest looks like:
As a fix, one can probably use a similar approach to what is used in PDE, to detect whether a execution environment is set, where the BREE is calculated as <Execution-Environment>-<Version>:
The text was updated successfully, but these errors were encountered: