Something went wrong. Try again.
My own corner of monopam
Something went wrong. Try again.
1.3 kB · 34 lines
at main
1234567891011121314151617181920212223242526272829303132333435The release flags and the pin check===================================
scripts/release-flags.inc holds the link flags a release build takes and theswitch-pins alias, which reads the switch's pins against root.opam. The fixtureis a workspace that includes the same file, with a pin check that finds onedrifted package.
$ mkdir -p fx/scripts $ printf '(lang dune 3.21)\n' > fx/dune-project $ printf '(include scripts/release-flags.inc)\n' > fx/dune $ cp release-flags.inc fx/scripts/ $ touch fx/root.opam fx/scripts/macos-ocamlopt-link $ cat > fx/scripts/switch_pins.exe <<'SH' > #!/bin/sh > echo "helix: installed from git+https://github.com/odis-labs/helix.git, root.opam pins git+https://github.com/rizo/helix.git" > exit 1 > SH $ chmod +x fx/scripts/switch_pins.exe
A release build's link flags do not depend on the pin check, so a releasebuild of any binary runs under a switch whose pins drifted:
$ dune rules --root fx --profile release lto-flags.sexp release-link-flags.sexp \ > 2>&1 | grep -c switch-pins 0 [1]
The check runs on demand, and a drift fails it, naming the package:
$ dune build --root fx @@switch-pins > check.log 2>&1 [1] $ grep helix check.log helix: installed from git+https://github.com/odis-labs/helix.git, root.opam pins git+https://github.com/rizo/helix.git