I have been using opam lock and the --locked option of opam pin to get reproducible builds across my home environment and my CI. However, one problem I am having is that my home computer has a different architecture than my CI. In particular, on my home machine (where I generated the lockfile), I have host-arch-arm64 installed and on my CI, there appears to be host-arch-x86_64. For this reason, the package cannot be built from the lockfile on the CI.
Is there a standard way to deal with this problem? And my apologies if I am misunderstanding some aspect of how this all works, or the boundaries between opam and the OCaml compiler.
As it happens, this kind of use of opam lock has been “broken” for a while - as implemented, opam lock allows dependency sharing between basically identical machines. This has already been known for a while to fail once you have OS-specific dependencies; the change has unfortunately made it a rather trivial issue to hit.
I think the way forward for now may be to back out the use of the arch- and system- packages for non-Windows systems, until a proper mechanism is available in opam (there are various ideas in flight).
As a workaround, I think removing the arch- and system- packages from the lock should work.
@dinosaure I did not see your response, but thank you for sharing this… It looks very interesting and I hope to study it in more detail once I have a bit of time in August.