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

Using latest GraalVM bits in Enso #8885

Closed
wants to merge 4 commits into from

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Jan 29, 2024

Pull Request Description

Using oracle/graal#8266 in Enso. This is an exploratory work using manually built SNAPSHOT bits of GraalVM that will be released as version 24.1 in middle of the year.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@@ -1432,6 +1434,7 @@ lazy val frgaalJavaCompilerSetting =
customFrgaalJavaCompilerSettings(targetJavaVersion)

def customFrgaalJavaCompilerSettings(targetJdk: String) = Seq(
resolvers += Resolver.mavenLocal,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables usage of JARs from ~/.m2/repository. To install them update GraalVM to: oracle/graal#8266 in particular commit 853702c407c8fb31116decfefddef87a71203154 and do:

graal/sdk$ mx maven-deploy
graal/truffle$ mx maven-deploy

these two commands install all Truffle & SDK JARs into local repository with version 24.1.0-SNAPSHOT. The sbt build can then find them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 253ded5 I am able to execute:

enso$ sbt 
sbt> project runtime
sbt:runtime> testOnly *ForeignMethodInvokeTest -- -z org.enso.interpreter.test.ForeignMethodInvokeTest.testParallelInteropWithJavaScript

and that is enough for testing oracle/graal#8266

@@ -2592,6 +2599,7 @@ lazy val `std-base` = project
`base-polyglot-root` / "std-base.jar",
libraryDependencies ++= Seq(
"org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion,
"org.graalvm.sdk" % "collections" % graalMavenPackagesVersion,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collections are now separated into its own JAR. As the group ID suggests (org.graalvm.sdk) they are not part of the org.graalvm.polyglot ecosystem. We should probably stop using them and not expose their classes to libraries. CCing @radeusgd

var counter = new long[1];
var b =
defaultContextBuilder("enso", "js")
.onDeniedThreadAccess(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With onDeniedThreadAccess as proposed by oracle/graal#8266 we have a way to act like an Ethernet on collision and successfully orchestrate the two threads accessing the same context to run into completion.

More info on Ethernet collision detection and behavior - most important "Calculate and wait the random backoff".

@farmaazon farmaazon deleted the wip/jtulach/UsingGraalVM_PR_8266 branch May 9, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant