From cb72487cc962a4f3adc37845639363ecf847f4a4 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Mon, 29 Jul 2024 09:49:14 +0200 Subject: [PATCH] ContextFactory reused to initialize language-server context (#10670) --- build.sbt | 8 ++ .../java/org/enso/common}/ContextFactory.java | 65 ++++++----- .../org/enso/common/HostAccessFactory.java | 21 ---- .../java/org/enso/common}/RuntimeOptions.java | 17 ++- .../dsl/test/ThrowableCatchTest.java | 2 +- .../TruffleContextInitialization.java | 25 ++--- .../enso/languageserver/boot/MainModule.scala | 50 ++++----- .../boot/ResourcesInitialization.scala | 4 +- .../scala/org/enso/polyglot/ApiTest.scala | 1 + .../enso/polyglot/ModuleManagementTest.scala | 2 + .../CompilerBasedDependencyExtractor.scala | 23 ++-- .../src/main/java/org/enso/runner/Main.java | 101 +++++++++++------- .../org/enso/compiler/benchmarks/Utils.java | 2 +- .../ExportImportResolutionBenchmark.java | 2 +- .../inline/InlineCompilerErrorBenchmark.java | 2 +- .../ImportStandardLibrariesBenchmark.java | 2 +- .../module/ManyErrorsBenchmark.java | 2 +- .../org/enso/compiler/ExecCompilerTest.java | 2 +- .../enso/compiler/ExecStrictCompilerTest.java | 2 +- .../compiler/ExportCycleDetectionTest.java | 2 +- .../enso/compiler/ExportedSymbolsTest.java | 2 +- .../ImportsAndFQNConsistencyTest.java | 2 +- .../org/enso/compiler/SerdeCompilerTest.java | 2 +- .../org/enso/compiler/SerializerTest.java | 2 +- .../interpreter/caches/ModuleCacheTest.java | 2 +- .../runtime/ModuleSourcesTest.java | 2 +- .../enso/interpreter/runtime/ModuleTest.java | 2 +- .../interpreter/test/DebuggingEnsoTest.java | 2 +- .../test/DiagnosticFormatterTest.java | 2 +- .../test/ExtensionMethodResolutionTest.java | 2 +- .../interpreter/test/NonStrictModeTests.java | 2 +- .../interpreter/test/SharedEngineTest.java | 2 +- .../test/TypeInferenceConsistencyTest.java | 2 +- .../test/exports/ExportConstructorTest.java | 2 +- .../exports/ExportConversionMethodTest.java | 2 +- .../exports/ExportExtensionMethodTest.java | 2 +- .../test/exports/ExportModuleTest.java | 2 +- .../exports/ExportResolutionOrderingTest.java | 2 +- .../test/exports/ExportStaticMethodTest.java | 2 +- .../test/imports/ImportSymbolsTest.java | 2 +- .../test/instrument/FunctionPointerTest.java | 2 +- .../WarningInstrumentationTest.java | 2 +- .../test/meta/EnsoProjectTest.java | 2 +- .../PrivateCheckDisabledTest.java | 2 +- .../PrivateConstructorAccessTest.java | 2 +- .../test/scope/ModuleScopeTest.java | 2 +- .../org/enso/compiler/test/ModifiedTest.scala | 3 +- .../test/semantic/ImportExportTest.scala | 2 +- .../interpreter/test/InterpreterTest.scala | 4 +- .../enso/interpreter/test/PackageTest.scala | 4 +- .../test/instrument/BuiltinTypesTest.scala | 2 +- .../instrument/RuntimeAsyncCommandsTest.scala | 2 +- .../instrument/RuntimeComponentsTest.scala | 2 +- .../test/instrument/RuntimeErrorsTest.scala | 2 +- .../RuntimeExecutionEnvironmentTest.scala | 2 +- .../instrument/RuntimeInstrumentTest.scala | 2 +- .../RuntimeProjectContextTest.scala | 2 +- .../instrument/RuntimeRefactoringTest.scala | 2 +- .../test/instrument/RuntimeServerTest.scala | 2 +- .../test/instrument/RuntimeStdlibTest.scala | 2 +- .../RuntimeSuggestionUpdatesTest.scala | 2 +- .../instrument/RuntimeTextEditsTest.scala | 2 +- .../test/instrument/RuntimeTypesTest.scala | 2 +- .../RuntimeVisualizationsTest.scala | 1 + .../test/semantic/ImportsTest.scala | 2 +- .../OverloadsResolutionErrorTest.scala | 2 +- .../StrictCompileDiagnosticsTest.scala | 2 +- .../org/enso/interpreter/EnsoLanguage.java | 2 +- .../org/enso/interpreter/OptionsHelper.java | 2 +- .../enso/interpreter/runtime/EnsoContext.java | 2 +- .../org/enso/test/utils/ContextUtils.java | 2 +- .../org/enso/test/utils/ProjectUtils.java | 2 +- .../main/java/org/enso/benchmarks/Utils.java | 2 +- .../benchmarks/processor/BenchProcessor.java | 4 +- .../enso/benchmarks/TestSpecCollector.java | 2 +- .../main/java/org/enso/logger/Converter.java | 6 +- tools/legal-review/engine/report-state | 2 +- 77 files changed, 231 insertions(+), 228 deletions(-) rename engine/{runner/src/main/java/org/enso/runner => common/src/main/java/org/enso/common}/ContextFactory.java (84%) delete mode 100644 engine/common/src/main/java/org/enso/common/HostAccessFactory.java rename engine/{polyglot-api/src/main/java/org/enso/polyglot => common/src/main/java/org/enso/common}/RuntimeOptions.java (95%) diff --git a/build.sbt b/build.sbt index d9f11cdbc2a..cde4f6c2012 100644 --- a/build.sbt +++ b/build.sbt @@ -1446,6 +1446,12 @@ val testLogProviderOptions = Seq( "-Dconfig.resource=application-test.conf" ) +/** engine/common project contains classes that are necessary to configure + * GraalVM's polyglot context. Most specifically it contains `ContextFactory`. + * As such it needs to depend on `org.graalvm.polyglot` package. Otherwise + * its dependencies shall be limited - no JSON & co. please. For purposes + * of consistently setting up loaders, the module depends on `logging-utils`. + */ lazy val `engine-common` = project .in(file("engine/common")) .settings( @@ -1457,6 +1463,8 @@ lazy val `engine-common` = project "org.graalvm.polyglot" % "polyglot" % graalMavenPackagesVersion % "provided" ) ) + .dependsOn(`logging-config`) + .dependsOn(`logging-utils`) .dependsOn(testkit % Test) lazy val `polyglot-api` = project diff --git a/engine/runner/src/main/java/org/enso/runner/ContextFactory.java b/engine/common/src/main/java/org/enso/common/ContextFactory.java similarity index 84% rename from engine/runner/src/main/java/org/enso/runner/ContextFactory.java rename to engine/common/src/main/java/org/enso/common/ContextFactory.java index e2581be369f..d63bf2ade94 100644 --- a/engine/runner/src/main/java/org/enso/runner/ContextFactory.java +++ b/engine/common/src/main/java/org/enso/common/ContextFactory.java @@ -1,19 +1,16 @@ -package org.enso.runner; +package org.enso.common; import java.io.File; import java.io.InputStream; import java.io.OutputStream; import java.util.Map; -import org.enso.common.HostAccessFactory; -import org.enso.common.LanguageInfo; + import org.enso.logger.Converter; import org.enso.logger.JulHandler; import org.enso.logger.LoggerSetup; -import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; -import org.enso.polyglot.debugger.DebugServerInfo; -import org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint; import org.graalvm.polyglot.Context; +import org.graalvm.polyglot.HostAccess; +import org.graalvm.polyglot.io.MessageTransport; import org.slf4j.event.Level; /** @@ -23,7 +20,6 @@ import org.slf4j.event.Level; * of any projects) * @param in the input stream for standard in * @param out the output stream for standard out - * @param repl the Repl manager to use for this context * @param logLevel the log level for this context * @param enableIrCaches whether or not IR caching should be enabled * @param disablePrivateCheck If `private` keyword should be disabled. @@ -34,11 +30,12 @@ import org.slf4j.event.Level; * @param executionEnvironment optional name of the execution environment to use during execution * @param warningsLimit maximal number of warnings reported to the user */ -final class ContextFactory { +public final class ContextFactory { private String projectRoot; - private InputStream in; - private OutputStream out; - private Repl repl; + private InputStream in = System.in; + private OutputStream out = System.out; + private OutputStream err = System.err; + private MessageTransport messageTransport; private Level logLevel; private boolean logMasking; private boolean enableIrCaches; @@ -72,8 +69,13 @@ final class ContextFactory { return this; } - public ContextFactory repl(Repl repl) { - this.repl = repl; + public ContextFactory err(OutputStream err) { + this.err = err; + return this; + } + + public ContextFactory messageTransport(MessageTransport t) { + this.messageTransport = t; return this; } @@ -132,7 +134,7 @@ final class ContextFactory { return this; } - PolyglotContext build() { + public Context build() { if (executionEnvironment != null) { options.put("enso.ExecutionEnvironment", executionEnvironment); } @@ -142,7 +144,7 @@ final class ContextFactory { Context.newBuilder() .allowExperimentalOptions(true) .allowAllAccess(true) - .allowHostAccess(new HostAccessFactory().allWithTypeMapping()) + .allowHostAccess(allWithTypeMapping()) .option(RuntimeOptions.PROJECT_ROOT, projectRoot) .option(RuntimeOptions.STRICT_ERRORS, Boolean.toString(strictErrors)) .option(RuntimeOptions.WAIT_FOR_PENDING_SERIALIZATION_JOBS, "true") @@ -152,19 +154,16 @@ final class ContextFactory { .option(RuntimeOptions.DISABLE_IR_CACHES, Boolean.toString(!enableIrCaches)) .option(RuntimeOptions.DISABLE_PRIVATE_CHECK, Boolean.toString(disablePrivateCheck)) .option(RuntimeOptions.ENABLE_STATIC_ANALYSIS, Boolean.toString(enableStaticAnalysis)) - .option(DebugServerInfo.ENABLE_OPTION, "true") .option(RuntimeOptions.LOG_MASKING, Boolean.toString(logMasking)) .options(options) .option(RuntimeOptions.ENABLE_AUTO_PARALLELISM, Boolean.toString(enableAutoParallelism)) .option(RuntimeOptions.WARNINGS_LIMIT, Integer.toString(warningsLimit)) .out(out) - .in(in) - .serverTransport( - (uri, peer) -> - DebugServerInfo.URI.equals(uri.toString()) - ? new DebuggerSessionManagerEndpoint(repl, peer) - : null); - + .err(err) + .in(in); + if (messageTransport != null) { + builder.serverTransport(messageTransport); + } builder.option(RuntimeOptions.LOG_LEVEL, logLevelName); var logHandler = JulHandler.get(); var logLevels = LoggerSetup.get().getConfig().getLoggers(); @@ -197,7 +196,7 @@ final class ContextFactory { .option("java.UseBindingsLoader", "true") .allowCreateThread(true); } - return new PolyglotContext(builder.build()); + return builder.build(); } /** @@ -217,4 +216,20 @@ final class ContextFactory { } ENGINE_HAS_JAVA = found; } + + private static HostAccess allWithTypeMapping() { + return HostAccess.newBuilder() + .allowPublicAccess(true) + .allowAllImplementations(true) + .allowAllClassImplementations(true) + .allowArrayAccess(true) + .allowListAccess(true) + .allowBufferAccess(true) + .allowIterableAccess(true) + .allowIteratorAccess(true) + .allowMapAccess(true) + .allowAccessInheritance(true) + .build(); + } + } diff --git a/engine/common/src/main/java/org/enso/common/HostAccessFactory.java b/engine/common/src/main/java/org/enso/common/HostAccessFactory.java deleted file mode 100644 index 7f06fcca808..00000000000 --- a/engine/common/src/main/java/org/enso/common/HostAccessFactory.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.enso.common; - -import org.graalvm.polyglot.HostAccess; - -/** Utility class for creating HostAccess object. */ -public class HostAccessFactory { - public HostAccess allWithTypeMapping() { - return HostAccess.newBuilder() - .allowPublicAccess(true) - .allowAllImplementations(true) - .allowAllClassImplementations(true) - .allowArrayAccess(true) - .allowListAccess(true) - .allowBufferAccess(true) - .allowIterableAccess(true) - .allowIteratorAccess(true) - .allowMapAccess(true) - .allowAccessInheritance(true) - .build(); - } -} diff --git a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java b/engine/common/src/main/java/org/enso/common/RuntimeOptions.java similarity index 95% rename from engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java rename to engine/common/src/main/java/org/enso/common/RuntimeOptions.java index 262982c0d64..2b5aaaf474e 100644 --- a/engine/polyglot-api/src/main/java/org/enso/polyglot/RuntimeOptions.java +++ b/engine/common/src/main/java/org/enso/common/RuntimeOptions.java @@ -1,15 +1,14 @@ -package org.enso.polyglot; +package org.enso.common; -import com.oracle.truffle.api.Option; import java.util.Arrays; -import org.enso.common.LanguageInfo; -import org.graalvm.options.OptionCategory; + import org.graalvm.options.OptionDescriptor; import org.graalvm.options.OptionDescriptors; import org.graalvm.options.OptionKey; /** Class representing runtime options supported by the Enso engine. */ -public class RuntimeOptions { +public final class RuntimeOptions { + private RuntimeOptions() {} public static final String PROJECT_ROOT = optionName("projectRoot"); public static final OptionKey PROJECT_ROOT_KEY = new OptionKey<>(""); private static final OptionDescriptor PROJECT_ROOT_DESCRIPTOR = @@ -124,9 +123,7 @@ public class RuntimeOptions { public static final String ENABLE_EXECUTION_TIMER = optionName("enableExecutionTimer"); - @Option( - help = "Enables timer that counts down the execution time of expressions.", - category = OptionCategory.INTERNAL) + /* Enables timer that counts down the execution time of expressions. */ public static final OptionKey ENABLE_EXECUTION_TIMER_KEY = new OptionKey<>(true); private static final OptionDescriptor ENABLE_EXECUTION_TIMER_DESCRIPTOR = @@ -134,9 +131,7 @@ public class RuntimeOptions { public static final String WARNINGS_LIMIT = optionName("warningsLimit"); - @Option( - help = "Maximal number of warnings that can be attached to a value.", - category = OptionCategory.INTERNAL) + /* Maximal number of warnings that can be attached to a value. */ public static final OptionKey WARNINGS_LIMIT_KEY = new OptionKey<>(100); private static final OptionDescriptor WARNINGS_LIMIT_DESCRIPTOR = diff --git a/engine/interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test/ThrowableCatchTest.java b/engine/interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test/ThrowableCatchTest.java index eb9768be87a..d4e98b18a42 100644 --- a/engine/interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test/ThrowableCatchTest.java +++ b/engine/interpreter-dsl-test/src/test/java/org/enso/interpreter/dsl/test/ThrowableCatchTest.java @@ -10,13 +10,13 @@ import java.util.function.Supplier; import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames.TopScope; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.EnsoLanguage; import org.enso.interpreter.runtime.EnsoContext; import org.enso.interpreter.runtime.callable.function.Function; import org.enso.interpreter.runtime.data.text.Text; import org.enso.interpreter.runtime.error.DataflowError; import org.enso.interpreter.runtime.error.PanicException; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.io.IOAccess; import org.junit.After; diff --git a/engine/language-server/src/main/java/org/enso/languageserver/boot/resource/TruffleContextInitialization.java b/engine/language-server/src/main/java/org/enso/languageserver/boot/resource/TruffleContextInitialization.java index dda86331b92..2a84c29b7f9 100644 --- a/engine/language-server/src/main/java/org/enso/languageserver/boot/resource/TruffleContextInitialization.java +++ b/engine/language-server/src/main/java/org/enso/languageserver/boot/resource/TruffleContextInitialization.java @@ -2,18 +2,17 @@ package org.enso.languageserver.boot.resource; import akka.event.EventStream; import java.util.concurrent.Executor; +import org.enso.common.ContextFactory; import org.enso.common.LanguageInfo; import org.enso.languageserver.boot.ComponentSupervisor; import org.enso.languageserver.event.InitializedEvent; -import org.graalvm.polyglot.Context; -import org.graalvm.polyglot.Engine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** Initialize the Truffle context. */ public class TruffleContextInitialization extends LockedInitialization { - private final Context.Builder truffleContextBuilder; + private final ContextFactory contextFactory; private final ComponentSupervisor supervisor; private final EventStream eventStream; @@ -24,15 +23,16 @@ public class TruffleContextInitialization extends LockedInitialization { * * @param executor the executor that runs the initialization * @param eventStream the events stream - * @param truffleContextBuilder the Truffle context builder + * @param supervisor supervisor + * @param factory the Truffle context builder */ public TruffleContextInitialization( Executor executor, - Context.Builder truffleContextBuilder, + ContextFactory factory, ComponentSupervisor supervisor, EventStream eventStream) { super(executor); - this.truffleContextBuilder = truffleContextBuilder; + this.contextFactory = factory; this.supervisor = supervisor; this.eventStream = eventStream; } @@ -40,18 +40,7 @@ public class TruffleContextInitialization extends LockedInitialization { @Override public void initComponent() { logger.trace("Creating Runtime context"); - if (Engine.newBuilder() - .allowExperimentalOptions(true) - .build() - .getLanguages() - .containsKey("java")) { - truffleContextBuilder - .option("java.ExposeNativeJavaVM", "true") - .option("java.Polyglot", "true") - .option("java.UseBindingsLoader", "true") - .allowCreateThread(true); - } - var truffleContext = truffleContextBuilder.build(); + var truffleContext = contextFactory.build(); supervisor.registerService(truffleContext); logger.trace("Created Runtime context [{}]", truffleContext); logger.debug("Initializing Runtime context [{}]", truffleContext); diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/boot/MainModule.scala b/engine/language-server/src/main/scala/org/enso/languageserver/boot/MainModule.scala index 797ea4b2288..baddd721a6c 100644 --- a/engine/language-server/src/main/scala/org/enso/languageserver/boot/MainModule.scala +++ b/engine/language-server/src/main/scala/org/enso/languageserver/boot/MainModule.scala @@ -46,16 +46,14 @@ import org.enso.librarymanager.LibraryLocations import org.enso.librarymanager.local.DefaultLocalLibraryProvider import org.enso.librarymanager.published.PublishedLibraryCache import org.enso.lockmanager.server.LockManagerService -import org.enso.logger.Converter import org.enso.logger.masking.Masking -import org.enso.logger.JulHandler import org.enso.logger.akka.AkkaConverter -import org.enso.common.HostAccessFactory -import org.enso.polyglot.{RuntimeOptions, RuntimeServerInfo} +import org.enso.common.RuntimeOptions +import org.enso.common.ContextFactory +import org.enso.polyglot.RuntimeServerInfo import org.enso.profiling.events.NoopEventsMonitor import org.enso.searcher.memory.InMemorySuggestionsRepo import org.enso.text.{ContentBasedVersioning, Sha3_224VersionCalculator} -import org.graalvm.polyglot.Context import org.graalvm.polyglot.io.MessageEndpoint import org.slf4j.event.Level import org.slf4j.LoggerFactory @@ -307,31 +305,29 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) { val stdInSink = new ObservableOutputStream val stdIn = new ObservablePipedInputStream(stdInSink) - val builder = Context - .newBuilder() - .allowAllAccess(true) - .allowHostAccess(new HostAccessFactory().allWithTypeMapping()) - .allowExperimentalOptions(true) - .option(RuntimeServerInfo.ENABLE_OPTION, "true") - .option(RuntimeOptions.INTERACTIVE_MODE, "true") - .option(RuntimeOptions.PROJECT_ROOT, serverConfig.contentRootPath) - .option( - RuntimeOptions.LOG_LEVEL, - Converter.toJavaLevel(logLevel).getName - ) - .option(RuntimeOptions.STRICT_ERRORS, "false") - .option(RuntimeOptions.LOG_MASKING, Masking.isMaskingEnabled.toString) - .option(RuntimeOptions.EDITION_OVERRIDE, Info.currentEdition) - .option( - RuntimeOptions.JOB_PARALLELISM, - Runtime.getRuntime.availableProcessors().toString - ) - .option(RuntimeOptions.PREINITIALIZE, "js") + val extraOptions = new java.util.HashMap[String, String]() + extraOptions.put(RuntimeServerInfo.ENABLE_OPTION, "true") + extraOptions.put(RuntimeOptions.INTERACTIVE_MODE, "true") + extraOptions.put( + RuntimeOptions.LOG_MASKING, + Masking.isMaskingEnabled.toString + ) + extraOptions.put(RuntimeOptions.EDITION_OVERRIDE, Info.currentEdition) + extraOptions.put( + RuntimeOptions.JOB_PARALLELISM, + Runtime.getRuntime.availableProcessors().toString + ) + + val builder = ContextFactory + .create() + .projectRoot(serverConfig.contentRootPath) + .logLevel(logLevel) + .strictErrors(false) .out(stdOut) .err(stdErr) .in(stdIn) - .logHandler(JulHandler.get()) - .serverTransport((uri: URI, peerEndpoint: MessageEndpoint) => { + .options(extraOptions) + .messageTransport((uri: URI, peerEndpoint: MessageEndpoint) => { if (uri.toString == RuntimeServerInfo.URI) { val connection = new RuntimeConnector.Endpoint( runtimeConnector, diff --git a/engine/language-server/src/main/scala/org/enso/languageserver/boot/ResourcesInitialization.scala b/engine/language-server/src/main/scala/org/enso/languageserver/boot/ResourcesInitialization.scala index 03b0a760d48..058e5bcd051 100644 --- a/engine/language-server/src/main/scala/org/enso/languageserver/boot/ResourcesInitialization.scala +++ b/engine/language-server/src/main/scala/org/enso/languageserver/boot/ResourcesInitialization.scala @@ -16,7 +16,7 @@ import org.enso.languageserver.boot.resource.{ import org.enso.languageserver.data.ProjectDirectoriesConfig import org.enso.languageserver.effect import org.enso.searcher.memory.InMemorySuggestionsRepo -import org.graalvm.polyglot.Context +import org.enso.common.ContextFactory import scala.concurrent.ExecutionContextExecutor @@ -41,7 +41,7 @@ object ResourcesInitialization { directoriesConfig: ProjectDirectoriesConfig, protocolFactory: ProtocolFactory, suggestionsRepo: InMemorySuggestionsRepo, - truffleContextBuilder: Context#Builder, + truffleContextBuilder: ContextFactory, truffleContextSupervisor: ComponentSupervisor, runtime: effect.Runtime, ydocSupervisor: ComponentSupervisor diff --git a/engine/polyglot-api/src/test/scala/org/enso/polyglot/ApiTest.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/ApiTest.scala index b26b0d080c2..174526eed72 100644 --- a/engine/polyglot-api/src/test/scala/org/enso/polyglot/ApiTest.scala +++ b/engine/polyglot-api/src/test/scala/org/enso/polyglot/ApiTest.scala @@ -1,5 +1,6 @@ package org.enso.polyglot +import org.enso.common.RuntimeOptions import org.graalvm.polyglot.Context import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/engine/polyglot-api/src/test/scala/org/enso/polyglot/ModuleManagementTest.scala b/engine/polyglot-api/src/test/scala/org/enso/polyglot/ModuleManagementTest.scala index 68ba211c13e..9be2ea37c33 100644 --- a/engine/polyglot-api/src/test/scala/org/enso/polyglot/ModuleManagementTest.scala +++ b/engine/polyglot-api/src/test/scala/org/enso/polyglot/ModuleManagementTest.scala @@ -1,5 +1,7 @@ package org.enso.polyglot +import org.enso.common.RuntimeOptions + import java.io.File import java.nio.file.{Files, Paths} import org.enso.pkg.{Package, PackageManager} diff --git a/engine/runner-common/src/main/scala/org/enso/runner/common/CompilerBasedDependencyExtractor.scala b/engine/runner-common/src/main/scala/org/enso/runner/common/CompilerBasedDependencyExtractor.scala index f0519486608..80aa43afb0b 100644 --- a/engine/runner-common/src/main/scala/org/enso/runner/common/CompilerBasedDependencyExtractor.scala +++ b/engine/runner-common/src/main/scala/org/enso/runner/common/CompilerBasedDependencyExtractor.scala @@ -2,14 +2,11 @@ package org.enso.runner.common import org.enso.editions.LibraryName import org.enso.libraryupload.DependencyExtractor -import org.enso.logger.Converter -import org.enso.logger.JulHandler import org.enso.pkg.Package import org.enso.pkg.SourceFile -import org.enso.common.HostAccessFactory -import org.enso.polyglot.{PolyglotContext, RuntimeOptions} -import org.graalvm.polyglot.Context +import org.enso.polyglot.PolyglotContext +import org.enso.common.ContextFactory import org.slf4j.event.Level import java.io.File @@ -55,18 +52,10 @@ class CompilerBasedDependencyExtractor(logLevel: Level) * project root. */ private def createContextWithProject(pkg: Package[File]): PolyglotContext = { - val context = Context - .newBuilder() - .allowExperimentalOptions(true) - .allowAllAccess(true) - .allowHostAccess(new HostAccessFactory().allWithTypeMapping()) - .option(RuntimeOptions.PROJECT_ROOT, pkg.root.getCanonicalPath) - .option("js.foreign-object-prototype", "true") - .option( - RuntimeOptions.LOG_LEVEL, - Converter.toJavaLevel(logLevel).getName - ) - .logHandler(JulHandler.get()) + val context = ContextFactory + .create() + .projectRoot(pkg.root.getCanonicalPath) + .logLevel(logLevel) .build new PolyglotContext(context) } diff --git a/engine/runner/src/main/java/org/enso/runner/Main.java b/engine/runner/src/main/java/org/enso/runner/Main.java index 947cd5e4956..98c882bfd8d 100644 --- a/engine/runner/src/main/java/org/enso/runner/Main.java +++ b/engine/runner/src/main/java/org/enso/runner/Main.java @@ -22,6 +22,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionGroup; import org.apache.commons.cli.Options; +import org.enso.common.ContextFactory; import org.enso.common.HostEnsoUtils; import org.enso.common.LanguageInfo; import org.enso.distribution.DistributionManager; @@ -34,6 +35,8 @@ import org.enso.pkg.PackageManager$; import org.enso.pkg.Template; import org.enso.polyglot.Module; import org.enso.polyglot.PolyglotContext; +import org.enso.polyglot.debugger.DebugServerInfo; +import org.enso.polyglot.debugger.DebuggerSessionManagerEndpoint; import org.enso.profiling.sampler.NoopSampler; import org.enso.profiling.sampler.OutputStreamSampler; import org.enso.runner.common.LanguageServerApi; @@ -43,6 +46,7 @@ import org.enso.version.VersionDescription; import org.graalvm.polyglot.PolyglotException; import org.graalvm.polyglot.PolyglotException.StackFrame; import org.graalvm.polyglot.SourceSection; +import org.graalvm.polyglot.io.MessageTransport; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; import scala.Option$; @@ -617,18 +621,18 @@ public final class Main { } var context = - ContextFactory.create() - .projectRoot(packagePath) - .in(System.in) - .out(System.out) - .repl(new Repl(makeTerminalForRepl())) - .logLevel(logLevel) - .logMasking(logMasking) - .enableIrCaches(true) - .enableStaticAnalysis(enableStaticAnalysis) - .strictErrors(true) - .useGlobalIrCacheLocation(shouldUseGlobalCache) - .build(); + new PolyglotContext( + ContextFactory.create() + .projectRoot(packagePath) + .in(System.in) + .out(System.out) + .logLevel(logLevel) + .logMasking(logMasking) + .enableIrCaches(true) + .enableStaticAnalysis(enableStaticAnalysis) + .strictErrors(true) + .useGlobalIrCacheLocation(shouldUseGlobalCache) + .build()); var topScope = context.getTopScope(); try { @@ -688,15 +692,10 @@ public final class Main { options.put("engine.TraceCompilation", "true"); options.put("engine.MultiTier", "false"); } - if (inspect) { - options.put("inspect", ""); - } - var context = + + var factory = ContextFactory.create() .projectRoot(projectRoot) - .in(System.in) - .out(System.out) - .repl(new Repl(makeTerminalForRepl())) .logLevel(logLevel) .logMasking(logMasking) .enableIrCaches(enableIrCaches) @@ -706,8 +705,16 @@ public final class Main { .enableStaticAnalysis(enableStaticAnalysis) .executionEnvironment(executionEnvironment != null ? executionEnvironment : "live") .warningsLimit(warningsLimit) - .options(options) - .build(); + .options(options); + + if (inspect) { + options.put("inspect", ""); + } else { + // by default running with debug server enabled + factory.messageTransport(replTransport()); + options.put(DebugServerInfo.ENABLE_OPTION, "true"); + } + var context = new PolyglotContext(factory.build()); if (projectMode) { var result = PackageManager$.MODULE$.Default().loadPackage(file); @@ -761,15 +768,15 @@ public final class Main { private void generateDocsFrom( String path, Level logLevel, boolean logMasking, boolean enableIrCaches) { var executionContext = - ContextFactory.create() - .projectRoot(path) - .in(System.in) - .out(System.out) - .repl(new Repl(makeTerminalForRepl())) - .logLevel(logLevel) - .logMasking(logMasking) - .enableIrCaches(enableIrCaches) - .build(); + new PolyglotContext( + ContextFactory.create() + .projectRoot(path) + .in(System.in) + .out(System.out) + .logLevel(logLevel) + .logMasking(logMasking) + .enableIrCaches(enableIrCaches) + .build()); var file = new File(path); var pkg = PackageManager.Default().fromDirectory(file); @@ -908,22 +915,34 @@ public final class Main { .replace("$mainMethodName", mainMethodName); var replModuleName = "Internal_Repl_Module___"; var projectRoot = projectPath != null ? projectPath : ""; + var options = Collections.singletonMap(DebugServerInfo.ENABLE_OPTION, "true"); + var context = - ContextFactory.create() - .projectRoot(projectRoot) - .in(System.in) - .out(System.out) - .repl(new Repl(makeTerminalForRepl())) - .logLevel(logLevel) - .logMasking(logMasking) - .enableIrCaches(enableIrCaches) - .enableStaticAnalysis(enableStaticAnalysis) - .build(); + new PolyglotContext( + ContextFactory.create() + .projectRoot(projectRoot) + .messageTransport(replTransport()) + .options(options) + .logLevel(logLevel) + .logMasking(logMasking) + .enableIrCaches(enableIrCaches) + .enableStaticAnalysis(enableStaticAnalysis) + .build()); var mainModule = context.evalModule(dummySourceToTriggerRepl, replModuleName); runMain(mainModule, null, Collections.emptyList(), mainMethodName); throw exitSuccess(); } + private static MessageTransport replTransport() { + var repl = new Repl(makeTerminalForRepl()); + MessageTransport transport = + (uri, peer) -> + DebugServerInfo.URI.equals(uri.toString()) + ? new DebuggerSessionManagerEndpoint(repl, peer) + : null; + return transport; + } + /** * Prints the version of the Enso executable. * @@ -1365,7 +1384,7 @@ public final class Main { }); } catch (IOException ex) { System.err.println(ex.getMessage()); - exitFail(); + throw exitFail(); } } catch (WrongOption e) { System.err.println(e.getMessage()); diff --git a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/Utils.java b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/Utils.java index 6c06dd494ac..56205100db1 100644 --- a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/Utils.java +++ b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/Utils.java @@ -12,8 +12,8 @@ import java.nio.file.Paths; import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.EnsoContext; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Value; import org.graalvm.polyglot.io.IOAccess; diff --git a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/exportimport/ExportImportResolutionBenchmark.java b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/exportimport/ExportImportResolutionBenchmark.java index bd74ccfbe18..232d8af29e9 100644 --- a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/exportimport/ExportImportResolutionBenchmark.java +++ b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/exportimport/ExportImportResolutionBenchmark.java @@ -8,6 +8,7 @@ import java.nio.file.Path; import java.util.Set; import java.util.concurrent.TimeUnit; import org.enso.common.CompilationStage; +import org.enso.common.RuntimeOptions; import org.enso.compiler.benchmarks.Utils; import org.enso.compiler.context.CompilerContext; import org.enso.compiler.phase.ImportResolver; @@ -15,7 +16,6 @@ import org.enso.compiler.phase.exports.ExportCycleException; import org.enso.compiler.phase.exports.ExportsResolution; import org.enso.interpreter.runtime.Module; import org.enso.pkg.QualifiedName; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.enso.test.utils.SourceModule; diff --git a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/inline/InlineCompilerErrorBenchmark.java b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/inline/InlineCompilerErrorBenchmark.java index c30d26a851d..f0bfde5c07c 100644 --- a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/inline/InlineCompilerErrorBenchmark.java +++ b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/inline/InlineCompilerErrorBenchmark.java @@ -4,9 +4,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.concurrent.TimeUnit; +import org.enso.common.RuntimeOptions; import org.enso.compiler.Compiler; import org.enso.compiler.benchmarks.Utils; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; diff --git a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ImportStandardLibrariesBenchmark.java b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ImportStandardLibrariesBenchmark.java index 80d4a24f460..1b9d15a931d 100644 --- a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ImportStandardLibrariesBenchmark.java +++ b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ImportStandardLibrariesBenchmark.java @@ -9,11 +9,11 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.compiler.Compiler; import org.enso.compiler.benchmarks.Utils; import org.enso.interpreter.runtime.Module; import org.enso.interpreter.runtime.data.Type; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Source; import org.openjdk.jmh.annotations.Benchmark; diff --git a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ManyErrorsBenchmark.java b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ManyErrorsBenchmark.java index 40e7ef87032..a077a5bc01f 100644 --- a/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ManyErrorsBenchmark.java +++ b/engine/runtime-benchmarks/src/main/java/org/enso/compiler/benchmarks/module/ManyErrorsBenchmark.java @@ -8,12 +8,12 @@ import java.util.Random; import java.util.concurrent.TimeUnit; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.compiler.Compiler; import org.enso.compiler.benchmarks.CodeGenerator; import org.enso.compiler.benchmarks.Utils; import org.enso.interpreter.runtime.Module; import org.enso.interpreter.runtime.data.Type; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Source; import org.openjdk.jmh.annotations.Benchmark; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java index d83891b7b58..bc9f0cf7fbf 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java @@ -15,8 +15,8 @@ import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; import org.enso.common.MethodNames.Module; +import org.enso.common.RuntimeOptions; import org.enso.compiler.core.ir.expression.errors.Conversion.DeclaredAsPrivate$; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; import org.graalvm.polyglot.Source; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecStrictCompilerTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecStrictCompilerTest.java index 8481764530e..6464f30aeb7 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecStrictCompilerTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecStrictCompilerTest.java @@ -12,7 +12,7 @@ import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.logging.Level; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; import org.graalvm.polyglot.Source; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportCycleDetectionTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportCycleDetectionTest.java index 91542b5515e..d6fe43456c2 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportCycleDetectionTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportCycleDetectionTest.java @@ -11,9 +11,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.file.Path; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportedSymbolsTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportedSymbolsTest.java index 7a7c22259cc..ba4e187dcfe 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportedSymbolsTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExportedSymbolsTest.java @@ -13,11 +13,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.context.CompilerContext.Module; import org.enso.compiler.data.BindingsMap; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.enso.test.utils.SourceModule; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ImportsAndFQNConsistencyTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ImportsAndFQNConsistencyTest.java index dbd08eb1b4e..c9a49cd53f2 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ImportsAndFQNConsistencyTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/ImportsAndFQNConsistencyTest.java @@ -10,13 +10,13 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import org.enso.common.LanguageInfo; +import org.enso.common.RuntimeOptions; import org.enso.compiler.core.ir.module.scope.Definition; import org.enso.compiler.core.ir.module.scope.definition.Method; import org.enso.compiler.data.BindingsMap.ResolvedConstructor; import org.enso.compiler.data.BindingsMap.ResolvedModule; import org.enso.compiler.data.BindingsMap.ResolvedType; import org.enso.interpreter.runtime.EnsoContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.junit.AfterClass; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerdeCompilerTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerdeCompilerTest.java index c9f9d5ce043..e35ed9a6989 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerdeCompilerTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerdeCompilerTest.java @@ -19,10 +19,10 @@ import java.util.logging.LogRecord; import java.util.logging.SimpleFormatter; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.compiler.core.ir.Module; import org.enso.interpreter.runtime.EnsoContext; import org.enso.pkg.PackageManager; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.io.IOAccess; import org.junit.Test; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerializerTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerializerTest.java index fc55a071e44..83571047d95 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerializerTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/SerializerTest.java @@ -11,9 +11,9 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.EnsoContext; import org.enso.pkg.PackageManager; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.io.IOAccess; import org.junit.Test; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/caches/ModuleCacheTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/caches/ModuleCacheTest.java index 8551d761584..0544debc93b 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/caches/ModuleCacheTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/caches/ModuleCacheTest.java @@ -8,9 +8,9 @@ import java.nio.ByteBuffer; import org.enso.common.CompilationStage; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.compiler.CompilerTest; import org.enso.interpreter.runtime.EnsoContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Source; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleSourcesTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleSourcesTest.java index d99dfc49376..c23ba56682a 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleSourcesTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleSourcesTest.java @@ -8,7 +8,7 @@ import java.nio.file.Paths; import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.enso.text.buffer.Rope$; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Engine; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleTest.java index 14dedd0c229..fa0d73242f7 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/runtime/ModuleTest.java @@ -11,10 +11,10 @@ import java.nio.file.Paths; import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames; +import org.enso.common.RuntimeOptions; import org.enso.compiler.data.BindingsMap; import org.enso.compiler.data.BindingsMap$ModuleReference$Concrete; import org.enso.pkg.QualifiedName; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Engine; import org.graalvm.polyglot.Source; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java index e74cbf3d745..391b432e93f 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DebuggingEnsoTest.java @@ -32,7 +32,7 @@ import java.util.TreeSet; import java.util.logging.Level; import java.util.stream.Collectors; import org.enso.common.MethodNames.Module; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Engine; import org.graalvm.polyglot.Language; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DiagnosticFormatterTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DiagnosticFormatterTest.java index e6e525692ea..e0b1d7f176d 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DiagnosticFormatterTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/DiagnosticFormatterTest.java @@ -15,10 +15,10 @@ import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames.Module; import org.enso.common.MethodNames.TopScope; +import org.enso.common.RuntimeOptions; import org.enso.compiler.core.ir.Diagnostic; import org.enso.interpreter.runtime.EnsoContext; import org.enso.interpreter.runtime.util.DiagnosticFormatter; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; import org.graalvm.polyglot.io.IOAccess; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/ExtensionMethodResolutionTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/ExtensionMethodResolutionTest.java index 3a59af63abd..ffb406021e3 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/ExtensionMethodResolutionTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/ExtensionMethodResolutionTest.java @@ -10,9 +10,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.file.Path; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.polyglot.TopScope; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/NonStrictModeTests.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/NonStrictModeTests.java index 9c211df5321..2dc5f952b34 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/NonStrictModeTests.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/NonStrictModeTests.java @@ -4,7 +4,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Map; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Language; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/SharedEngineTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/SharedEngineTest.java index 14c07c3c997..4ea2b951466 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/SharedEngineTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/SharedEngineTest.java @@ -4,7 +4,7 @@ import static org.junit.Assert.assertEquals; import java.nio.file.Paths; import java.util.logging.Level; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Engine; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/TypeInferenceConsistencyTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/TypeInferenceConsistencyTest.java index 597bb8a243b..1221c4f554f 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/TypeInferenceConsistencyTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/TypeInferenceConsistencyTest.java @@ -5,7 +5,7 @@ import static org.junit.Assert.*; import java.io.ByteArrayOutputStream; import java.net.URI; import org.enso.common.MethodNames; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConstructorTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConstructorTest.java index 558b9f056de..1856f2173ae 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConstructorTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConstructorTest.java @@ -8,9 +8,9 @@ import static org.hamcrest.Matchers.is; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConversionMethodTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConversionMethodTest.java index c0dabd1bc24..d79110c4b90 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConversionMethodTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportConversionMethodTest.java @@ -8,10 +8,10 @@ import static org.hamcrest.Matchers.is; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.data.BindingsMap.ResolvedConversionMethod; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportExtensionMethodTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportExtensionMethodTest.java index 396e44a1f71..d2196b100f9 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportExtensionMethodTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportExtensionMethodTest.java @@ -7,10 +7,10 @@ import static org.hamcrest.Matchers.is; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.data.BindingsMap.DefinedEntity; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportModuleTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportModuleTest.java index 217dfab4c2c..83b1026acce 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportModuleTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportModuleTest.java @@ -7,10 +7,10 @@ import static org.hamcrest.Matchers.is; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.data.BindingsMap.ResolvedModule; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportResolutionOrderingTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportResolutionOrderingTest.java index d5d93dddc88..52f88b98054 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportResolutionOrderingTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportResolutionOrderingTest.java @@ -8,11 +8,11 @@ import java.io.IOException; import java.nio.file.Path; import java.util.List; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.phase.exports.ExportsResolution; import org.enso.interpreter.runtime.Module; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportStaticMethodTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportStaticMethodTest.java index a0e4f825ae4..b49f7952765 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportStaticMethodTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/exports/ExportStaticMethodTest.java @@ -7,9 +7,9 @@ import static org.hamcrest.Matchers.is; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/imports/ImportSymbolsTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/imports/ImportSymbolsTest.java index 57666230e59..8d533d91b78 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/imports/ImportSymbolsTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/imports/ImportSymbolsTest.java @@ -9,10 +9,10 @@ import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Set; +import org.enso.common.RuntimeOptions; import org.enso.compiler.data.BindingsMap.ResolvedType; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ModuleUtils; import org.enso.test.utils.ProjectUtils; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/FunctionPointerTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/FunctionPointerTest.java index 7c8654a830d..ba55683bd23 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/FunctionPointerTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/FunctionPointerTest.java @@ -7,10 +7,10 @@ import static org.junit.Assert.assertTrue; import java.nio.file.Paths; import java.util.Map; import java.util.logging.Level; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.callable.function.Function; import org.enso.interpreter.runtime.data.atom.AtomConstructor; import org.enso.interpreter.service.ExecutionService.FunctionPointer; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Language; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/WarningInstrumentationTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/WarningInstrumentationTest.java index 3872f7df6bc..daacaf7724b 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/WarningInstrumentationTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/instrument/WarningInstrumentationTest.java @@ -8,11 +8,11 @@ import com.oracle.truffle.api.instrumentation.StandardTags; import java.nio.file.Paths; import java.util.Map; import java.util.logging.Level; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.tag.AvoidIdInstrumentationTag; import org.enso.interpreter.runtime.tag.IdentifiedTag; import org.enso.interpreter.test.Metadata; import org.enso.interpreter.test.instruments.NodeCountingTestInstrument; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Language; import org.graalvm.polyglot.Source; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/meta/EnsoProjectTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/meta/EnsoProjectTest.java index a8f28fc66b2..7ba0eb5a131 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/meta/EnsoProjectTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/meta/EnsoProjectTest.java @@ -8,10 +8,10 @@ import java.io.IOException; import java.util.List; import java.util.Set; import org.enso.common.LanguageInfo; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.util.ScalaConversions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.enso.test.utils.SourceModule; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateCheckDisabledTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateCheckDisabledTest.java index c63ce8addca..58873297284 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateCheckDisabledTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateCheckDisabledTest.java @@ -4,7 +4,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import java.io.IOException; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.junit.Rule; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateConstructorAccessTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateConstructorAccessTest.java index 1d5d4f241ae..43bb97e23f5 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateConstructorAccessTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/privateaccess/PrivateConstructorAccessTest.java @@ -10,9 +10,9 @@ import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.List; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.util.ScalaConversions; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.graalvm.polyglot.PolyglotException; diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/scope/ModuleScopeTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/scope/ModuleScopeTest.java index 2f8eb30e31d..46d536f3c99 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/scope/ModuleScopeTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/interpreter/test/scope/ModuleScopeTest.java @@ -7,10 +7,10 @@ import static org.hamcrest.Matchers.notNullValue; import java.io.IOException; import java.util.Set; import org.enso.common.LanguageInfo; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.Module; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.enso.test.utils.ContextUtils; import org.enso.test.utils.ProjectUtils; import org.enso.test.utils.SourceModule; diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/ModifiedTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/ModifiedTest.scala index 7ee9abb409c..17896c58865 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/ModifiedTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/ModifiedTest.scala @@ -5,7 +5,8 @@ import org.apache.commons.io.filefilter.{IOFileFilter, TrueFileFilter} import org.enso.interpreter.test.{InterpreterException, ValueEquality} import org.enso.pkg.PackageManager import org.enso.common.LanguageInfo -import org.enso.polyglot.{PolyglotContext, RuntimeOptions} +import org.enso.common.RuntimeOptions +import org.enso.polyglot.PolyglotContext import org.graalvm.polyglot.{Context, Value} import org.scalatest.BeforeAndAfterAll import org.scalatest.flatspec.AnyFlatSpec diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala index 01fe22d786f..47b33c41a28 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala @@ -14,7 +14,7 @@ import org.enso.pkg.QualifiedName import org.enso.common.LanguageInfo import org.enso.common.MethodNames import org.enso.compiler.phase.exports.Node -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.graalvm.polyglot.{Context, Engine} import org.scalatest.BeforeAndAfter import org.scalatest.matchers.should.Matchers diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/InterpreterTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/InterpreterTest.scala index c9c47c6c8f9..5a0e5613df6 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/InterpreterTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/InterpreterTest.scala @@ -14,7 +14,9 @@ import org.enso.polyglot.debugger.{ SessionManager } import org.enso.common.LanguageInfo -import org.enso.polyglot.{Function, PolyglotContext, RuntimeOptions} +import org.enso.common.RuntimeOptions + +import org.enso.polyglot.{Function, PolyglotContext} import org.graalvm.polyglot.{Context, Value} import org.scalatest.Assertions import org.scalatest.matchers.should.Matchers diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/PackageTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/PackageTest.scala index a33a70bce09..80b3e69d3b1 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/PackageTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/PackageTest.scala @@ -2,7 +2,9 @@ package org.enso.interpreter.test import org.enso.pkg.PackageManager import org.enso.common.LanguageInfo -import org.enso.polyglot.{PolyglotContext, RuntimeOptions} +import org.enso.common.RuntimeOptions + +import org.enso.polyglot.PolyglotContext import org.graalvm.polyglot.{Context, Value} import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/BuiltinTypesTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/BuiltinTypesTest.scala index 8ec93cf2890..4ee0e912dc9 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/BuiltinTypesTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/BuiltinTypesTest.scala @@ -3,7 +3,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.graalvm.polyglot.Context diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeAsyncCommandsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeAsyncCommandsTest.scala index 6c3f5b63181..c5a29518307 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeAsyncCommandsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeAsyncCommandsTest.scala @@ -2,7 +2,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.{ContentVersion, Sha3_224VersionCalculator} diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeComponentsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeComponentsTest.scala index 284cfe980fd..07b4e8b52cb 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeComponentsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeComponentsTest.scala @@ -14,7 +14,7 @@ import org.enso.pkg.{ } import org.enso.common.LanguageInfo import org.enso.common.MethodNames -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.testkit.OsSpec diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala index dba58a05e28..e04016f4153 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeErrorsTest.scala @@ -3,7 +3,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala index c55c5613a4a..9208cc906e9 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala @@ -6,7 +6,7 @@ import org.enso.interpreter.test.Metadata import org.enso.pkg.{Package, PackageManager} import org.enso.common.LanguageInfo import org.enso.common.MethodNames -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.testkit.OsSpec diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala index 0e2c5dfce16..2fd29bfe2a8 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeInstrumentTest.scala @@ -3,7 +3,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.{Constants, ConstantsGen} import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.{ContentVersion, Sha3_224VersionCalculator} diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeProjectContextTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeProjectContextTest.scala index dd1dd648f6a..e7440f424ef 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeProjectContextTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeProjectContextTest.scala @@ -1,7 +1,7 @@ package org.enso.interpreter.test.instrument import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.graalvm.polyglot.{Context, PolyglotException} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeRefactoringTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeRefactoringTest.scala index 0b7ba90ec37..94a914851ff 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeRefactoringTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeRefactoringTest.scala @@ -4,7 +4,7 @@ import org.apache.commons.io.output.TeeOutputStream import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala index d1ad515f5d5..556864a8aba 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala @@ -7,7 +7,7 @@ import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo import org.enso.common.MethodNames import org.enso.polyglot.data.TypeGraph -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala index 49fa69485d6..3ab6c221654 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeStdlibTest.scala @@ -3,7 +3,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.test.Metadata import org.enso.pkg.{Package, PackageManager, QualifiedName} import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.Suggestion import org.enso.polyglot.runtime.Runtime.Api diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala index 9e9ca0f8597..3f3b7f0745a 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeSuggestionUpdatesTest.scala @@ -2,7 +2,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.common.LanguageInfo -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.ExportedSymbol import org.enso.polyglot.ModuleExports diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTextEditsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTextEditsTest.scala index 7fe0b356465..01d676cb439 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTextEditsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTextEditsTest.scala @@ -2,10 +2,10 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.common.LanguageInfo +import org.enso.common.RuntimeOptions import org.enso.polyglot.{ ExportedSymbol, ModuleExports, - RuntimeOptions, RuntimeServerInfo, Suggestion } diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTypesTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTypesTest.scala index 8bc795a88c8..e138da0985f 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTypesTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeTypesTest.scala @@ -6,7 +6,7 @@ import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.interpreter.test.Metadata import org.enso.common.LanguageInfo import org.enso.common.MethodNames -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.enso.polyglot.RuntimeServerInfo import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualizationsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualizationsTest.scala index 6c64960cf74..4ab935b80a7 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualizationsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualizationsTest.scala @@ -3,6 +3,7 @@ package org.enso.interpreter.test.instrument import org.enso.interpreter.runtime.`type`.ConstantsGen import org.enso.interpreter.test.Metadata import org.enso.pkg.QualifiedName +import org.enso.common.RuntimeOptions import org.enso.polyglot._ import org.enso.polyglot.runtime.Runtime.Api import org.enso.text.editing.model diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala index a6aefda1c41..b6cb896a6ac 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/ImportsTest.scala @@ -1,7 +1,7 @@ package org.enso.interpreter.test.semantic import org.enso.interpreter.test.{InterpreterException, PackageTest} -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions class ImportsTest extends PackageTest { implicit def messagingNatureOInterpreterException diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/OverloadsResolutionErrorTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/OverloadsResolutionErrorTest.scala index fe12e897afe..fa53bc99adf 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/OverloadsResolutionErrorTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/OverloadsResolutionErrorTest.scala @@ -5,7 +5,7 @@ import org.enso.interpreter.test.{ InterpreterException, InterpreterTest } -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.graalvm.polyglot.Context class OverloadsResolutionErrorTest extends InterpreterTest { diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/StrictCompileDiagnosticsTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/StrictCompileDiagnosticsTest.scala index c1e422c0839..134cfc2b83e 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/StrictCompileDiagnosticsTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/StrictCompileDiagnosticsTest.scala @@ -5,7 +5,7 @@ import org.enso.interpreter.test.{ InterpreterException, InterpreterTest } -import org.enso.polyglot.RuntimeOptions +import org.enso.common.RuntimeOptions import org.graalvm.polyglot.Context class StrictCompileDiagnosticsTest extends InterpreterTest { diff --git a/engine/runtime/src/main/java/org/enso/interpreter/EnsoLanguage.java b/engine/runtime/src/main/java/org/enso/interpreter/EnsoLanguage.java index 56a6fcb99d6..06079f36f94 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/EnsoLanguage.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/EnsoLanguage.java @@ -16,6 +16,7 @@ import java.io.PrintStream; import java.util.List; import java.util.Objects; import org.enso.common.LanguageInfo; +import org.enso.common.RuntimeOptions; import org.enso.compiler.Compiler; import org.enso.compiler.context.InlineContext; import org.enso.compiler.context.LocalScope; @@ -43,7 +44,6 @@ import org.enso.interpreter.runtime.tag.Patchable; import org.enso.interpreter.util.FileDetector; import org.enso.lockmanager.client.ConnectedLockManager; import org.enso.logger.masking.MaskingFactory; -import org.enso.polyglot.RuntimeOptions; import org.enso.syntax2.Line; import org.enso.syntax2.Tree; import org.graalvm.options.OptionCategory; diff --git a/engine/runtime/src/main/java/org/enso/interpreter/OptionsHelper.java b/engine/runtime/src/main/java/org/enso/interpreter/OptionsHelper.java index 01da0083b1d..91757b6a190 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/OptionsHelper.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/OptionsHelper.java @@ -5,7 +5,7 @@ import com.oracle.truffle.api.TruffleLanguage; import java.io.File; import java.net.URISyntaxException; import java.util.Optional; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; public final class OptionsHelper { private OptionsHelper() {} diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/EnsoContext.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/EnsoContext.java index ff674c43280..5c3b13b1542 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/EnsoContext.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/EnsoContext.java @@ -37,6 +37,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; import java.util.logging.Level; import org.enso.common.LanguageInfo; +import org.enso.common.RuntimeOptions; import org.enso.compiler.Compiler; import org.enso.compiler.data.CompilerConfig; import org.enso.distribution.DistributionManager; @@ -58,7 +59,6 @@ import org.enso.librarymanager.resolved.LibraryRoot; import org.enso.pkg.Package; import org.enso.pkg.PackageManager; import org.enso.pkg.QualifiedName; -import org.enso.polyglot.RuntimeOptions; import org.enso.polyglot.debugger.IdExecutionService; import org.graalvm.options.OptionKey; import scala.jdk.javaapi.OptionConverters; diff --git a/lib/java/test-utils/src/main/java/org/enso/test/utils/ContextUtils.java b/lib/java/test-utils/src/main/java/org/enso/test/utils/ContextUtils.java index 744a78b205a..db432e99cd6 100644 --- a/lib/java/test-utils/src/main/java/org/enso/test/utils/ContextUtils.java +++ b/lib/java/test-utils/src/main/java/org/enso/test/utils/ContextUtils.java @@ -12,8 +12,8 @@ import java.util.logging.Level; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames.Module; import org.enso.common.MethodNames.TopScope; +import org.enso.common.RuntimeOptions; import org.enso.interpreter.runtime.EnsoContext; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Language; import org.graalvm.polyglot.Source; diff --git a/lib/java/test-utils/src/main/java/org/enso/test/utils/ProjectUtils.java b/lib/java/test-utils/src/main/java/org/enso/test/utils/ProjectUtils.java index 9517d02a0be..5eb9a183f97 100644 --- a/lib/java/test-utils/src/main/java/org/enso/test/utils/ProjectUtils.java +++ b/lib/java/test-utils/src/main/java/org/enso/test/utils/ProjectUtils.java @@ -8,9 +8,9 @@ import java.util.Comparator; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; +import org.enso.common.RuntimeOptions; import org.enso.pkg.QualifiedName; import org.enso.polyglot.PolyglotContext; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Context.Builder; import org.graalvm.polyglot.Value; diff --git a/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/Utils.java b/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/Utils.java index 0dcb8011760..25e3e3e5199 100644 --- a/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/Utils.java +++ b/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/Utils.java @@ -8,7 +8,7 @@ import java.nio.file.Files; public class Utils { /** - * Returns the path to the {@link org.enso.polyglot.RuntimeOptions#LANGUAGE_HOME_OVERRIDE language + * Returns the path to the {@link org.enso.common.RuntimeOptions#LANGUAGE_HOME_OVERRIDE language * home override directory}. * *

Note that the returned file may not exist. diff --git a/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/processor/BenchProcessor.java b/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/processor/BenchProcessor.java index 0da05770b15..a1ad90ba263 100644 --- a/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/processor/BenchProcessor.java +++ b/lib/scala/bench-processor/src/main/java/org/enso/benchmarks/processor/BenchProcessor.java @@ -21,7 +21,7 @@ import org.enso.benchmarks.ModuleBenchSuite; import org.enso.benchmarks.Utils; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames.TopScope; -import org.enso.polyglot.RuntimeOptions; +import org.enso.common.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.PolyglotException; import org.graalvm.polyglot.Value; @@ -66,7 +66,7 @@ public class BenchProcessor extends AbstractProcessor { "import org.graalvm.polyglot.io.IOAccess;", "import org.enso.common.LanguageInfo;", "import org.enso.common.MethodNames;", - "import org.enso.polyglot.RuntimeOptions;", + "import org.enso.common.RuntimeOptions;", "import org.enso.benchmarks.processor.SpecCollector;", "import org.enso.benchmarks.ModuleBenchSuite;", "import org.enso.benchmarks.BenchSpec;", diff --git a/lib/scala/bench-processor/src/test/java/org/enso/benchmarks/TestSpecCollector.java b/lib/scala/bench-processor/src/test/java/org/enso/benchmarks/TestSpecCollector.java index a51d997bb24..88e3cb43087 100644 --- a/lib/scala/bench-processor/src/test/java/org/enso/benchmarks/TestSpecCollector.java +++ b/lib/scala/bench-processor/src/test/java/org/enso/benchmarks/TestSpecCollector.java @@ -13,8 +13,8 @@ import java.util.List; import org.enso.benchmarks.processor.SpecCollector; import org.enso.common.LanguageInfo; import org.enso.common.MethodNames.TopScope; +import org.enso.common.RuntimeOptions; import org.enso.pkg.PackageManager; -import org.enso.polyglot.RuntimeOptions; import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Value; import org.graalvm.polyglot.io.IOAccess; diff --git a/lib/scala/logging-utils/src/main/java/org/enso/logger/Converter.java b/lib/scala/logging-utils/src/main/java/org/enso/logger/Converter.java index ad0f4a74670..fd921deb3da 100644 --- a/lib/scala/logging-utils/src/main/java/org/enso/logger/Converter.java +++ b/lib/scala/logging-utils/src/main/java/org/enso/logger/Converter.java @@ -1,6 +1,10 @@ package org.enso.logger; -import static org.slf4j.event.Level.*; +import static org.slf4j.event.Level.DEBUG; +import static org.slf4j.event.Level.ERROR; +import static org.slf4j.event.Level.INFO; +import static org.slf4j.event.Level.TRACE; +import static org.slf4j.event.Level.WARN; import org.slf4j.event.Level; diff --git a/tools/legal-review/engine/report-state b/tools/legal-review/engine/report-state index 08d8a9b6a77..2d2f14fbec8 100644 --- a/tools/legal-review/engine/report-state +++ b/tools/legal-review/engine/report-state @@ -1,3 +1,3 @@ -CEACB200CB0700395F9105E8F16462D5DCDAC671A85BC06C502A92FCFE9EDB3D +6C4CE7219F6329519E17E044BB32CFD43391B022D686B5BDCF6421E03DFC4858 1CCB55F023131497A0E6A16BB5B2D63E5D842572D8638017816EF1D5474B0169 0