karate icon indicating copy to clipboard operation
karate copied to clipboard

GraalVM changes incompatible with Karate

Open edwardsph opened this issue 2 years ago • 10 comments

I am currently using Quarkus 3.8.2 and Karate 1.5.0.RC3. That version of Quarkus came with Graal 23.0.1 so to ensure I get the right version of Graal, I use:

        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js-scriptengine</artifactId>
            <version>23.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js</artifactId>
            <version>23.0.3</version>
            <scope>runtime</scope>
        </dependency>

Quarkus 3.8.3 comes with Graal 23.1.2 which appears to introduce significant changes - see https://www.graalvm.org/release-notes/JDK_21/#javascript-and-nodejs for details.

I don't fully understand the implications but is it possible for Karate to be made compatible with this version of Graal?

edwardsph avatar Mar 18 '24 14:03 edwardsph

@edwardsph thanks for the heads up. here's the link to the maven lib that we depend on: https://github.com/oracle/graaljs/blob/master/CHANGELOG.md#version-2310 to quote:

what are the main blockers you see ? I will need some time to investigate.

ptrthomas avatar Mar 18 '24 17:03 ptrthomas

saving screenshot for future reference image

ptrthomas avatar Mar 18 '24 17:03 ptrthomas

Perhaps I was just getting the maven coordinates wrong but in my first few attempts I was just getting time outs when running tests. That is normally what I see when I have mismatched modules. I will try again tomorrow with the above for a guide. Thanks

edwardsph avatar Mar 18 '24 17:03 edwardsph

I have found a solution. The problem, as you pointed out above, is that the maven coordinates have changed with version 23.1.0. As such I had to exclude the graal dependencies from Karate and include the new ones directly.

        <dependency>
            <groupId>io.karatelabs</groupId>
            <artifactId>karate-core</artifactId>
            <version>1.5.0.RC3</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.graalvm.js</groupId>
                    <artifactId>js</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.graalvm.js</groupId>
                    <artifactId>js-scriptengine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js-scriptengine</artifactId>
            <version>23.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.graalvm.polyglot</groupId>
            <artifactId>js</artifactId>
            <version>23.1.2</version>
            <type>pom</type>
            <scope>runtime</scope>
        </dependency>

Once the coordinates in Karate are updated, I think I will be able to drop the exclusion and future compatibility issues between Quarkus and Karate can be resolved as before.

edwardsph avatar Mar 19 '24 10:03 edwardsph

thanks @edwardsph for the update. I'm seriously going to identify an alternative to graal, will keep you posted

I see that they have started 2 versions of even the maven JARs. one is js and the other is js-community I'm wondering if you are aware of what the difference is

ptrthomas avatar Mar 19 '24 13:03 ptrthomas

It appears to be about licensing issues. From https://github.com/oracle/graaljs?tab=readme-ov-file#maven-artifact:

Language and tool dependencies use the GraalVM Free Terms and Conditions (GFTC) license by default. To use community-licensed versions instead, add the -community suffix to each language and tool dependency

edwardsph avatar Mar 19 '24 14:03 edwardsph

@edwardsph thanks.

ptrthomas avatar Mar 19 '24 15:03 ptrthomas

@edwardsph just FYI https://twitter.com/ptrthomas/status/1775754727700996381

ptrthomas avatar Apr 04 '24 05:04 ptrthomas

@edwardsph I bumped the graap dep all the way to 24 to fix another issue: https://github.com/karatelabs/karate/issues/2542

also this is the dependency I finally went with: https://github.com/karatelabs/karate/commit/5eccc2ae05ec8992eb07eb4f0361feeb86d3670e

ptrthomas avatar Apr 05 '24 13:04 ptrthomas

technically https://github.com/karatelabs/karate/issues/2542 is a duplicate of this, but will keep both open for visibility

ptrthomas avatar Apr 11 '24 17:04 ptrthomas

1.5.0 released

ptrthomas avatar Aug 05 '24 15:08 ptrthomas