[JAVA-2663] Implement a Graal native image friendly version of native calls in com.datastax.oss.driver.internal.core.os.Native
Description
Environment
Pull Requests
Activity
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
➤ Alexandre Dutra commented:
<p>Imported from <a href="https://datastax-oss.atlassian.net/browse/JAVA-2663?focusedCommentId=52606">JAVA-2663</a>, originally commented by tomekl007 on Tue, 19 May 2020 06:53:13 GMT.</p>
<hr />
<p>This commit to master:<br> https://github.com/datastax/cassandra-quarkus/commit/f09bf60de45133f036a2c5e7274307d469473745 ( https://github.com/datastax/cassandra-quarkus/commit/f09bf60de45133f036a2c5e7274307d469473745 )<br> with upgrading java driver did break the native build of quarkus:<br> https://jenkins-drivers.build.dsinternal.org/job/tools/job/cassandra-quarkus/job/master/14/console ( https://jenkins-drivers.build.dsinternal.org/job/tools/job/cassandra-quarkus/job/master/14/console )<br> I think that the only one change that could impact that is:<br> https://github.com/datastax/java-driver/commit/f4ea838b7650ab5bb10d089e1ea8613ba2592b05 ( https://github.com/datastax/java-driver/commit/f4ea838b7650ab5bb10d089e1ea8613ba2592b05 )<br> @absurdfarce<br> When reverting java-driver to 4.5.0 it works. I did revert (https://github.com/datastax/cassandra-quarkus/commit/b069f3216af6b50b7781b1636f88d98aa0c0e71c ( https://github.com/datastax/cassandra-quarkus/commit/b069f3216af6b50b7781b1636f88d98aa0c0e71c ) ) it on the master to make it work, and I think that it should be investigated as part of <span> ( https://datastax-oss.atlassian.net/browse/JAVA-2663 ) <span>Resolved</span> </span> </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=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>
<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