ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.63k stars 404 forks source link

Dune cache causing `dune exec` process to die #3663

Closed tzemanovic closed 2 years ago

tzemanovic commented 4 years ago

Enabling dune cache seems to affect dune exec command. When the executable needs to be rebuilt, dune cache causes the process to die on the first run. The process runs fine on a subsequent run.

Reproduction

  1. enable dune cache with ~/.config/dune/config containing:
    (lang dune 2.6.2)
    (cache enabled)
  2. run dune exec x.exe and exit
  3. make a change in ocaml source code to force compilation
  4. run dune exec x.exe again, the executable dies immediately with status code 137
  5. if we run dune exec x.exe again, it runs fine

Specifications

Additional information

mefyl commented 4 years ago

I can't reproduce with a minimal test:

$ dune --version
2.6.2
$ cat dune-project 
(lang dune 2.6)
$ cat
$ cat dune 
(executable
 (name main))
$ cat main.ml
let () =
  print_endline "1"
$ DUNE_CACHE=enabled dune exec ./main.exe
1                    
$ sed -i s/1/2/ main.ml 
$ DUNE_CACHE=enabled dune exec ./main.exe
2                    

Can you please check I didn't miss something from your instructions ? If not, is there any way to get the actual setup that exhibits the issue ?

rgrinberg commented 2 years ago

@tzemanovic please re-open if you're still able to repro.