Skip to content

Fix CWD before executing libraries code #12301

@JaroslavTulach

Description

@JaroslavTulach

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

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

Related Issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🟢 Accepted

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions