Skip to content
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

Embed the required StateFactory implementations #455

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

laeubi
Copy link
Member

@laeubi laeubi commented Feb 8, 2024

Currently P2 has the BundleDescription in its API where the only implementation is in the discouraged osgi.compatibility fragment, but actually P2 does not really need a full implementation, it is just using that to parse manifest headers and generate metadata from it.

This embeds a stripped down version of the actual implementation in the p2.publisher.eclipse that allows to create implementation objects without rely on the compatibility fragment anymore.

This is currently work in progress and a way to track progress, the classes can most probably stripped down even more and currently depends on some equinox framework internals that probably should either be inline as well or an alternative should be chosen.

Copy link

github-actions bot commented Feb 8, 2024

Test Results

  375 files  +  125    375 suites  +125   45m 2s ⏱️ + 16m 42s
1 904 tests +    6  1 901 ✅ +    6  3 💤 ±0  0 ❌ ±0 
6 712 runs  +2 234  6 703 ✅ +2 231  9 💤 +3  0 ❌ ±0 

Results for commit 191df76. ± Comparison against base commit fcb6396.

♻️ This comment has been updated with latest results.

@laeubi
Copy link
Member Author

laeubi commented Feb 9, 2024

Beside the zip packaging problem this seem to not break anything @merks do you want to give it a try with Ooomph?

@tjwatson what do you think? I know it is not nice to copy the code, but it seems unlikely P2 will ever be able to move away from the API interface and at least we can strip down everything to the bare minimum P2 is actually using here (e.g. it never uses a State anyways and would make PDE the only consumer of the compatibility fragment.

It seems without a state this always operates in "nonstrict mode" and we can even remove all code pathes that work on "strict" checks.

@merks
Copy link
Contributor

merks commented Feb 9, 2024

It appears to cause no breakage for Oomph...

@laeubi
Copy link
Member Author

laeubi commented Feb 9, 2024

One option would be if we move the fragment to P2 instead of copy one can simply link the sources here, see

@laeubi laeubi force-pushed the do_not_require_compat branch from 5dd7e82 to cc618f7 Compare February 9, 2024 11:36
@laeubi laeubi force-pushed the do_not_require_compat branch from cc618f7 to 062505f Compare April 24, 2024 07:01
@tjwatson
Copy link
Contributor

I'm not convinced making a copy here helps much with anything vs. using the APIs and implementation fragment as they are today.

@laeubi
Copy link
Member Author

laeubi commented Apr 29, 2024

I'm not convinced making a copy here helps much with anything vs. using the APIs and implementation fragment as they are today.

The API will still be used (as we can't change this much) but the implementation (compatibility fragment) will not be required anymore as P2 don't really wants the "real" implementation, in fact is only uses that to parse the MANIFEST and provides that as a structured way to access the information.

So one can also reimplement that, but copy whats already there seems to be a faster approach.

@laeubi laeubi force-pushed the do_not_require_compat branch from 062505f to f74d051 Compare April 29, 2024 07:18
@laeubi laeubi force-pushed the do_not_require_compat branch from f74d051 to 52250a2 Compare January 14, 2025 16:36
@laeubi laeubi marked this pull request as ready for review January 14, 2025 16:36
@laeubi
Copy link
Member Author

laeubi commented Jan 14, 2025

I have now pruned all unused code from the implementation using http://www.ucdetector.org/ and removed all references to the internal implementation of equinox.

@laeubi laeubi requested a review from tjwatson January 14, 2025 16:39
@laeubi laeubi force-pushed the do_not_require_compat branch 3 times, most recently from b69e549 to ba1ca70 Compare January 14, 2025 17:07
@laeubi
Copy link
Member Author

laeubi commented Jan 14, 2025

Moved to internal package and renamed some classes to make it more obvious what is done here.

@laeubi
Copy link
Member Author

laeubi commented Jan 14, 2025

@merks @tjwatson if no further concerns I think we should merge this to get some more confidence everything works and possibly fix things if needed.

Currently P2 has the BundleDescription in its API where the only
implementation is in the discouraged osgi.compatibility fragment, but
actually P2 does not really need a full implementation, it is just using
that to parse manifest headers and generate metadata from it.

This embeds a stripped down version of the actual implementation in the
p2.publisher.eclipse that allows to create implementation objects
without rely on the compatibility fragment anymore.
@laeubi laeubi force-pushed the do_not_require_compat branch from ba1ca70 to 191df76 Compare January 16, 2025 16:10
@merks
Copy link
Contributor

merks commented Jan 16, 2025

FYI, I did check that this causes no compilation problem for Oomph so I think it's fine. I did not test behavior...

@HannesWell
Copy link
Member

I'm not convinced making a copy here helps much with anything vs. using the APIs and implementation fragment as they are today.

The API will still be used (as we can't change this much) but the implementation (compatibility fragment) will not be required anymore as P2 don't really wants the "real" implementation, in fact is only uses that to parse the MANIFEST and provides that as a structured way to access the information.

Can't we migrate P2 to use the code from in the 'new' Equinox container, i.e. away from the old equinox resolver APIs?

Copy link
Contributor

@tjwatson tjwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@laeubi
Copy link
Member Author

laeubi commented Jan 17, 2025

Can't we migrate P2 to use the code from in the 'new' Equinox container, i.e. away from the old equinox resolver APIs?

Of course we can migrate to "something else" but I don't really see much benefit in that:

  1. We would break the API here so special consideration is required to allow consumers to move away
  2. The new API must be doing the same as the current API (or very similar) without any immediate benefit

So given PDE has moved away from this package we can decide to completely embed it into P2 instead of invent a new API and then we can even remove more things.

@laeubi laeubi merged commit d84b569 into eclipse-equinox:master Jan 17, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants