[JAVA-2663] Implement a Graal native image friendly version of native calls in com.datastax.oss.driver.internal.core.os.Native

Description

<p>Imported from JAVA-2663, originally reported by absurdfarce on Wed, 26 Feb 2020 22:42:25 GMT.</p>
<hr />
<p>Short version: all the actual interactions with native code in Native wind up using jnr-ffi library loading ops... and this code is incompatible with some of the limitations of Graal.</p>
<p>https://github.com/absurdfarce/graal-cassandra-driver/blob/master/README.md has all the gory details if you're curious.</p>
<p>Note that the failures described in that doc are runtime failures, so as long as we can (a) detect that we're running in a native image and (b) execute alternate code if we are we should be good. Also note that Graal can natively execute LLVM code (see https://www.graalvm.org/docs/reference-manual/languages/llvm/) which should make native access to libc ops much simpler. Ideally any solution here would leverage this functionality.</p>

Issue is synchronized with a GitHub issue by Unito
Repository Name: cassandra-quarkus
Issue Number: 54
Milestone: 1.0.0-alpha1

Environment

None

Pull Requests

None

Activity

Show:

Karan Dhingra 
July 22, 2021 at 12:22 AM

Alexandre Dutra commented:

<p>Imported from <a href="https://datastax-oss.atlassian.net/browse/JAVA-2663?focusedCommentId=52609">JAVA-2663</a>, originally commented by absurdfarce on Tue, 19 May 2020 08:11:37 GMT.</p>
<hr />
<p>The driver currently in use by cassandra-quarkus doesn’t include the changes in this ticket so this very definitely wasn’t what broke things. https://datastax-oss.atlassian.net/browse/JAVA-2662 ( https://datastax-oss.atlassian.net/browse/JAVA-2662 ) seems like a more likely candidate. Regardless, I’ll be fixing that issue as part of the work being done in https://datastax-oss.atlassian.net/browse/JAVA-2782 ( https://datastax-oss.atlassian.net/browse/JAVA-2782 ) so I’m closing this issue again.</p>

Karan Dhingra 
July 22, 2021 at 12:22 AM

Alexandre Dutra commented:

<p>Imported from <a href="https://datastax-oss.atlassian.net/browse/JAVA-2663?focusedCommentId=52608">JAVA-2663</a>, originally commented by tomekl007 on Tue, 19 May 2020 06:55:57 GMT.</p>
<hr />
<p>It broke the native process build and therefore native tests.</p>

Karan Dhingra 
July 22, 2021 at 12:22 AM

Alexandre Dutra commented:

<p>Imported from <a href="https://datastax-oss.atlassian.net/browse/JAVA-2663?focusedCommentId=52607">JAVA-2663</a>, originally commented by adutra on Tue, 19 May 2020 06:55:25 GMT.</p>
<hr />
<p>My bad, I upgraded the driver. But I’m surprised that this upgrade broke tests, I can’t understand why.</p>

Karan Dhingra 
July 22, 2021 at 12:22 AM

Karan Dhingra 
July 22, 2021 at 12:22 AM

Alexandre Dutra commented:

<p>Imported from <a href="https://datastax-oss.atlassian.net/browse/JAVA-2663?focusedCommentId=52529">JAVA-2663</a>, originally commented by absurdfarce on Sat, 2 May 2020 15:16:46 GMT.</p>
<hr />
<p>tomekl007 Everything you’re describing is in the cassandra-quarkus project. None of it is available in the java-driver project. That was the basis for all my claims above.</p>
<p>In addition, it doesn’t look like we can just drop in Qarkus and solve this problem even if we wanted to add it as a dependency to the driver (which I don’t think we do). I did spend a fair amount of time studying the test infrastructure in Quarkus to understand how the NativeImageTest annotation works with the other components in Quarkus to actually run tests. There’s a hefty amount of infrastructure there including an intricate interaction between their custom Maven plugin and their JUnit extensions. A lot of that is fairly specific to Quarkus and would require a bit of work to generalize.</p>

Fixed

Details

Assignee

Reporter

Labels

Due date

Priority

Created July 22, 2021 at 12:22 AM
Updated July 22, 2021 at 3:19 AM
Resolved July 22, 2021 at 12:22 AM