3.20.2 build error: `Error: posix_spawn(): Exec format error`
Could someone say what might be causing this failure with Dune 3.20.x? Dune 3.19.1 builds normally on the same system with everything else identical (these were successive builds, 3.19.1 worked and 3.20.2 upgrade failed).
Expected Behavior
Build should succeed.
Actual Behavior
---> Configuring ocaml-dune
Executing: cd "/opt/local/var/macports/build/ocaml-dune-3d7a7125/work/dune-3.20.2" && ./configure --bindir /opt/local/bin --datadir /opt/local/share/ocaml-dune --docdir /opt/local/share/doc --etcdir /opt/local/etc --libdir /opt/local/lib/ocaml/site-lib --mandir /opt/local/share/man --sbindir /opt/local/sbin
---> Building ocaml-dune
Executing: cd "/opt/local/var/macports/build/ocaml-dune-3d7a7125/work/dune-3.20.2" && DUNE_CONFIG__COPY_FILE=portable /usr/bin/make release
ocamlc -output-complete-exe -g -o .duneboot.exe -I boot unix.cma boot/[libs.ml](http://libs.ml/) boot/[duneboot.ml](http://duneboot.ml/)
./.duneboot.exe
Error: posix_spawn(): Exec format error
-> required by _build/default/doc/dune-cache.1
-> required by _build/install/default/man/man1/dune-cache.1
-> required by _build/default/dune.install
-> required by alias install
make: *** [release] Error 1
Command failed: cd "/opt/local/var/macports/build/ocaml-dune-3d7a7125/work/dune-3.20.2" && DUNE_CONFIG__COPY_FILE=portable /usr/bin/make release
Exit code: 2
Error: Failed to build ocaml-dune: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_ppcports_ocaml_ocaml-dune/ocaml-dune/main.log for details.
Reproduction
Run the build.
Specifications
- Version of
dune(output ofdune --version): 3.20.2 - Version of
ocaml(output ofocamlc --version): 4.14.2 - Operating system (distribution and version): macOS 10.6.8
Additional information
MacPorts build env.
@rgrinberg Maybe you can suggest where to look?
I would check if our vendored spawn was updated between those versions, i.e. with a git diff. That would give you an idea if we lost some patch.
Or you can just bisect the commits between the two tags.
Or you can just bisect the commits between the two tags.
This is always an option, but I hoped to reduce cpu cycles. Will try going through potentially relevant changes first then, and bisect those.
@rgrinberg Looks like this commit has introduced the bug: https://github.com/ocaml/dune/commit/804fa3f1ae043310ec574ce0f44d36c79a13c545
@rgrinberg Will be very helpful if support for portable copyfile is restored (whether via reverting that commit or in some other way). Otherwise once the code deviates sufficiently, I may be in trouble reverting this change locally.
Sure feel free to send a PR that reverts it with a comment in the code explaining why we're keeping around the fallback.
Thank you, I will deal with this shortly.