-
Notifications
You must be signed in to change notification settings - Fork 328
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
Native Image run includes SPI for libraries that are not loaded, leading to crashes #11707
Comments
Note that the issue is further obscured by an @JaroslavTulach suggested that we should change the type of exception raised to avoid obscuring the real problem: Index: engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/TopLevelScope.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/TopLevelScope.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/TopLevelScope.java
--- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/TopLevelScope.java (revision a600180b634861d96972366c40c281251ded151b)
+++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/TopLevelScope.java (date 1732879071797)
@@ -22,6 +22,7 @@
import org.enso.interpreter.runtime.builtin.Builtins;
import org.enso.interpreter.runtime.data.EnsoObject;
import org.enso.interpreter.runtime.data.vector.ArrayLikeHelpers;
+import org.enso.interpreter.runtime.error.PanicException;
import org.enso.interpreter.runtime.type.Types;
import org.enso.pkg.Package;
import org.enso.pkg.QualifiedName;
@@ -125,12 +126,12 @@
abstract static class InvokeMember {
@CompilerDirectives.TruffleBoundary
private static Module getModule(TopLevelScope scope, Object[] arguments)
- throws ArityException, UnsupportedTypeException, UnknownIdentifierException {
+ throws ArityException, UnsupportedTypeException {
String moduleName = Types.extractArguments(arguments, String.class);
var module = scope.getModule(moduleName);
if (module.isEmpty()) {
- throw UnknownIdentifierException.create(moduleName);
+ throw new PanicException(scope.builtins.error().makeModuleDoesNotExistError(moduleName), null);
}
return module.get(); |
This has been uncovered during work on #11546 where I have tried 'fixing' the issue that
Base_Tests
used to depend onStandard.Table
.Apparently, when I run
Base_Tests
under Native Image without the Table import, theFileSystemSPI
still sees the registrations for file formats fromStandard.Table
. However, since theStandard.Table
is no longer loaded, trying to instantiate the modules related to these formats fails, causing our tests to fail.To make the tests pass I've re-introduced the
Standard.Table
import toBase_Tests
, but overall we should get rid of it.To reproduce the issue, remove the workaround that has been added in #11546 by applying the following patch:
Then you need to build the Native Image runner (
sbt engine-runner/buildNativeImage
) and run it. A small test that you can check out is e.g.:The text was updated successfully, but these errors were encountered: