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

Fix OSGi :mongodb-crypt manifest entries #1506

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

stIncMale
Copy link
Member

No description provided.

@stIncMale stIncMale self-assigned this Sep 23, 2024
Copy link
Contributor

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

Left a few comments for other reviewers.

@@ -89,7 +89,7 @@ afterEvaluate {
'com.github.luben.zstd.*;resolution:=optional',
'org.slf4j.*;resolution:=optional',
'jnr.unixsocket.*;resolution:=optional',
'com.mongodb.crypt.capi.*;resolution:=optional',
Copy link
Contributor

Choose a reason for hiding this comment

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

driver-core doesn't reference MongoCryptException (the only class left in this package), so this needed to be removed or else we get a warning.

@@ -75,6 +75,7 @@ afterEvaluate {
jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-reactivestreams'
jar.manifest.attributes['Import-Package'] = [
'com.mongodb.crypt.capi.*;resolution:=optional',
'com.mongodb.internal.crypt.capi.*;resolution:=optional',
Copy link
Contributor

Choose a reason for hiding this comment

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

reactive-streams (and sync) reference MongoCryptException, and also the classes that were moved into the internal package, so both packages are now needed.

@@ -175,7 +175,7 @@ afterEvaluate {
tasks.jar {
manifest {
attributes(
"-exportcontents" to "com.mongodb.crypt.capi.*;-noimport:=true",
"-exportcontents" to "com.mongodb.*;-noimport:=true",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a weird one. driver-core uses * for this, but * causes a warning with mongodb-crypt because the jar file contains directories for each of the shared library files, and some of those (e.g. linux-aarch64) are not valid Java package names. Using com.mongodb.* does the trick (it could also just be com.*).

Copy link
Member

@vbabanin vbabanin left a comment

Choose a reason for hiding this comment

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

LGTM!

@stIncMale stIncMale merged commit 49f7eb4 into mongodb:master Sep 23, 2024
55 of 59 checks passed
@stIncMale stIncMale deleted the fix-OSGi-crypt-manifest-entries branch September 23, 2024 21:27
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.

3 participants