Skip to content

Commit

Permalink
pin OCaml dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp committed Jun 13, 2024
1 parent 6f3325e commit 65bb935
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 36 deletions.
36 changes: 18 additions & 18 deletions engine/dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@
(depends
ocaml
dune
(base (>= "0.16.2"))
core
yojson
non_empty_list
pprint
ppx_deriving_yojson
ppx_yojson_conv
ppx_sexp_conv
ppx_compare
ppx_hash
ppx_deriving
cmdliner
angstrom
re
ppx_matches
ppx_string
logs
ocamlgraph
(base (= "0.16"))
(core (= "0.16"))
(yojson (= "2.2"))
(non_empty_list (= "0.1"))
(pprint (= "0.1"))
(ppx_deriving_yojson (= "3.7"))
(ppx_yojson_conv (= "0.15"))
(ppx_sexp_conv (= "0.16"))
(ppx_compare (= "0.16"))
(ppx_hash (= "0.16"))
(ppx_deriving (= "5.2"))
(cmdliner (= "1.3"))
(angstrom (= "0.16"))
(re (= "1.11"))
(ppx_matches (= "0.1"))
(ppx_string (= "0.16"))
(logs (= "0.7"))
(ocamlgraph (= "2.1"))

js_of_ocaml-compiler
js_of_ocaml
Expand Down
36 changes: 18 additions & 18 deletions engine/hax-engine.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ bug-reports: "https://github.com/hacspec/hax/issues"
depends: [
"ocaml"
"dune" {>= "3.0"}
"base" {>= "0.16.2"}
"core"
"yojson"
"non_empty_list"
"pprint"
"ppx_deriving_yojson"
"ppx_yojson_conv"
"ppx_sexp_conv"
"ppx_compare"
"ppx_hash"
"ppx_deriving"
"cmdliner"
"angstrom"
"re"
"ppx_matches"
"ppx_string"
"logs"
"ocamlgraph"
"base" {= "0.16"}
"core" {= "0.16"}
"yojson" {= "2.2"}
"non_empty_list" {= "0.1"}
"pprint" {= "0.1"}
"ppx_deriving_yojson" {= "3.7"}
"ppx_yojson_conv" {= "0.15"}
"ppx_sexp_conv" {= "0.16"}
"ppx_compare" {= "0.16"}
"ppx_hash" {= "0.16"}
"ppx_deriving" {= "5.2"}
"cmdliner" {= "1.3"}
"angstrom" {= "0.16"}
"re" {= "1.11"}
"ppx_matches" {= "0.1"}
"ppx_string" {= "0.16"}
"logs" {= "0.7"}
"ocamlgraph" {= "2.1"}
"js_of_ocaml-compiler"
"js_of_ocaml"
"js_of_ocaml-ppx"
Expand Down
25 changes: 25 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@
check-toolchain = checks.toolchain;
check-examples = checks.examples;
check-readme-coherency = checks.readme-coherency;

# `updated-dune-project` returns the `engine/dune-project`
# file with the versions locked by Nix
updated-dune-project = (packages.hax-engine.override {
hax-rust-frontend = pkgs.hello;
hax-engine-names-extract = pkgs.hello;
}).overrideAttrs (old: {
name = "dune-project";
outputs = ["out"];
buildPhase = ''
dune describe installed-libraries > /tmp/dune-installed-libraries
for package in $(grep -Po '^ {8}[(]\K\w+' dune-project); do
version=$(cat /tmp/dune-installed-libraries | grep -Po "\b$package\b.*version: v?\K[0-9.]+" | head -n1 || true)
version=$(echo "$version" | grep -Po "^\d+.\d+" || true)
if [ -z "${"$"}{version}" ]; then
continue
fi
${pkgs.sd}/bin/sd "(^ {8}[(]$package +)\([^)]+\)" '${"$"}{1}'"(= \"$version\")" dune-project
echo "-> $package: $version"
done
'';
checkPhase = "true";
installPhase = "cat dune-project > $out";
});
};
checks = {
toolchain = packages.hax.tests;
Expand Down

0 comments on commit 65bb935

Please sign in to comment.