Skip to content

Commit

Permalink
Add disable-private-check option processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Akirathan committed Nov 1, 2023
1 parent f37ec96 commit 0b446df
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class RuntimeOptions {
private static final OptionDescriptor DISABLE_INLINE_CACHES_DESCRIPTOR =
OptionDescriptor.newBuilder(DISABLE_INLINE_CACHES_KEY, DISABLE_INLINE_CACHES).build();

public static final String DISABLE_PRIVATE_CHECK = optionName("disablePrivateCheck");
public static final OptionKey<Boolean> DISABLE_PRIVATE_CHECK_KEY = new OptionKey<>(false);
private static final OptionDescriptor DISABLE_PRIVATE_CHECK_DESCRIPTOR =
OptionDescriptor.newBuilder(DISABLE_PRIVATE_CHECK_KEY, DISABLE_PRIVATE_CHECK).build();

public static final String ENABLE_AUTO_PARALLELISM = optionName("withAutoParallelism");
public static final OptionKey<Boolean> ENABLE_AUTO_PARALLELISM_KEY = new OptionKey<>(false);
private static final OptionDescriptor ENABLE_AUTO_PARALLELISM_DESCRIPTOR =
Expand Down Expand Up @@ -125,6 +130,7 @@ public class RuntimeOptions {
STRICT_ERRORS_DESCRIPTOR,
LOG_MASKING_DESCRIPTOR,
DISABLE_INLINE_CACHES_DESCRIPTOR,
DISABLE_PRIVATE_CHECK_DESCRIPTOR,
ENABLE_AUTO_PARALLELISM_DESCRIPTOR,
ENABLE_PROJECT_SUGGESTIONS_DESCRIPTOR,
ENABLE_GLOBAL_SUGGESTIONS_DESCRIPTOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ContextFactory {
* @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.
* @param strictErrors whether or not to use strict errors
* @param useGlobalIrCacheLocation whether or not to use the global IR cache
* location
Expand All @@ -42,6 +43,7 @@ class ContextFactory {
logLevel: Level,
logMasking: Boolean,
enableIrCaches: Boolean,
disablePrivateCheck: Boolean = false,
strictErrors: Boolean = false,
useGlobalIrCacheLocation: Boolean = true,
enableAutoParallelism: Boolean = false,
Expand Down Expand Up @@ -76,6 +78,7 @@ class ContextFactory {
useGlobalIrCacheLocation.toString
)
.option(RuntimeOptions.DISABLE_IR_CACHES, (!enableIrCaches).toString)
.option(RuntimeOptions.DISABLE_PRIVATE_CHECK, disablePrivateCheck.toString)
.option(DebugServerInfo.ENABLE_OPTION, "true")
.option(RuntimeOptions.LOG_MASKING, logMasking.toString)
.options(options)
Expand Down
5 changes: 5 additions & 0 deletions engine/runner/src/main/scala/org/enso/runner/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ object Main {
private val IR_CACHES_OPTION = "ir-caches"
private val NO_IR_CACHES_OPTION = "no-ir-caches"
private val NO_READ_IR_CACHES_OPTION = "no-read-ir-caches"
private val DISABLE_PRIVATE_CHECK_OPTION = "disable-private-check"
private val COMPILE_OPTION = "compile"
private val NO_COMPILE_DEPENDENCIES_OPTION = "no-compile-dependencies"
private val NO_GLOBAL_CACHE_OPTION = "no-global-cache"
Expand Down Expand Up @@ -586,6 +587,7 @@ object Main {
* @param logLevel log level to set for the engine runtime
* @param logMasking is the log masking enabled
* @param enableIrCaches are IR caches enabled
* @param disablePrivateCheck Is private modules check disabled. If yes, `private` keyword is ignored.
* @param inspect shall inspect option be enabled
* @param dump shall graphs be sent to the IGV
* @param executionEnvironment optional name of the execution environment to use during execution
Expand All @@ -597,6 +599,7 @@ object Main {
logLevel: Level,
logMasking: Boolean,
enableIrCaches: Boolean,
disablePrivateCheck: Boolean,
enableAutoParallelism: Boolean,
inspect: Boolean,
dump: Boolean,
Expand Down Expand Up @@ -639,6 +642,7 @@ object Main {
logLevel,
logMasking,
enableIrCaches,
disablePrivateCheck,
strictErrors = true,
enableAutoParallelism = enableAutoParallelism,
executionEnvironment = executionEnvironment,
Expand Down Expand Up @@ -1171,6 +1175,7 @@ object Main {
logLevel,
logMasking,
shouldEnableIrCaches(line),
line.hasOption(DISABLE_PRIVATE_CHECK_OPTION),
line.hasOption(AUTO_PARALLELISM_OPTION),
line.hasOption(INSPECT_OPTION),
line.hasOption(DUMP_GRAPHS_OPTION),
Expand Down

0 comments on commit 0b446df

Please sign in to comment.