Skip to content

dune exec path shouldn't change when using watch mode #10236

@Khady

Description

@Khady

Expected Behavior

PWD of a command ran by dune exec should be the same in and out of watch mode.

Actual Behavior

PWD in watch mode is always at the root of the dune project. While in normal mode it is where dune was launched.

Reproduction

/tmp$ dune init project demo
Entering directory '/tmp/demo'
Success: initialized project component named demo
/tmp$ cd demo
/tmp/demo$ dune exec -- pwd
/tmp/demo                   <-------- this is where dune was launched
/tmp/demo$ cd bin
/tmp/demo/bin$ dune exec -- pwd
Entering directory '/tmp/demo'
Leaving directory '/tmp/demo'
/tmp/demo/bin                   <-------- this is where dune was launched
/tmp/demo/bin$ dune exec -w -- pwd
Entering directory '/tmp/demo'

/tmp/demo <---- this is NOT where dune was launched

Specifications

  • Version of dune (output of dune --version): 3.14.0
  • Version of ocaml (output of ocamlc --version): 4.14.1
  • Operating system (distribution and version): linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions