-
Notifications
You must be signed in to change notification settings - Fork 334
Run Standard.Google in dual JVM mode
#14040
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
base: develop
Are you sure you want to change the base?
Conversation
corepack pnpm i
corepack pnpm compile
corepack pnpm dev:gui
|
|
I have all the setup to execute the tests in regular JVM mode: now onto running the same tests in dual JVM mode. With bc03db6 there is eleven remaining failures: we are on track to get the dual JVM mode working for |
… JVMs have the same ID
| var emptySheetError = emptySheetType.invokeMember("Error"); | ||
| var errorType = EnsoMeta.getType("Standard.Base.Error", "Error"); | ||
| var error = errorType.invokeMember("throw", emptySheetError); | ||
| throw error.throwException(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- cdbf8fb is a solution to dual exceptions problem, @AdRiley
- rather than throwing Java exception and then trying to convert it to
Empty_Sheet.Error - let's directly throw
Empty_Sheet.Error! - the
getSheetRangemethod returnsTable- as such we need to throw it asPanic(henceerror.throwException()- otherwise just
return error;to propagate the value as (dataflow)Error
- otherwise just
- because we throw
Panicwe havePanic.recoverin the Enso code - if we returned (dataflow)
Error- we could delete the Enso conversion code completely!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- we can go even further with this approach, @jdunkerley
- if we just
return error;then there is no need to do anything special on the Enso side - as de343f3 illustrates, it is possible to remove
Empty_Sheet.handle_java_exception - the only drawback of the de343f3 is the change of function return type to
Object- we need to return either
TableorValueandObjectis the only common superclass
- we need to return either
- the
throw error.throwException()solution workarounds this by returning via an exception (at the cost of necessary handler on the Enso side)
|
Right now we have:
Other than that we are ready to move on. Heuréka! |
| error!("Current API vs Old API: {}", err); | ||
| error!("If you wish to overwrite the current API in the directory {}, run the following command {}, | ||
| error!("If you wish to overwrite the current API in the directory {}, run the following command | ||
| sbt \"runEngineDistribution --no-ir-caches --docs=api --in-project {}\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change, @AdRiley, @GregoryTravis, @jdunkerley, will print:
index 8b63b3d24d..f2c90e184d 100644
--- home/devel/NetBeansProjects/enso/enso/distribution/lib/Standard/Table/0.0.0-dev/docs/api/Errors.md
+++ home/devel/NetBeansProjects/enso/enso/built-distribution/enso-engine-2025.3.1-dev-linux-amd64/enso-2025.3.1-dev/lib/Standard/Table/2025.3.1-dev/docs/api/Errors.md
@@ -43,7 +43,7 @@
- to_display_text self -> Standard.Base.Any.Any
- type Empty_Sheet
- Error
- - handle_java_exception -> Standard.Base.Any.Any
+ - handle_java_exception ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- type Existing_Column
- Error column_name:Standard.Base.Any.Any
ERROR main_internal: enso_build::engine::context: If you wish to overwrite the current API in the directory distribution/lib/Standard/Table/0.0.0-dev/docs/api, run the following command
sbt "runEngineDistribution --no-ir-caches --docs=api --in-project distribution/lib/Standard/Table/0.0.0-dev"
and commit the modified files
ERROR main_internal: enso_build_cli: error=API check failed for library Standard.Table
INFO main_internal: enso_build_cli: close
Error: API check failed for library Standard.Table
in case of API check failure. Which I can then directly copy and run the regenerator:
enso$ sbt "runEngineDistribution --no-ir-caches --docs=api --in-project distribution/lib/Standard/Table/0.0.0-dev"Please note the --no-ir-caches flag added for your convenience as the actionable applied after recent complains.
c1f5e6e to
53f1b1a
Compare
| } | ||
|
|
||
| public Table getSheetRange( | ||
| public Object getSheetRange( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- need a common super type of
TableandValuebecause of returning Error.throw
Standard.Google in dual JVM mode
|
Jaroslav Tulach reports a new STANDUP for yesterday (2025-10-08): Progress: .
|
There is now a last remaining failure: it should probably be mitigated by using the same technique as in 51366e2 |
I believe we are ready! @AdRiley please review and verify my claims. Thank you. |
| raw_table = self.internal_java_table | ||
| if raw_table.is_a table_class then raw_table else | ||
| # coming from the other JVM and deserves conversion | ||
| new_columns = raw_table.getColumns.map c-> column_class.new c.getName c.getStorage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- using same technique as in 51366e2
- e.g. converting via
ColumnStorage(which is an interface) - and creating new
TableforColumn(of the right class) delegating to proxy of the interface
| private static Value getBindings() { | ||
| return Context.getCurrent().getBindings("enso"); | ||
| var ctx = Context.getCurrent(); | ||
| var bindings = ctx.getPolyglotBindings().getMember("ensoBindings"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- With these changes we can now access Enso classes even from dual JVM
| Convert a Java problem into its Enso equivalent. | ||
| translate_problem p = case p of | ||
| _ : InvalidAggregation -> | ||
| translate_problem p = case p.problemType of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduction of Problem.problemType() allow us to translate_problem regardless from which JVM it origins
|
|
||
| ```bash | ||
| enso$ ./run ide build | ||
| enso$ ls ./dist/ide/enso-linux-*.AppImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this would be very nice to automate, @otulach, @PabloBuchu!
- first of all we need to run the IDE and create the
GoogleSheetcredential via playwright - then we need to execute the
Google_Tests from CLI
|
|
Jaroslav Tulach reports a new STANDUP for yesterday (2025-10-09): Progress: .
|
|
Jaroslav Tulach reports a new STANDUP for yesterday (2025-10-10): Progress: .
|
|
Jaroslav Tulach reports a new STANDUP for yesterday (2025-10-11): Progress: .
|
Thanks @AdRiley for the testing. Now, we other tasks like #14019 being integrated, let's move this PR on. I am getting following error:
when trying your code. Obviously, I don't have access to your credentials. But on a general note: How can projects referencing secrets be made transferable between different people? |
| try { | ||
| polyglotJava = createPolyglotJava(ctx); | ||
| } catch (Throwable t) { | ||
| logger.log(Level.ERROR, "Cannot create polyglotJava", t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- After merging the most recent
developin - and especially Launching ydoc-server together with language-server #13178
- we are now getting
INFO: Initializing OtherJvm support!
SEVERE: Cannot create polyglotJava
java.lang.AssertionError: Error creating JVM: -5
at org.enso.jvm.channel/org.enso.jvm.channel.JVM.initializeEnv(JVM.java:114)
at org.enso.jvm.channel/org.enso.jvm.channel.JVM.env(JVM.java:87)
at org.enso.jvm.channel/org.enso.jvm.channel.Channel.create(Channel.java:161)
at org.enso.jvm.interop/org.enso.jvm.interop.api.OtherJvmClassLoader.createImpl(OtherJvmClassLoader.java:129)
at org.enso.jvm.interop/org.enso.jvm.interop.api.OtherJvmClassLoader.create(OtherJvmClassLoader.java:76)
at org.enso.interpreter.epb.JavaPolyglotNode.create(JavaPolyglotNode.java:21)
at org.enso.interpreter.epb.ForeignEvalNode.parseJava(ForeignEvalNode.java:124)
- when trying to initialize the HotSpot JVM here
- because there already is one HotSpot JVM in the process (created by Launching ydoc-server together with language-server #13178)
- and the documentations says and continues to say it in the JDK 25 as well:
Creation of multiple VMs in a single process is not supported.
- one should probably read the specification more carefully before getting too optimistic






Pull Request Description
Standard.Googlestd-bitsJava codeChecklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,