-
Notifications
You must be signed in to change notification settings - Fork 332
Consistency of --jvm
CLI options: allowing optional JVM path
#13225
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
Changes from all commits
b8608cb
d5bfefb
b214e3a
b491672
8728e1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -79,7 +79,7 @@ object LauncherApplication { | |||||||||||||
versionOverride, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) mapN { | ||||||||||||||
( | ||||||||||||||
|
@@ -90,7 +90,7 @@ object LauncherApplication { | |||||||||||||
versionOverride, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) => (config: Config) => | ||||||||||||||
Launcher(config).newProject( | ||||||||||||||
|
@@ -101,7 +101,7 @@ object LauncherApplication { | |||||||||||||
versionOverride = versionOverride, | ||||||||||||||
useSystemJVM = systemJVMOverride, | ||||||||||||||
jvmOpts = jvmOpts, | ||||||||||||||
jvmMode = jvmMode, | ||||||||||||||
jvm = Option(jvm), | ||||||||||||||
additionalArguments = additionalArgs | ||||||||||||||
) | ||||||||||||||
} | ||||||||||||||
|
@@ -112,11 +112,12 @@ object LauncherApplication { | |||||||||||||
"jvm", | ||||||||||||||
"These parameters will be passed to the launched JVM as -DKEY=VALUE." | ||||||||||||||
) | ||||||||||||||
private def jvmMode = | ||||||||||||||
Opts.flag( | ||||||||||||||
private def jvm = | ||||||||||||||
Opts.optionalParameter[Path]( | ||||||||||||||
"jvm", | ||||||||||||||
"Setting this flag runs Enso in JVM mode rather than the default native one.", | ||||||||||||||
showInUsage = true | ||||||||||||||
"path", | ||||||||||||||
"Runs Enso in JVM mode rather than the default native one.", | ||||||||||||||
true | ||||||||||||||
) | ||||||||||||||
private def systemJVMOverride = | ||||||||||||||
Opts.flag( | ||||||||||||||
|
@@ -166,7 +167,7 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) mapN { | ||||||||||||||
( | ||||||||||||||
|
@@ -175,15 +176,15 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) => (config: Config) => | ||||||||||||||
Launcher(config).runRun( | ||||||||||||||
path = path, | ||||||||||||||
versionOverride = versionOverride, | ||||||||||||||
useSystemJVM = systemJVMOverride, | ||||||||||||||
jvmOpts = jvmOpts, | ||||||||||||||
jvmMode = jvmMode, | ||||||||||||||
jvm = Option(jvm), | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I understand what you want to achieve. Do I understand correctly that you want to support 2 scenarios?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the requirements above are correct, then I'm afraid that the framework does not support such a duality at all. The problem is the framework was created with some other assumptions in mind that contradict the approach above. One of the features we wanted in the framework was that the flags and options can appear in mostly any order relative to positional arguments. Thus we either have flags that do not expect any 'values' after them, or parameters that expect 1 'value' for it. Thus, if I encounter Of course I can imagine we could take some other approach to this, but these are assumptions of this framework and I think it may be unlikely that it may be easy to change them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So IF my assumptions about what you want from this parameter/flag are correct, I would suggest to try some other approach for selecting the JVM to use. As this flag is doing 2 things at once (one could argue violating SRP). I'd suggest to keep a boolean flag Note that we already have a flag If not, I'd suggest to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless I misunderstood your requirements, and you are okay for
In that case I think you should have it almost ready - the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With ...
... being achieved by giving the But let's ask a question:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, passing some custom options can be done by passing them after On the other hand let's not that part of So as for argument passing - yeah I'd vote for passing But still slightly worried that we have 2 components selecting JVMs - right now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can try to open a PR removing this
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some docs: Code that manages GraalVM versions and finds/installs the JVM for a given engine version: Building engine manifest that specifies the JVM used with it: enso/project/DistributionPackage.scala Lines 191 to 196 in a1aa84c
The representation of the Manifest file in code (and its parsing via For each engine release we create a Perhaps this logic should be updated if the requirements are changed. Perhaps if no JVM is needed as its running native (but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OK. I believe the following flag can be removed...
...such an advanced feature deserves to be complicated - e.g. |
||||||||||||||
additionalArguments = additionalArgs, | ||||||||||||||
logLevel = engineLogLevel | ||||||||||||||
) | ||||||||||||||
|
@@ -255,7 +256,7 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) mapN { | ||||||||||||||
( | ||||||||||||||
|
@@ -271,7 +272,7 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) => (config: Config) => | ||||||||||||||
Launcher(config).runLanguageServer( | ||||||||||||||
|
@@ -283,7 +284,7 @@ object LauncherApplication { | |||||||||||||
secureRpcPort = secureRpcPort, | ||||||||||||||
dataPort = dataPort, | ||||||||||||||
secureDataPort = secureDataPort, | ||||||||||||||
jvmModeEnabled = jvmMode | ||||||||||||||
jvm = Option(jvm) | ||||||||||||||
), | ||||||||||||||
contentRoot = path, | ||||||||||||||
versionOverride = versionOverride, | ||||||||||||||
|
@@ -316,7 +317,7 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) mapN { | ||||||||||||||
( | ||||||||||||||
|
@@ -325,15 +326,15 @@ object LauncherApplication { | |||||||||||||
engineLogLevel, | ||||||||||||||
systemJVMOverride, | ||||||||||||||
jvmOpts, | ||||||||||||||
jvmMode, | ||||||||||||||
jvm, | ||||||||||||||
additionalArgs | ||||||||||||||
) => (config: Config) => | ||||||||||||||
Launcher(config).runRepl( | ||||||||||||||
projectPath = path, | ||||||||||||||
versionOverride = versionOverride, | ||||||||||||||
useSystemJVM = systemJVMOverride, | ||||||||||||||
jvmOpts = jvmOpts, | ||||||||||||||
jvmMode = jvmMode, | ||||||||||||||
jvm = Option(jvm), | ||||||||||||||
additionalArguments = additionalArgs, | ||||||||||||||
logLevel = engineLogLevel | ||||||||||||||
) | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option(jvm)
at various places is unlikely correct, right @radeusgd?