camlp-streams
camlp-streams copied to clipboard
Installation fails with `ar: no archive members specified`on MacOS with OCaml 4.04.2
We are hitting an installation failure in the omd CI when trying to install a package that depends on this one: https://github.com/ocaml/omd/runs/7490933831?check_suite_focus=true#step:4:4649
Seems like some other packages have hit his before, e.g.,: https://github.com/ocsigen/lwt/issues/91
This is a tooling issue with OSX (and also MSVC toolchains on Windows) that was worked-around upstream in the OCaml compiler, in 4.05 for OSX and much later for MSVC. See:
- https://github.com/ocaml/ocaml/pull/1094
- https://github.com/ocaml/ocaml/pull/9011
I see two approaches to make your issue go away:
- Stop supporting 4.04; why do we care about 4.04 anymore?
- Convince someone that likes backporting and opam and old OCaml releases to backport either ones of those changes to 4.04 (the #9011 fix is more general and a bit nicer, so I would personally try that). You could try your luck with @dra27, he is unreasonably attracted to this kind of issues.
To summarize: I think that this is a compiler question with either a non-fix or a compiler-fix, not something to be fixed at the level of each affected package. I propose to close the present issue to reflect this, let me know if that sounds reasonable.
There are third and fourth ways, the third of which I’ll do shortly:
- Insert a dummy module in the library for these old versions (this fixes MSVC as well). This solution was rejected for stdlib-shims because the dummy module was needed for current releases of the compiler, but stdlib-shims is the opposite of camlp-streams in this regard
- Generate an empty package in Dune when the library itself is empty.
I’m not so keen on a back-port - the back-ports we do are to allow old compilers to build in new environments, but empty libraries were always broken in macOS and MSVC prior to the workaround in 4.05 (for macOS) and the fix (for both) in 4.11