-
Notifications
You must be signed in to change notification settings - Fork 934
Add initial OSGi support #7964
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
base: main
Are you sure you want to change the base?
Add initial OSGi support #7964
Conversation
|
Would hugely appreciate if @stbischof / |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7964 +/- ##
=========================================
Coverage 90.12% 90.12%
Complexity 7463 7463
=========================================
Files 834 834
Lines 22585 22585
Branches 2239 2239
=========================================
Hits 20354 20354
Misses 1530 1530
Partials 701 701 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Will Look at this at weekend @jack-berg you May want Thatcher BND also calc your jpms Module info. https://bnd.bndtools.org/chapters/330-jpms.html Maybe. Not on this Step and Pr. But this Couleur be an extra |
Thanks for the tip! My approach is going to be to write a test case showing a scenario that fails, then update the bnd configuration so it passes. So the key will be knowing which scenarios fail without bnd calculating jpms module info, and encoding that into a test. |
@jack-berg I'm guessing you mean me instead of @roytee 😄 , but sure, will try and find some time in the coming week to test everything out :)! What caused you to implement it ;)? |
Been meaning to for a while given how many 👍 the issue has. Was out on parental leave when this comment was left. Long overdue I gave it some attention! |
Related to #768.
This adds initial OSGi support to all artifacts. Specifically, this uses the
biz.aQute.bnd.builderplugin to enrich each artifact'sMANIFEST.MF. Here's a before and after ofMANIFEST.MFforopentelemetry-api:Before:
After:
The import thing this tool does is specify each artifact's
Export-PackageandImport-Package. Still coming up to speed on OSGi, but my understanding is that this is a specification for the packages each artifact exports for use by others, and the packages each depends on.Ideally, we would exclude our
*.internal.*packages from our exports, but this is blocked by #6970.A key bit we have to do is tell OSGi which packages are optional. For example,
opentelemetry-apihas compileOnly dependencies onopentelemetry-api-incubatorand a reflection interaction withopentelemetry-sdk-extension-autoconfigure. If we don't tell the bnd that these are optional, then OSGi environments fail to initialize when these are missing. I've extended our gradle tooling to make it easy to specify optional packages by settingotelJava.osgiOptionalPackages.Detecting misconfiguration of OSGi around optional packages requires test configurations that exercise a specific set of dependencies. I have an initial test configuration which only includes
opentelemetry-sdkand transitive dependencies, and have done an initial pass of specifying optional dependencies, but more test configurations and more OSGi configuration will be needed.