Recently I upgraded my home server from Ubuntu LTS 24 to LTS 26.
I had an opam (2.5.2) installation [ETA though, I upgraded that to opam 2.6.1; I doubt that that’s the problem, since the failure is in the C compilation stage of the OCaml compiler build – though I could be wrong] in which I’d installed every major
OCaml versions from 4.11.2->5.5.1; I use this to test my packages
against a range of OCaml versions.
I periodically wipe and recreate these switches using a mechanical process,
and I did this today. Oddly, everything except
- 5.0.0
- 4.13.1
- 4.12.1
- 4.11.2
built just fine. These all got a similar error, and I paste the message below.
Has anybody else encountered this? I can’t back up to the previous install
of Ubuntu (this is a bare-metal install, not a docker image) so I can’t find out
what’s busted, but it’s odd that 4.14.2 worked fine when the versions
before-and-after did not.
Anyway, just figured I’d ask to see if anybody had seen this. I’ve been using this server
for hacking OCaml for … years and years, so this is a little surprising. I can go debug
further (it’s not a problem for me to dive into the C code, run the build manually, etc)
but before I do that, I figured I should ask if anybody else had encountered this. No point
in wasted labor.
4.13.1: #=== ERROR while compiling ocaml-base-compiler.4.13.1 =========================#
4.13.1: # context 2.6.1 | linux/x86_64 | | https://opam.ocaml.org#e4cd7ede2d55a46570977c0ffaa7e96845190817
4.13.1: # path ~/Hack/Opam/GENERIC/4.13.1/.opam-switch/build/ocaml-base-compiler.4.13.1
4.13.1: # command ~/Hack/Opam/GENERIC/opam-init/hooks/sandbox.sh build make -j15
4.13.1: # exit-code 2
4.13.1: # env-file ~/Hack/Opam/GENERIC/log/ocaml-base-compiler-182838-27c646.env
4.13.1: # output-file ~/Hack/Opam/GENERIC/log/ocaml-base-compiler-182838-27c646.out
4.13.1: ### output ###
4.13.1: # [...]
4.13.1: # caml/prims.h:33:23: error: too many arguments to function ‘(value (*)(void))*(caml_prim_table.contents + (sizetype)((long unsigned int)*pc * 8))’; expected 0, have 2
4.13.1: # 33 | #define Primitive(n) ((c_primitive)(caml_prim_table.contents[n]))
4.13.1: # | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.13.1: # interp.c:967:14: note: in expansion of macro ‘Primitive’
4.13.1: # 967 | accu = Primitive(*pc)(sp + 2, nargs);
4.13.1: # | ^~~~~~~~~
4.13.1: # make[2]: *** [Makefile:366: interp.b.o] Error 1
4.13.1: # make[2]: *** Waiting for unfinished jobs....
4.13.1: # make[2]: Leaving directory '/home/chet/Hack/Opam/GENERIC/4.13.1/.opam-switch/build/ocaml-base-compiler.4.13.1/runtime'
4.13.1: # make[1]: *** [Makefile:163: coldstart] Error 2
4.13.1: # make[1]: Leaving directory '/home/chet/Hack/Opam/GENERIC/4.13.1/.opam-switch/build/ocaml-base-compiler.4.13.1'
4.13.1: # make: *** [Makefile:311: world.opt] Error 2