Skip to content

Commit

Permalink
flake+opam-nix
Browse files Browse the repository at this point in the history
  • Loading branch information
strub committed Mar 23, 2024
1 parent a7d2b01 commit 45f111d
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
authToken: '${{ secrets.CACHIX_WRITE_TOKEN }}'
- name: Build and cache EasyCrypt and dependencies
run: |
nix-build
make nix-build-with-provers
check:
name: Check EasyCrypt Libraries
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.pyo

/_build
/result
/etc
/theories/attic

Expand All @@ -19,3 +20,4 @@

.merlin
*.install
*.log
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ CHECK += --bin=./ec.native --bin-args="$(ECARGS)"
CHECK += --bin-args="$(ECPROVERS:%=-p %)"
CHECK += --timeout="$(ECTOUT)" --jobs="$(ECJOBS)"
CHECK += $(ECEXTRA) config/tests.config
NIX ?= nix --extra-experimental-features "nix-command flakes"

# --------------------------------------------------------------------
UNAME_P = $(shell uname -p)
UNAME_S = $(shell uname -s)

# --------------------------------------------------------------------
.PHONY: default build byte native tests check examples
.PHONY: nix-build nix-build-with-provers nix-develop
.PHONY: clean install uninstall

default: build
Expand Down Expand Up @@ -51,6 +53,15 @@ examples: build
check: unit stdlib examples
@true

nix-build:
$(NIX) build

nix-build-with-provers:
$(NIX) build .#with_provers

nix-develop:
$(NIX) develop

clean:
rm -f ec.native && $(DUNE) clean
find theories examples -name '*.eco' -exec rm '{}' ';'
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,29 @@ following [these instructions](https://nixos.org/manual/nix/stable/#chap-install
Then, at the root of the EasyCrypt source tree, type:
```
$> nix-shell
$> make nix-build
```
These should install all the required dependencies. From there, simply
run:
Once completed, you will find the EasyCrypt binary in `result/bin`.
You can also run
```
$> make
$> make nix-build-with-provers
```
to compile EasyCrypt.
to install EasyCrypt along with a set of provers.
For getting a development environment, you can run:
```
$> make nix-develop
```
These will install all the required dependencies, a set of provers and
will then drop you into a shell. From there, simply run `make` to
compile EasyCrypt.
Note on Prover Versions
--------------------------------------------------------------------
Expand Down
41 changes: 0 additions & 41 deletions default.nix

This file was deleted.

260 changes: 260 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 45f111d

Please sign in to comment.