Skip to content
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
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,7 @@ archi: $(EXTRA_DIR)/ocamldot/ocamldot
dot -Tpdf archi.dot > archi.pdf

lock:
dune build ./alt-ergo-lib.opam
opam lock ./alt-ergo-lib.opam -w
# Remove OCaml compiler constraints
sed -i \
'/"ocaml"\|"ocaml-base-compiler"\|"ocaml-system"\|"ocaml-config"\|"base-domains"\|"base-nnp"/d' \
./alt-ergo-lib.opam.locked
./rsc/extra/generate_lock_file.sh

dev-switch:
opam switch create . --deps-only --ignore-constraints-on alt-ergo-lib
Expand Down
43 changes: 16 additions & 27 deletions alt-ergo-lib.opam.locked
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

opam-version: "2.0"
name: "alt-ergo-lib"
version: "dev"
Expand All @@ -17,64 +18,55 @@ doc: "https://ocamlpro.github.io/alt-ergo"
bug-reports: "https://github.com/OCamlPro/alt-ergo/issues"
depends: [
"base-bigarray" {= "base"}
"base-bytes" {= "base"}
"base-threads" {= "base"}
"base-unix" {= "base"}
"camlzip" {= "1.14"}
"cmdliner" {= "2.1.0"}
"cmdliner" {= "2.1.1"}
"conf-gmp" {= "5"}
"conf-pkg-config" {= "4"}
"conf-pkg-config" {= "5"}
"conf-zlib" {= "1"}
"cppo" {= "1.8.0"}
"crunch" {= "4.0.0"}
"crunch" {= "4.1.0"}
"csexp" {= "1.5.2"}
"dolmen" {= "dev"}
"dolmen_loop" {= "dev"}
"dolmen_type" {= "dev"}
"dune" {= "3.22.0"}
"dune-build-info" {= "3.22.0"}
"dune-configurator" {= "3.22.0"}
"dune-private-libs" {= "3.22.0"}
"dune-site" {= "3.22.0"}
"dyn" {= "3.22.0"}
"dune" {= "3.24.2"}
"dune-build-info" {= "3.24.2"}
"dune-private-libs" {= "3.24.2"}
"dune-site" {= "3.24.2"}
"dyn" {= "3.24.2"}
"fmt" {= "0.11.0"}
"fs-io" {= "3.22.0"}
"fs-io" {= "3.24.2"}
"gen" {= "1.1"}
"hmap" {= "0.8.1"}
"js_of_ocaml-compiler" {= "6.2.0"}
"logs" {= "0.10.0"}
"lwt" {= "5.9.2"}
"menhir" {= "20260209"}
"menhirCST" {= "20260209"}
"menhirGLR" {= "20260209"}
"menhirLib" {= "20260209"}
"menhirSdk" {= "20260209"}
"ocaml-compiler-libs" {= "v0.12.4"}
"ocaml-options-vanilla" {= "1"}
"ocamlbuild" {= "0.16.1"}
"ocamlfind" {= "1.9.8"}
"ocplib-endian" {= "1.2"}
"ocplib-simplex" {= "0.5.1"}
"ordering" {= "3.22.0"}
"ordering" {= "3.24.2"}
"ounit2" {= "2.2.7" & with-test}
"pp" {= "2.0.0"}
"pp_loc" {= "2.1.0"}
"ptime" {= "1.2.0"}
"qcheck" {= "0.25" & with-test}
"qcheck-core" {= "0.25" & with-test}
"qcheck-ounit" {= "0.25" & with-test}
"sedlex" {= "3.7"}
"seq" {= "base"}
"sexplib0" {= "v0.16.0"}
"spelll" {= "0.4"}
"stdlib-shims" {= "0.3.0"}
"stdune" {= "3.22.0"}
"top-closure" {= "3.22.0"}
"stdune" {= "3.24.2"}
"top-closure" {= "3.24.2"}
"topkg" {= "1.1.1"}
"uutf" {= "1.0.4"}
"yojson" {= "2.2.2"}
"zarith" {= "1.14"}
]
conflicts: [
"result" {< "1.5"}
]
build: [
["dune" "subst"] {dev}
[
Expand All @@ -92,9 +84,6 @@ build: [
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/OCamlPro/alt-ergo.git"
conflicts: [
"result" {< "1.5"}
]
pin-depends: [
[
"dolmen.dev"
Expand Down
91 changes: 91 additions & 0 deletions alt-ergo.opam.locked
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
opam-version: "2.0"
name: "alt-ergo"
version: "dev"
synopsis: "The Alt-Ergo SMT prover"
description: """\
Alt-Ergo is an automatic theorem prover of mathematical formulas. It was developed at LRI, and is now maintained at OCamlPro.

See more details on https://alt-ergo.ocamlpro.com/"""
maintainer: "Alt-Ergo developers <alt-ergo@ocamlpro.com>"
authors: "Alt-Ergo developers <alt-ergo@ocamlpro.com>"
license: ["LicenseRef-OCamlpro-Non-Commercial" "Apache-2.0"]
tags: "org:OCamlPro"
homepage: "https://alt-ergo.ocamlpro.com/"
doc: "https://ocamlpro.github.io/alt-ergo"
bug-reports: "https://github.com/OCamlPro/alt-ergo/issues"
depends: [
"alt-ergo-lib" {= "dev"}
"base-bigarray" {= "base"}
"base-threads" {= "base"}
"base-unix" {= "base"}
"camlzip" {= "1.14"}
"cmdliner" {= "2.1.1"}
"conf-gmp" {= "5"}
"conf-pkg-config" {= "5"}
"conf-zlib" {= "1"}
"crunch" {= "4.1.0"}
"csexp" {= "1.5.2"}
"dolmen" {= "dev"}
"dolmen_loop" {= "dev"}
"dolmen_type" {= "dev"}
"dune" {= "3.24.2"}
"dune-build-info" {= "3.24.2"}
"dune-private-libs" {= "3.24.2"}
"dune-site" {= "3.24.2"}
"dyn" {= "3.24.2"}
"fmt" {= "0.11.0"}
"fs-io" {= "3.24.2"}
"gen" {= "1.1"}
"hmap" {= "0.8.1"}
"logs" {= "0.10.0"}
"menhir" {= "20260209"}
"menhirCST" {= "20260209"}
"menhirGLR" {= "20260209"}
"menhirLib" {= "20260209"}
"menhirSdk" {= "20260209"}
"ocamlbuild" {= "0.16.1"}
"ocplib-simplex" {= "0.5.1"}
"ordering" {= "3.24.2"}
"pp" {= "2.0.0"}
"pp_loc" {= "2.1.0"}
"ptime" {= "1.2.0"}
"seq" {= "base"}
"spelll" {= "0.4"}
"stdlib-shims" {= "0.3.0"}
"stdune" {= "3.24.2"}
"top-closure" {= "3.24.2"}
"topkg" {= "1.1.1"}
"uutf" {= "1.0.4"}
"zarith" {= "1.14"}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/OCamlPro/alt-ergo.git"
pin-depends: [
[
"dolmen.dev"
"git+https://github.com/Gbury/dolmen.git#a0f1bc66e7256fff1068ac0df525a2d23c1f3ea7"
]
[
"dolmen_loop.dev"
"git+https://github.com/Gbury/dolmen.git#a0f1bc66e7256fff1068ac0df525a2d23c1f3ea7"
]
[
"dolmen_type.dev"
"git+https://github.com/Gbury/dolmen.git#a0f1bc66e7256fff1068ac0df525a2d23c1f3ea7"
]
]
1 change: 1 addition & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import sources.nixpkgs {
};
});
zarith_stubs_js = self.callPackage ./zarith_stubs_js.nix { };
opam-ed = self.callPackage ./opam-ed.nix { };
});
})
];
Expand Down
25 changes: 25 additions & 0 deletions nix/opam-ed.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ sources, lib, ocamlPackages, cmdliner_2, opam-file-format }:

let
opam-ed = sources.opam-ed;
in

ocamlPackages.buildDunePackage {
strictDeps = true;
pname = "opam-ed";
inherit (opam-ed) version;

minimalOCamlVersion = "4.08";
duneVersion = "3";

propagatedBuildInputs = with ocamlPackages; [
cmdliner_2
opam-file-format
];

src = opam-ed;

meta = with lib; {
inherit (opam-ed) homepage description;
};
}
13 changes: 13 additions & 0 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "0.5.1"
},
"opam-ed": {
"branch": "master",
"description": "A small command-line tool to help with mechanical edition of opam files",
"homepage": null,
"owner": "ocaml-opam",
"repo": "opam-ed",
"rev": "ac93c41d99987f598dffa012f73794cafdc0e487",
"sha256": "1fm38mr439pm1yndskk484z4b7l20bdp7r14ygjxfc7rdny0w31a",
"type": "tarball",
"url": "https://github.com/ocaml-opam/opam-ed/archive/ac93c41d99987f598dffa012f73794cafdc0e487.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "0.5"
},
"pp_loc": {
"branch": "v2.1.0",
"description": "Pretty-printing for error source locations",
Expand Down
29 changes: 29 additions & 0 deletions rsc/extra/filter_depends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e

forbidden_fields=(
"\"ocaml\""
"\"ocaml-base-compiler\""
"\"ocaml-system\""
"\"ocaml-config\""
"\"ocaml-variants\""
"\"ocaml-compiler\""
"\"ocaml-compiler-libs\""
"\"ocaml-options-vanilla\""
"\"base-domains\""
"\"base-effects\""
"\"base-nnp\""
"\"ocamlfind\""
"\"host"
)

read input || true

for key in "${forbidden_fields[@]}"
do
if [[ "$input" =~ "$key" ]] then
exit 1
fi
done

exit 0
40 changes: 40 additions & 0 deletions rsc/extra/generate_lock_file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
export LOCKED_SWITCH="${LOCKED_SWITCH:=alt-ergo-locked}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obscure shell trick number 2137:

Suggested change
export LOCKED_SWITCH="${LOCKED_SWITCH:=alt-ergo-locked}"
: "${LOCKED_SWITCH:=alt-ergo-locked}"

: is a no-op command in sh/bash and this sets a variable to a default value without having to repeat the name of the variable – "${LOCKED_SWITCH:=alt-ergo-locked}" already updates the value of $LOCKED_SWITCH, that's what := does.

(duplicating the variable name is OK, just sharing the knowledge)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I know this syntax and I no longer use it because it looks obscure. I can apply this change if you want.

export OPAMYES=true
export OPAMSWITCH="$LOCKED_SWITCH"

function cleanup() {
opam switch remove "$LOCKED_SWITCH"
}

function check_switch_available() {
opam list >/dev/null 2>&1
}

if check_switch_available; then
cat << EOF
The switch $LOCKED_SWITCH already exists. Please remove it to run the script
or override the value of the environment variable \$LOCKED_SWITCH.
EOF
exit 1
fi

trap cleanup EXIT
opam switch create "$LOCKED_SWITCH" 5.4.1 --no-switch

opam install --deps-only --with-test --assume-depexts \
./alt-ergo-lib.opam \
./alt-ergo.opam

opam exec -- dune build @install @runtest -p \
alt-ergo-lib,alt-ergo

opam lock -w \
./alt-ergo-lib.opam \
./alt-ergo.opam

opam-ed -i \
"filter depends ./rsc/extra/filter_depends.sh" \
-f ./alt-ergo-lib.opam.locked \
-f ./alt-ergo.opam.locked
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ pkgs.mkShell {
landmarks-ppx
qcheck
utop
opam-ed
]);
}
Loading