karatelabs / karate

Test Automation Made Simple

Home Page:https://karatelabs.github.io/karate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraalVM changes incompatible with Karate

edwardsph opened this issue · 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 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.

saving screenshot for future reference
image

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

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.

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

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 I bumped the graap dep all the way to 24 to fix another issue: #2542

also this is the dependency I finally went with: 5eccc2a

technically #2542 is a duplicate of this, but will keep both open for visibility