-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: nix files for coq coverage example and library
- Loading branch information
Showing
6 changed files
with
126 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
craneLib, | ||
lib, | ||
}: | ||
let | ||
matches = re: path: !builtins.isNull (builtins.match re path); | ||
in | ||
{ | ||
version = "0.0.1"; | ||
src = lib.cleanSourceWith { | ||
src = craneLib.path ./..; | ||
filter = path: type: | ||
# We include only certain files. FStar files under the example | ||
# directory are listed out. Same for proverif (*.pvl) files. | ||
( matches ".*(Makefile|.*[.](rs|toml|lock|diff|fsti?|pv))$" path | ||
&& !matches ".*examples/.*[.]fsti?$" path | ||
) || ("directory" == type); | ||
}; | ||
doCheck = false; | ||
cargoVendorDir = craneLib.vendorMultipleCargoDeps { | ||
cargoLockList = [ | ||
./Cargo.lock | ||
../Cargo.lock | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
hax, | ||
coqPackages, | ||
gnused, | ||
craneLib, | ||
bat, | ||
coqGeneratedCore ? import ../../proof-libs/coq/coq {inherit stdenv coqPackages;}, | ||
}: | ||
let | ||
commonArgs = import ../commonArgs.nix {inherit craneLib lib;}; | ||
cargoArtifacts = craneLib.buildDepsOnly commonArgs; | ||
in | ||
craneLib.mkCargoDerivation (commonArgs | ||
// { | ||
inherit cargoArtifacts; | ||
pname = "coverage"; | ||
doCheck = false; | ||
buildPhaseCargoCommand = '' | ||
cd examples/coverage | ||
cargo hax into coq | ||
cd proofs/coq/extraction | ||
echo -e "-R ${coqGeneratedCore}/lib/coq/user-contrib/Core Core\n$(cat _CoqProject)" > _CoqProject | ||
coq_makefile -f _CoqProject -o Makefile | ||
make | ||
''; | ||
buildInputs = [ | ||
hax | ||
coqPackages.coq-record-update | ||
coqPackages.coq | ||
gnused | ||
]; | ||
}) | ||
|
||
|
||
# COQLIB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
stdenv ? (import <nixpkgs> {}).stdenv, | ||
coqPackages ? (import <nixpkgs> {}).coqPackages, | ||
}: | ||
stdenv.mkDerivation { | ||
name = "hax-coq-generated-core"; | ||
src = ./generated-core; | ||
buildPhase = '' | ||
coq_makefile -f _CoqProject -o Makefile | ||
make | ||
''; | ||
installPhase = '' | ||
export DESTDIR=$out | ||
make install | ||
mv $out/nix/store/*/lib $out | ||
rm -rf $out/nix | ||
''; | ||
buildInputs = [ | ||
coqPackages.coq-record-update | ||
coqPackages.coq | ||
]; | ||
} |