-
Notifications
You must be signed in to change notification settings - Fork 46
Description
I'm trying to set up a workflow that uses the dependencies specified by an .opam.locked file in the repository instead of using the unlocked .opam file directly. However this silently doesn't work correctly since the opam-pin input of the action causes the local package to be pinned unlocked. A subsequent job step opam install . --deps-only --locked therefore doesn't install the locked dependencies but the pinned unlocked ones, despite the --locked argument.
I think there are currently two workarounds:
-
Make
opam-pininput use lock file using environment variable by adding the following to this action's step:env: OPAMLOCKED: locked
-
Disable
opam-pin, such that installing with--lockedactually uses the lock file? In my case this seems to make theopam-depextsubstep fail because it's then trying to install the depexts for the package with the same name actually published in opam repository, which is outdated and incompatible with the development version to run the workflow on.Even if it were compatible, it wouldn't still install depexts for locked depopts.
Maybe it makes sense to have an opam-locked input to this action (defaulting to false), which would properly make this action consider the opam lock file without having to manipulate the environment and still allow opam-pin and opam-depext substeps to work as expected.
Currently it can be surprising that even by using --locked in a subsequent step, the lock file isn't actually used and the reproducibility of the reproducible build isn't thus checked. Also this subtlety with opam lock files isn't mentioned in the README, so one has to dig deep to realize this.