Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
16125eb
Run Standard.Google in dual JVM mode
JaroslavTulach Sep 23, 2025
3c0c853
Merge remote-tracking branch 'origin/develop' into wip/jtulach/DualGo…
JaroslavTulach Sep 23, 2025
e0d3d7d
Merge remote-tracking branch 'origin/develop' into wip/jtulach/DualGo…
JaroslavTulach Oct 7, 2025
144edf2
Pass the right CredentialReference into as_credential_reference via a…
JaroslavTulach Oct 7, 2025
39fcb8a
Provide own ProblemAggregator
JaroslavTulach Oct 7, 2025
2c784af
Updating documentation of running the test/Google_Test
JaroslavTulach Oct 7, 2025
bc03db6
Obtain Enso bindings in dual JVM mode by sending an OtherJvmMessage
JaroslavTulach Oct 7, 2025
596e84e
Using OtherJvm support is no error!
JaroslavTulach Oct 7, 2025
3c12b86
Recognize Problem types by simple class name so values from different…
JaroslavTulach Oct 7, 2025
cdbf8fb
Rather than wrapping Java exceptions throw Enso exceptions directly f…
JaroslavTulach Oct 7, 2025
a5a588e
EmptySheetException has been removed
JaroslavTulach Oct 7, 2025
c4174e5
Print out exact sbt command to regenerate caches
JaroslavTulach Oct 8, 2025
677324e
Provide credential_reference Java class as defaulted argument
JaroslavTulach Oct 8, 2025
53f1b1a
Let's rely on currying instead of passing the argument thru
JaroslavTulach Oct 8, 2025
f289107
Use Path to avoid cargo linting
JaroslavTulach Oct 8, 2025
de343f3
No need for Empty_Sheet.handle_java_exception when returning Error.th…
JaroslavTulach Oct 8, 2025
709807b
Propagate stacktraces when re-throwing DataflowError as PanicException
JaroslavTulach Oct 8, 2025
95f9f55
Check behavior of Error.throw invoked from polyglot Java
JaroslavTulach Oct 8, 2025
1f11d47
Convert proxy class to real StorageType
JaroslavTulach Oct 8, 2025
05cc641
Delay call to context.getEnv().getScopePublic until access to Enso la…
JaroslavTulach Oct 8, 2025
2a39d26
Convert internal_java_table to desired Java class when needed
JaroslavTulach Oct 9, 2025
0b03794
Merging with develop with GraalVM 25
JaroslavTulach Oct 30, 2025
7e69793
Properly report when createPolyglotJava fails
JaroslavTulach Oct 30, 2025
638ba98
Merging with ydoc-server in native image changes
JaroslavTulach Nov 5, 2025
88c0bd0
Build ydoc-server shared library when shouldBuildNativeImage
JaroslavTulach Nov 5, 2025
125d81b
Allow passing in JVM options like -Dpolyglot.enso.classLoading=
JaroslavTulach Nov 6, 2025
0285457
Avoid computing DataQualityMetrics for Standard.Google tables
JaroslavTulach Nov 6, 2025
c533651
Merge remote-tracking branch 'origin/develop' into wip/jtulach/DualGo…
JaroslavTulach Nov 6, 2025
f71e29c
Detect multi threaded access to Channel and/or JVM
JaroslavTulach Nov 7, 2025
ef75365
Merging with develop's support for multiple threads
JaroslavTulach Nov 11, 2025
ed8e250
Remember exception during polyglotJava initialization
JaroslavTulach Nov 11, 2025
ec9abed
Reveting back changes related to Error.throw being used from Java
JaroslavTulach Nov 12, 2025
1ebffbb
Convert google's EmptySheetException to Empty_Sheet.Error
JaroslavTulach Nov 12, 2025
f9f7ef6
Merge remote-tracking branch 'origin/develop' into wip/jtulach/DualGo…
JaroslavTulach Nov 12, 2025
2bf4478
Pass in credential_reference as a factory class
JaroslavTulach Nov 13, 2025
1f89021
Clear also polyglotBindings when closing a channel
JaroslavTulach Nov 13, 2025
b1a7022
Merging with most recent develop changes
JaroslavTulach Nov 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
"name": "Rust Gen CI",
"program": "${workspaceFolder}/target/rust/debug/enso-build-ci-gen",
"args": []
}
},
{
"type": "lldb",
"request": "launch",
"preLaunchTask": "Rust ./run",
"name": "Rust ./run",
"program": "${workspaceFolder}/target/rust/buildscript/enso-build-cli",
// provide arguments, for example:
// "args": ["backend", "stdlib-api-check"]
Copy link
Member Author

@JaroslavTulach JaroslavTulach Oct 8, 2025

Choose a reason for hiding this comment

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

With c4174e5 it should be easy to debug ./run executable in VSCode with Rust Analyzer:

debug ./run

Change the args list and press F5, @Akirathan, @4e6. This is a continuation of the effort started in https://github.com/enso-org/enso/pull/14037/files#r2393592162

"args": []
},
]
}
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
"isDefault": true
},
"label": "Rust Gen CI"
},
{
"type": "cargo",
"command": "build",
"args": ["--profile", "buildscript", "-p", "enso-build-cli"],
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
},
"label": "Rust ./run"
}
]
}
3 changes: 0 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4063,9 +4063,6 @@ lazy val `engine-runner` = project
`database-polyglot-root`
.listFiles("*.jar")
.map(_.getAbsolutePath()) ++
`google-polyglot-root`
Copy link
Member Author

Choose a reason for hiding this comment

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

  • The main change of this PR
  • std-bits/google are no longer included when building enso NI

.listFiles("*.jar")
.map(_.getAbsolutePath()) ++
`std-aws-polyglot-root`.listFiles("*.jar").map(_.getAbsolutePath()) ++
`std-snowflake-polyglot-root`
.listFiles("*.jar")
Expand Down
25 changes: 15 additions & 10 deletions build_tools/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ impl RunContext {
assert!(old_api_dir.exists());
debug!(
"Checking API for library Standard.{}, its API dir is in {:?}",
lib.name, old_api_dir
lib.name,
self.short_path(&old_api_dir)
);
// `lib_path_in_built_distribution` points to the lib in the `built-distribution`
// directory, which is not under VCS. We will regenerate the API in this directory
Expand All @@ -640,23 +641,27 @@ impl RunContext {
match diff {
Ok(_) => Ok(()),
Err(err) => {
let suggested_cmd = built_enso
.cmd()?
.with_arg("--docs")
.with_arg("api")
.with_arg("--in-project")
.with_arg(lib.path.clone());
error!("API check failed for library Standard.{}", lib.name);
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 {}\"
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 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.

and commit the modified files",
old_api_dir.display(),
suggested_cmd.describe()
self.short_path(&old_api_dir).display(),
self.short_path(&lib.path).display()
);
bail!("API check failed for library Standard.{}", lib.name);
}
}
}

fn short_path(&self, full: &Path) -> PathBuf {
let strip = full.strip_prefix(self.repo_root.path.clone());
if let Ok(relative) = strip {
relative.to_path_buf()
} else {
full.to_path_buf()
}
}
}

#[derive(Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ as_hideable_value (value : Text | Enso_Secret | Derived_Secret_Value) factory=Hi
---
Used by library implementations to convert an Enso object into the Java
counterpart.
as_credential_reference (secret : Enso_Secret) -> CredentialReference =
as_credential_reference (secret : Enso_Secret) credential_reference=CredentialReference =
case secret.credential_metadata of
Nothing ->
Error.throw (Illegal_Argument.Error "Secret "+secret.name+" is not a credential.")
metadata ->
CredentialReference.new secret.id metadata.service_name
credential_reference.new secret.id metadata.service_name

## ---
private: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import Standard.Table.Internal.Java_Problems
import Standard.Table.Return_As_Table.Return_As_Table
import Standard.Table.Rows_To_Read.Rows_To_Read
from Standard.Table import Column, Headers, Table
from Standard.Table.Errors import Empty_Sheet, Invalid_Location, No_Rows
from Standard.Table.Errors import Invalid_Location, No_Rows
from Standard.Table.In_Memory_Table import from_java_table
from Standard.Table.Internal.Table_Helpers import duplicate_rows

import project.Internal.Telemetry

polyglot java import org.enso.table.problems.ProblemAggregator
polyglot java import org.enso.base.enso_cloud.ExternalLibraryCredentialHelper.CredentialReference
polyglot java import com.google.api.client.googleapis.json.GoogleJsonResponseException
polyglot java import org.enso.google.GoogleSheetsForEnso
polyglot java import org.enso.google.GoogleSheetsHeaders.HeaderBehavior
Expand Down Expand Up @@ -65,7 +67,7 @@ type Google_Sheets_Workbook
read self query:(Text|Integer) headers:Headers=..Detect_Headers limit:Rows_To_Read=..All_Rows skip_rows:Integer=0 on_problems:Problem_Behavior=..Report_Warning -> Table =
java_headers = _make_java_headers headers
java_limit = limit.rows_to_read
java_table = Java_Problems.with_problem_aggregator on_problems java_problem_aggregator-> _handle_exceptions <|
java_table = Java_Problems.with_problem_aggregator on_problems problem_aggregator=ProblemAggregator java_problem_aggregator-> _handle_exceptions <|
case query of
_ : Text -> self.java_service.getSheetRange self.workbook_id query java_headers java_limit skip_rows java_problem_aggregator
_ : Integer ->
Expand Down Expand Up @@ -167,14 +169,14 @@ type Google_API_Error
to_display_text self =
self.details.at 'message'

private _handle_exceptions ~action = Empty_Sheet.handle_java_exception <|
private _handle_exceptions ~action =
Panic.catch GoogleJsonResponseException action caught_panic->
Error.throw (Google_API_Error.Error caught_panic.payload.getContent.parse_json)

private _wrap_credentials credential:(File|Enso_Secret|Nothing)=Nothing =
case credential of
secret : Enso_Secret ->
WrappedGoogleCredentials.fromCredentialReference (as_credential_reference secret)
WrappedGoogleCredentials.fromCredentialReference (as_credential_reference secret CredentialReference)
secret_file : File ->
secret_file.with_input_stream [File_Access.Read] stream->
stream.with_java_stream java_input_stream->
Expand Down
3 changes: 1 addition & 2 deletions distribution/lib/Standard/Table/0.0.0-dev/src/Errors.enso
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import project.Value_Type.Value_Type
polyglot java import org.enso.table.error.ColumnCountMismatchException
polyglot java import org.enso.table.error.ColumnNameMismatchException
polyglot java import org.enso.table.error.EmptyFileException
polyglot java import org.enso.table.error.EmptySheetException
polyglot java import org.enso.table.error.InvalidColumnNameException
polyglot java import org.enso.table.read.FixedWidthLineTooLongException
polyglot java import org.enso.table.read.NoColumnNamesFoundException
Expand Down Expand Up @@ -421,7 +420,7 @@ type Empty_Sheet
private: true
---
handle_java_exception =
Panic.catch EmptySheetException handler=(_ -> Error.throw Empty_Sheet.Error)
Panic.recover Empty_Sheet

## Indicates that the column was already present in the table.
type Existing_Column
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from Standard.Base import all
from Standard.Base.Logging import all
import Standard.Base.Data.Vector.No_Wrap
import Standard.Base.Errors.Deprecated.Deprecated
import Standard.Base.Errors.Illegal_Argument.Illegal_Argument
Expand All @@ -18,6 +19,7 @@ import project.Table.Table
from project.Internal.Table_Type_Helpers import table_from_implementation

polyglot java import org.enso.table.data.column.DataQualityMetrics
polyglot java import org.enso.table.data.table.Column as Java_Column
polyglot java import org.enso.table.data.table.Table as Java_Table

## A table whose data is stored in memory.
Expand All @@ -35,9 +37,14 @@ type In_Memory_Table
## ---
private: true
---
A getter that is a workaround for bug
https://github.com/enso-org/enso/issues/12180
private java_table self = self.internal_java_table
A getter that allows one to specify the target Java type and handles
conversions when needed
private java_table self table_class=Java_Table column_class=Java_Column =
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
Copy link
Member Author

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 Table for Column (of the right class) delegating to proxy of the interface

table_class.new new_columns

## ---
private: true
Expand Down Expand Up @@ -88,7 +95,12 @@ type In_Memory_Table
Helper method for internal use to make a Table from a Java Table.
from_java_table java_table =
## Trigger data quality metrics computation (conditionally on Output context).
if Context.Output.is_enabled.not then DataQualityMetrics.triggerTable java_table
if Context.Output.is_enabled.not then
case java_table of
_:Java_Table ->
DataQualityMetrics.triggerTable java_table
_ ->
In_Memory_Table.log_message "Cannot compute DataQualityMetrics for "+java_table.to_text

Table_Refinements.refine_table <|
In_Memory_Table.Value java_table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ type In_Memory_Table_Implementation
[Row_Count_Mismatch.Error left_row_count right_row_count]
on_problems.attach_problems_before problems <|
new_java_table = Java_Problems.with_problem_aggregator on_problems java_aggregator->
(this_table:In_Memory_Table).java_table.zip (right:In_Memory_Table).java_table keep_unmatched_bool right_prefix java_aggregator
this_java_table = (this_table:In_Memory_Table).java_table
right_java_table = (right:In_Memory_Table).java_table
this_java_table.zip right_java_table keep_unmatched_bool right_prefix java_aggregator
from_java_table new_java_table

union (this_table : Table & In_Memory_Table) (tables : Table | Vector) columns_to_keep:Columns_To_Keep match_columns:Match_Columns on_problems:Problem_Behavior =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ polyglot java import org.enso.table.data.column.builder.LossOfBigDecimalPrecisio
polyglot java import org.enso.table.data.column.builder.LossOfIntegerPrecision
polyglot java import org.enso.table.data.column.operation.cast.ConversionFailure
polyglot java import org.enso.table.data.column.operation.cast.ConversionFailureType

# reflection access to various class methods and fields
# is being performed on problem classes, hence listing them here
# so EnsoLibraryFeature registers them for reflection
polyglot java import org.enso.table.data.table.problems.ArithmeticError
polyglot java import org.enso.table.data.table.problems.ArithmeticOverflow
polyglot java import org.enso.table.data.table.problems.FloatingPointGrouping
Expand All @@ -37,31 +41,31 @@ polyglot java import org.enso.table.util.problems.InvalidNames
private: true
---
Convert a Java problem into its Enso equivalent.
translate_problem p = case p of
_ : InvalidAggregation ->
translate_problem p = case p.problemType of
Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

Not sure I like this approach, and wonder if each Problem should be responsible for making an Enso object.

Copy link
Member Author

@JaroslavTulach JaroslavTulach Nov 12, 2025

Choose a reason for hiding this comment

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

  • this is 1:1 rewrite
    • it is easy to check it does the same as original code
    • making "Problem should be responsible for making an Enso object" is a bigger and non trivial change
  • I don't like this approach either
    • in my opinion the Java code should use EnsoMeta to directly instantiate the right Enso classes
    • then there would be no need for these conversions
  • e.g. using EnsoMeta as Testing EnsoMeta ability to load Enso types from Standard.Base #14287 demonstrates

"InvalidAggregation" ->
err = Invalid_Aggregation.Error p.getLocationName (Vector.from_polyglot_array p.getRows) p.getMessage
Error.throw err
_ : ArithmeticError ->
"ArithmeticError" ->
Arithmetic_Error.Error p.getMessage
_ : IllegalArgumentError ->
"IllegalArgumentError" ->
Illegal_Argument.Error p.getMessage
_ : IgnoredNaN ->
"IgnoredNaN" ->
Ignored_NaN_Values.Warning p.getLocationName (Vector.from_polyglot_array p.getRows)
_ : IgnoredNothing ->
"IgnoredNothing" ->
Ignored_Nothing_Values.Warning p.getLocationName (Vector.from_polyglot_array p.getRows)
_ : FloatingPointGrouping ->
"FloatingPointGrouping" ->
Floating_Point_Equality.Error p.getLocationName
_ : LossOfIntegerPrecision ->
"LossOfIntegerPrecision" ->
Loss_Of_Integer_Precision.Warning p.getAffectedRowsCount p.getExampleValue p.getExampleValueConverted
_ : LossOfBigDecimalPrecision ->
"LossOfBigDecimalPrecision" ->
Loss_Of_Decimal_Precision.Warning p.getAffectedRowsCount (java_to_enso p.getExampleValue) p.getExampleValueConverted
_ : ArithmeticOverflow ->
"ArithmeticOverflow" ->
target_type = Storage.to_value_type p.targetType
example_operands = case p.exampleOperands of
Nothing -> Nothing
array -> Vector.from_polyglot_array array
Arithmetic_Overflow.Warning target_type p.affectedRowCount example_operands
_ : ConversionFailure ->
"ConversionFailure" ->
examples = Vector.from_polyglot_array p.examples
target_type = Storage.to_value_type p.targetType
related_column = p.relatedColumn
Expand All @@ -70,23 +74,23 @@ translate_problem p = case p of
if p.errorType == ConversionFailureType.TEXT_TOO_LONG then Conversion_Failure.Text_Too_Long else
Conversion_Failure.Error
constructor target_type related_column affected_rows_count examples
_ : UnquotedCharactersInOutput ->
"UnquotedCharactersInOutput" ->
Unquoted_Characters_In_Output.Warning p.getLocationName (Vector.from_polyglot_array p.getRows)
_ : UnquotedDelimiter ->
"UnquotedDelimiter" ->
Unquoted_Delimiter.Error p.getLocationName (Vector.from_polyglot_array p.getRows)
_ : InvalidRow ->
"InvalidRow" ->
Invalid_Row.Error p.source_row p.table_index (Vector.from_polyglot_array p.row) p.expected_length
_ : InvalidFixedWidthRow ->
"InvalidFixedWidthRow" ->
Invalid_Fixed_Width_Row.Error p.source_line_number p.table_row_number p.line_length p.minimum_line_length
_ : InconsistentFixedWidthLengths ->
"InconsistentFixedWidthLengths" ->
Inconsistent_Fixed_Width_Lengths.Error
_ : AdditionalInvalidRows ->
"AdditionalInvalidRows" ->
Additional_Invalid_Rows.Error p.count
_ : DuplicateNames ->
"DuplicateNames" ->
Duplicate_Output_Column_Names.Error (Vector.from_polyglot_array p.duplicatedNames)
_ : InvalidNames ->
"InvalidNames" ->
Invalid_Column_Names.Error (Vector.from_polyglot_array p.invalidNames)
_ : InvalidFormat ->
"InvalidFormat" ->
Invalid_Format.Error p.column p.expectedEnsoValueType p.count (Vector.from_polyglot_array p.cells)
_ ->
Panic.throw (Illegal_Argument.Error "Encountered an unknown problem type when converting Java problems into Enso. This is a bug in the Table library. The unexpected problem was: "+p.to_text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@
import com.oracle.truffle.api.nodes.RootNode;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.function.Function;
import org.enso.jvm.interop.api.OtherJvmClassLoader;

final class JavaPolyglotNode {
static GenericForeignNode create(EpbContext context) {
try {
var isAot = TruffleOptions.AOT;
Function<String, Object> polyglotBindings =
(name) -> {
var lang = context.getEnv().getInternalLanguages().get(name);
return lang == null ? null : context.getEnv().getScopePublic(lang);
};
assert null != polyglotBindings;
var loader =
OtherJvmClassLoader.create(
"org.enso.jvm.interop", EpbLanguage.class, isAot, context.getEnv().getContext());
"org.enso.jvm.interop",
EpbLanguage.class,
polyglotBindings,
isAot,
context.getEnv().getContext());
var target = RootNode.createConstantNode(loader).getCallTarget();
return new GenericForeignNode(target);
} catch (URISyntaxException | IOException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,19 @@ static void close(EnsoContext ctx) {
private Object findPolyglotJava() throws InteropException {
TruffleSafepoint.setBlockedThreadInterruptible(null, Semaphore::acquire, lock);
try {
if (polyglotJava instanceof Throwable t) {
throw ctx.raiseAssertionPanic(null, t.getMessage(), t);
}
if (polyglotJava != this) {
return polyglotJava;
}
polyglotJava = createPolyglotJava(ctx);
try {
polyglotJava = createPolyglotJava(ctx);
} catch (Throwable t) {
logger.log(Level.ERROR, "Cannot initialize", t);
polyglotJava = t;
throw t;
}
while (!pendingPath.isEmpty()) {
InteropLibrary.getUncached()
.invokeMember(polyglotJava, "addPath", pendingPath.remove(0).toString());
Expand Down Expand Up @@ -246,7 +255,7 @@ private Object createPolyglotJava(EnsoContext ctx) throws IllegalStateException
} else {
var envJava = System.getenv("ENSO_JAVA");
if (envJava == null) {
logger.log(Level.ERROR, "Using experimental OtherJvm support!");
logger.log(Level.INFO, "Initializing OtherJvm support!");
var src = Source.newBuilder("epb", "java:0#guest", "<Bindings>").build();
var target = ctx.parseInternal(src);
return target.call();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private DataflowError(Object payload, AbstractTruffleException prototype) {
super(prototype);
this.payload = payload;
this.ownTrace = false;
this.ctx = prototype instanceof PanicException panic ? panic.ctx() : null;
this.ctx = prototype instanceof PanicException panic ? panic.ctx() : EnsoContext.get(null);
}

private DataflowError(Object payload, int stackTraceElementLimit, Node location) {
Expand Down Expand Up @@ -217,7 +217,7 @@ boolean isNull() {

@ExportMessage
RuntimeException throwException() throws UnsupportedMessageException {
return this;
return new PanicException(this);
}

@ExportMessage
Expand Down
Loading
Loading