Skip to content

dune build --watch crashes when it detects filesystem change on macOS 13.1 on some Apple Silicon machines #6907

@dmzimmerman

Description

@dmzimmerman

Expected Behavior

I expected it to watch the filesystem and rebuild as necessary, without crashes.

Actual Behavior

It crashes every time the filesystem changes.

Reproduction

Start with any Dune project (I happened to use https://github.com/OCamlPro/ocaml-solidity). Open two terminals and change working directory in both to the root directory of the project. Run dune build, then dune build --watch in one (the reason for the initial build run is that if the project needs building, dune build --watch crashes immediately with the same error as you'll see on a filesystem change). In the other, change the filesystem - either by editing one of the files, or even something like touch foo to create a new file that Dune wouldn't even need to build. It should crash immediately with the message Internal error, please report upstream including the contents of _build/log and a stack trace (which you can see in the verbose gist below) that seems to indicate an as_outside_build_dir_exn being thrown.

Specifications

  • Version of dune (output of dune --version): 3.6.1
  • Version of ocaml (output of ocamlc --version): 4.14.1
  • Operating system (distribution and version): macOS 13.1 / Apple Silicon

Additional information

I replicated this on completely clean installs of OCaml 4.14.1 and Dune via OPAM (i.e., rm -rf ~/.opam; opam init; opam switch create 4.14.1 followed by opam installation of Dune and the required libraries for the project I was building, on both a MacBook Pro/M1 Pro/32GB RAM and a Mac Studio/M1 Ultra/128GB RAM. Colleagues of mine who have tried the same on 16GB M1 or M1 Pro machines do not seem to be experiencing this issue, but I don't know if that's just a coincidence or something meaningful.

Metadata

Metadata

Assignees

Labels

macosIssues that relate to Dune on macOS

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions