Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5400

Test UnixServerAddress via graalvm-native-image-app in Evergreen

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: GraalVM
    • None
    • Java Drivers

      While working on JAVA-5219, we discovered that UnixServerAddress does not work with GraalVM native image, even if the reachability metadata is collected anew, and the implementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion" dependency is present. See the details on what I tried and why that does not work in https://github.com/mongodb/mongo-java-driver/pull/1357#discussion_r1585688892.

      When experimenting, don't forget to remove the UnixServerAddressSubstitution, as it explicitly prevents UnixServerAddress from being used.

      The following is relevant only if we manage to make UnixServerAddress work with GraalVM

      The important part of this ticket is that :graalvm-native-image-app must not have a permanent dependency on com.github.jnr:jnr-unixsocket. We must be able to run it without such a dependency as long as we are not using UnixServerAddress, and this part has to be tested in Evergreen.

      The scope of this ticket also includes adding the required GraalVM reachability metadata to our JARs and to :graalvm-native-image-app. Note that we must not add the required shared library resources to driver-core/src/main/resources/META-INF/native-image/resource-config.json, as those significantly increase the size of a native image, even if a user does not use Unix domain sockets. Instead, we should add those resources to graalvm-native-image-app/src/main/resources/META-INF/native-image/resource-config.json, and mention that file as an example for users in the docs.

            Assignee:
            Unassigned Unassigned
            Reporter:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: