summaryrefslogtreecommitdiff
path: root/scripts/update-charon-pin.sh
diff options
context:
space:
mode:
authorGuillaume Boisseau2024-05-30 16:13:57 +0200
committerGitHub2024-05-30 16:13:57 +0200
commit0c0bbb56655458510c7573b06c9a6d9910f8138a (patch)
treed112b3f27c257853c368943c3542515b01596d98 /scripts/update-charon-pin.sh
parentd6367d464339764d407050bc2c104daf9d6f243c (diff)
parent4195b9653b2d00b846edd3b74211f129192a8806 (diff)
Merge pull request #225 from AeneasVerif/update-charon-pin
Diffstat (limited to 'scripts/update-charon-pin.sh')
-rwxr-xr-xscripts/update-charon-pin.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/update-charon-pin.sh b/scripts/update-charon-pin.sh
index 63dfe3b6..1fa706ae 100755
--- a/scripts/update-charon-pin.sh
+++ b/scripts/update-charon-pin.sh
@@ -3,5 +3,16 @@ if ! which jq 2> /dev/null 1>&2; then
echo 'Error: command `jq` not found; please install it.'
exit 1
fi
+
+if [ -L charon ]; then
+ echo '`./charon` is a symlink; we using the commit there for our new pin.'
+ COMMIT="$(git -C charon rev-parse HEAD)"
+ nix flake lock --override-input charon "github:aeneasverif/charon/$COMMIT"
+else
+ echo 'Pinning the latest commit from Charon `main`'
+ nix flake lock --update-input charon
+fi
+
+# Keep the commit revision in `./charon-pin` as well so that non-nix users can know which commit to use.
echo '# This is the commit from https://github.com/AeneasVerif/charon that should be used with this version of aeneas.' > ./charon-pin
jq -r .nodes.charon.locked.rev flake.lock >> ./charon-pin