opam-repository icon indicating copy to clipboard operation
opam-repository copied to clipboard

strange description of "host-system-other"

Open hannesm opened this issue 1 year ago • 1 comments

Dear all (esp. @dra27),

I encountered that opam-repository now has some "host-system-other" package that requires me to recompile all the switches. That's fine, but looking into the description thereof:

This package is installed if the underlying OCaml compiler's system is not
recognised by opam-repository's compiler packaging.

So, does this mean I should dig into how "opam-repository's compiler packaging" will recognise my system (in this case, FreeBSD)? Looking into host-system* packages, it more looks like this host-system* is some windows-specific stuff leaking into opam packages, is my understanding correct? If yes, it would be worth to adjust the description to make it easier to understand for future developers.

Thanks a lot for reading.

hannesm avatar Jun 29 '24 06:06 hannesm

Indeed, the description should be clarified. There's an explanation in the commit message which added it (see 64e08650596a67aab5654091aa721ced1cd4ea8a), but that's obviously not the best place for it:

Add Windows system- + host-system- packages

Add the system-mingw and system-msvc packages to specify either the mingw-w64 or MSVC ports when compiling OCaml and the host-system-mingw and host-system-msvc packages to be used for the dependency graph.

The intention is to complete this for non-Windows systems, but as there will always be a chance of an unknown system, host-system-other is added to be used for all the other ports. This package is significant, as compiler packages must always install a host-system- package (or the user could attempt to install another incorrect one).

At the moment, for the Windows compilers, the configure invocation is explicit, which means we can tell statically in the opam files for the compiler if host-system-mingw or host-system-msvc is required and which host-arch- package to install. For all other platforms, the invocation is not yet explicit, which is why there's the host-arch- package is selected based on the arch global variable and host-system-other is installed for now. So it's not exactly "leaking", it's just not yet accurate.

I'll do a PR to update the description text in host-system-other, though

dra27 avatar Jun 30 '24 09:06 dra27