Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #699: add ocaml versions #903

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions engine/dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@
(synopsis "The engine of hax, a Rust verification tool")
(description "Hax is divided in two: a frontend (written in Rust) and an engine (written in OCaml). This is the engine.")
(depends
ocaml
(ocaml (>= "4.14.1"))
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 (= "v0.16.2"))
(core (= "v0.16.2"))
(yojson (= "2.2.0"))
(non_empty_list (= "0.1"))
(pprint (= "0.1"))
(ppx_deriving_yojson (= "3.7.0"))
(ppx_yojson_conv (= "v0.15.1"))
(ppx_sexp_conv (= "v0.16.0"))
(ppx_compare (= "v0.16.0"))
(ppx_hash (= "v0.16.0"))
(ppx_deriving (= "5.2.1"))
(cmdliner (= "1.3.0"))
(angstrom (= "0.16.0"))
(re (= "1.11.0"))
(ppx_matches (= "0.1"))
(ppx_string (= "v0.16.0"))
(logs (= "0.7.0"))
(ocamlgraph (= "2.1"))

js_of_ocaml-compiler
js_of_ocaml
Expand Down
38 changes: 19 additions & 19 deletions engine/hax-engine.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ homepage: "https://github.com/hacspec/hax"
doc: "https://hacspec.org/hax/"
bug-reports: "https://github.com/hacspec/hax/issues"
depends: [
"ocaml"
"ocaml" {>= "4.14.1"}
"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" {= "v0.16.2"}
"core" {= "v0.16.2"}
"yojson" {= "2.2.0"}
"non_empty_list" {= "0.1"}
"pprint" {= "0.1"}
"ppx_deriving_yojson" {= "3.7.0"}
"ppx_yojson_conv" {= "v0.15.1"}
"ppx_sexp_conv" {= "v0.16.0"}
"ppx_compare" {= "v0.16.0"}
"ppx_hash" {= "v0.16.0"}
"ppx_deriving" {= "5.2.1"}
"cmdliner" {= "1.3.0"}
"angstrom" {= "0.16.0"}
"re" {= "1.11.0"}
"ppx_matches" {= "0.1"}
"ppx_string" {= "v0.16.0"}
"logs" {= "0.7.0"}
"ocamlgraph" {= "2.1"}
"js_of_ocaml-compiler"
"js_of_ocaml"
"js_of_ocaml-ppx"
Expand Down
26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,32 @@
| sed 's#.*"https://github.com/rust-lang/rust/commit/\([^"]*\)".*#\1#' \
> $out
'';
# `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: \Kv?[0-9.]+" | head -n1 || true)
version=$(echo "$version" | grep -Po "^v?\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
Loading