Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility Issue with GraalJS Engine and OpenJDK 23 #2120

Open
1 task done
FelixLisczyk opened this issue Nov 2, 2024 · 3 comments
Open
1 task done

Compatibility Issue with GraalJS Engine and OpenJDK 23 #2120

FelixLisczyk opened this issue Nov 2, 2024 · 3 comments
Labels

Comments

@FelixLisczyk
Copy link

FelixLisczyk commented Nov 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues and didn't find mine.

Description

I have encountered an issue while using Maestro version 1.39.0 on macOS 15.0.1 (24A348). The problem arises when running any script using the GraalJS engine, resulting in an immediate exception. It appears that the version of GraalJS used by Maestro might be incompatible with OpenJDK 23, which is installed automatically as a dependency via Homebrew.

Steps to reproduce

  1. Install Maestro version 1.39.0 on macOS 15.0.1 using Homebrew.
  2. Ensure OpenJDK 23 is installed (default via Homebrew).
  3. Run any script using the GraalJS engine.

Actual results

The following exception is thrown immediately:

Exception in thread "main" java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.ensureClassInitialized(java.lang.Class)'
	at com.oracle.truffle.api.library.LibraryFactory.ensureLibraryInitialized(LibraryFactory.java:384)
	at com.oracle.truffle.api.library.LibraryFactory.getUncached(LibraryFactory.java:364)
	at com.oracle.truffle.api.library.LibraryFactory.<init>(LibraryFactory.java:210)
	at com.oracle.truffle.api.interop.InteropLibraryGen.<init>(InteropLibraryGen.java:170)
	at com.oracle.truffle.api.interop.InteropLibraryGen.<clinit>(InteropLibraryGen.java:161)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:578)
	at java.base/java.lang.Class.forName(Class.java:557)
	at com.oracle.truffle.api.library.LibraryFactory.loadGeneratedClass(LibraryFactory.java:777)
	at com.oracle.truffle.api.library.LibraryFactory.resolveImpl(LibraryFactory.java:740)
	at com.oracle.truffle.api.library.LibraryFactory.resolve(LibraryFactory.java:733)
	at com.oracle.truffle.api.interop.InteropLibrary.<clinit>(InteropLibrary.java:2843)
	at com.oracle.truffle.polyglot.PolyglotValueDispatch.<clinit>(PolyglotValueDispatch.java:155)
	at com.oracle.truffle.polyglot.PolyglotImpl.initialize(PolyglotImpl.java:163)
	at org.graalvm.polyglot.impl.AbstractPolyglotImpl.setConstructors(AbstractPolyglotImpl.java:266)
	at org.graalvm.polyglot.Engine$1.loadAndValidateProviders(Engine.java:917)
	at org.graalvm.polyglot.Engine$1.run(Engine.java:890)
	at org.graalvm.polyglot.Engine$1.run(Engine.java:864)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
	at org.graalvm.polyglot.Engine.initEngineImpl(Engine.java:864)
	at org.graalvm.polyglot.Engine.access$000(Engine.java:110)
	at org.graalvm.polyglot.Engine$ImplHolder.<clinit>(Engine.java:136)
	at org.graalvm.polyglot.Engine.getImpl(Engine.java:360)
	at org.graalvm.polyglot.Source.getImpl(Source.java:140)
	at org.graalvm.polyglot.Source$Builder.build(Source.java:920)
	at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:69)
	at maestro.js.GraalJsEngine.evaluateScript(GraalJsEngine.kt:22)
	at maestro.orchestra.Orchestra.runScriptCommand(Orchestra.kt:418)
	at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:288)
	at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:193)
	at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:127)
	at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:177)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:62)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:53)
	at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:160)
	at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:53)
	at maestro.cli.command.TestCommand.runSingleFlow(TestCommand.kt:352)
	at maestro.cli.command.TestCommand.access$runSingleFlow(TestCommand.kt:63)
	at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:326)
	at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:297)
	at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:102)
	at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:52)
	at maestro.cli.command.TestCommand.runShardSuite(TestCommand.kt:297)
	at maestro.cli.command.TestCommand.access$runShardSuite(TestCommand.kt:63)
	at maestro.cli.command.TestCommand$handleSessions$1$results$1$1.invokeSuspend(TestCommand.kt:265)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

Expected results

Scripts should execute without throwing exceptions.

About app

I'm using Maestro to create UI tests for native iOS apps.

About environment

Maestro Version: 1.39.0
Operating System: macOS 15.0.1 (24A348)
Device: MacBook Pro (14-inch, 2021)
Java Version: OpenJDK 23 (installed via Homebrew)

Maestro version

1.39.0

How did you install Maestro?

Homebrew

Anything else?

Workaround:

I was able to work around the issue by manually installing OpenJDK 21 on my Mac. This suggests a compatibility issue between GraalJS and OpenJDK 23.

Related issues:

Copy link

linear bot commented Nov 2, 2024

@FelixLisczyk
Copy link
Author

Thank you for your feedback.

According to the Maestro documentation, the recommended installation method for macOS is through Homebrew. This installation process automatically installs the latest version of OpenJDK, which is currently OpenJDK 23. To ensure a seamless user experience, either Maestro needs to be fully compatible with OpenJDK 23 or the Homebrew formula should specify a dependency on an earlier version of OpenJDK, such as OpenJDK 21.

@herval herval added the Maestro label Nov 26, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@herval @FelixLisczyk and others