-
Notifications
You must be signed in to change notification settings - Fork 323
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
Override CWD in runEngineDistribution
to the parent of the project being run to avoid warning
#10928
Override CWD in runEngineDistribution
to the parent of the project being run to avoid warning
#10928
Conversation
…being run to avoid warning
// Override the working directory of new process to be the parent of the project directory. | ||
cwdOverride.foreach { c => | ||
pb.directory(c) | ||
} | ||
if (cwdOverride.isDefined) { | ||
// If the working directory is changed, we need to translate the path - make it absolute. | ||
all.set(runArgumentIndex.get + 1, runArgumentAsFile.get.getAbsolutePath) | ||
} |
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.
My only concern is that because the CWD changes, if there were any other paths given as arguments, they may now become invalid.
But I don't think we often add paths to runEngineDistribution
, do we? Maybe I should add a comment to be sure to prefer absolute paths?
I was thinking of a 'heuristic' that will convent relative paths to absolute, but it would be too imprecise - is a test
argument a path to the ./test/
directory or a completely different thing? Impossible to tell without context.
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.
I think the only path I really care about is after --run
.
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.
Thanks for a quick fix. Too bad it only works for runEngineDistribution
and not generally from CLI. What kind of language Enso is when it cannot execute files referenced by a path?
Try(new File(path)).toOption | ||
|
||
/** Looks for a parent directory that contains `package.yaml`. */ | ||
private def findProjectRoot(file: File): Option[File] = |
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.
OK.
It can - it's just a warning. We warn the user that to ensure consistency with the GUI behaviour, they should run the engine with correctly set working directory. Using |
Pull Request Description
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.