Dune exec is failing

Hi, I am trying to build rescript-compiler with dune, which is successful. But while running dune exec rescript, I’m getting this error : Fatal error: exception Unix.Unix_error(Unix.ENOENT, "execvp", "/home/vipul/rescript-compiler/_build/default/jscomp/bsb_exe/ninja.exe").
I haven’t made any change in compiler code, branch is master.

Did you try following the contributing instructions? Try running the various make commands too.

1 Like

Yes, i followed. After running make also, i’m getting the same error.

Could be the same issue here since the rescript exe calls execvp expecting ninja.exe to be built. As far as I know, that issue with dune exec is still outstanding.

It’s interesting that running the makefile commands is doing that too, since it isn’t using dune exec, could you show what you’re trying? (And neither is the contributing doc saying to use dune exec.)

Just went and double checked and you won’t be able to run dune exec rescript to run the rescript executable the way things are set up now in the compiler repo.

This bit here will set the directory it is looking for ninja.exe to the location of the rescript exe …in the dune exec rescript case, that will be in the _build/default/jscomp/bsb_exe directory, but ninja.exe will not be there. The copyExes.js script that the makefile calls will set those executables (including ninja.exe) up in the right dir. In my case ./linux/rescript …if you call rescript from that location, ninja.exe will be found.

Note that make build rather than dune build will first build ninja, then run the dune build then run the copyExes script…maybe it is worth mentioning in the contributor doc that the dune build won’t get you those executables in platform directory.

1 Like