-
Notifications
You must be signed in to change notification settings - Fork 332
Closed
Labels
Description
Problem
A typical warning printed when using ./bin/enso
launcher is:
[WARN] [enso.org.enso.interpreter.runtime.EnsoContext]
Initializing the context in a different working directory
than the one containing the project root.
This may lead to relative paths not behaving as advertised by `File.new`.
Please run the engine inside of `/enso/enso/test` directory.
Avoid the warning. We can do it since #12296 (comment) - since the primary entrypoint is native enso launcher.
Goals & Constraints
- change CWD for those using
Enso_File
- change CWD for those using
polyglot java import java.io.File
- change CWD for native libraries running inside of Enso (Postgress, SQLite, OpenCV)
Available Solutions
- Change System.setProperty("user.dir", ...
- doesn't even influence
new java.io.File("relative.txt").getAbsolutePath()
- doesn't even influence
TruffleLanguage.Env.setWorkingDirectory
in https://github.com/enso-org/enso/pull/12618/files#diff-00348de86920168e139b84ff0d5c712b1e58065389cc7a0cbd90421a31a2954dR177.- only influence
File
coming fromStandard.Base
- only influence
- set CWD when launching
java
command from native imageenso
launcher- good enough for
--jvm
mode in production
- good enough for
- POSIX offers chdir function
- there must be similar function on Windows as well
- necessary for production mode without
--jvm
flag
Tasks
- write a test for from Standard.Base import File
- write a test for polyglot java import java.io.File
- use system Java to set operating process's CWD
- do manual testing of
enso
native executable with/out--jvm
option - automatically test via NI launcher without
--jvm
flag on - automatically test via NI launcher with
--jvm
flag on - describe/document behavior without native image launcher
Use System Java to set OS CWD
- we shall call that function in runner.Main
- we can do it easily with native image's System Java bridge
- just like we did in https://github.com/enso-org/enso/pull/10440/files#diff-7d7b3234bdeca3aa1d7efc2a402a761b6a1000ded2c34c9d40396ae164f96d07R17
Related Issues
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🟢 Accepted