I tried compiling ocaml/ocaml, but compiling hangs on running ocaml doc.
Once it hangs, macOS will behave very weirdly with processes not being able to start. The only solution I have found once entering this state is to reboot.
Using a different terminal emulator than kitty. Alacritty and Terminal.app work. (I have tried running with everything but the PATH environment variable but it still hangs)
MacOS is UNIX (or at least, that’s where it began), so this is … disturbing.
when you say make -j, do you mean literally that command? B/c one would think that, yeah (per @benjamin-thomas ) you might get swapping, but that wouldn’t cause a hang.
you said make -j 8 prevents the problem. Can you try make -j 16, and higher powers of 2, to see whether it’s literally make -j, or just a very high concurrency ?
just in order to further confine the issue of the terminal emulator, can you run the make command under nohup ? That should disconnect it from the terminal ?
Adding even more context on this (genuinely!) fascinating macOS issue. Having run ./configure --disable-stdlib-manpages && make -j (which succeeds), it was repeatably the case that make -j manpages would fail. Most of the time it was possible to abort make with CTRL+C which would reveal that every single ocamldoc.opt invocation for the generating the stdlib manpages was hanging. And then everything gets weird - apps wouldn’t start, the C could be invoked, but programs emitted by clang simply did nothing!
There doesn’t seem to be any swapping (nor a high memory usage).
It fails for high values of make -j <value>. It has both failed and succeeded at -j96.
Nohup doesn’t change anything. It still fails in kitty but doesn’t fail in alacritty. (even though the process doesn’t even output to the terminal anymore). Same if running nohup make -j < /dev/null & disown
I had already managed to compile with the foot terminal emulator on Linux but just in case it was caused just by kitty I tried on kitty on Linux (using Asahi linux) and it worked (not particularly surprising… although who knows at this point…).
There are other projects that almost-certainly have high concurrency in their builds Like GCC, or Emacs. Have you tried to build such other projects with “make -j” (or “make -j 512”) to see if they cause problems ? [In the spirit of exonerating the innocent to incriminate the guilty]
Also, have you had an success asking in MacOS forums?