Skip to content

Commit

Permalink
Merge pull request #1615 from GaloisInc/saw-core-coq/ci
Browse files Browse the repository at this point in the history
Add generation of Coq translator libraries to CI
  • Loading branch information
mergify[bot] authored Mar 17, 2022
2 parents 87ab2f3 + 45af7a6 commit bc564dd
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2,181 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,10 @@ jobs:

- run: opam install -y coq=8.13.2 coq-bits=1.1.0

# FIXME: the following builds the Coq libraries for the SAW core
# to Coq translator; if we do other Coq tests, this should become
# its own build artifact, to avoid downloading it twice
# FIXME: the following steps generate Coq libraries for the SAW core to
# Coq translator and builds them; if we do other Coq tests, these steps
# should become their own build artifact, to avoid re-compiling the Coq
# libraries
- working-directory: saw-core-coq/coq
shell: bash
run: opam exec -- make -j
Expand Down
1 change: 1 addition & 0 deletions s2nTests/docker/blst.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN git clone https://github.com/GaloisInc/blst-verification.git /workdir && \
cd /workdir && \
git checkout 05d29b0e9d826053185e5bdba287045aab0b4669 && \
git config --file=.gitmodules submodule.blst.url https://github.com/supranational/blst && \
git config --file=.gitmodules submodule.cryptol-specs.url https://github.com/GaloisInc/cryptol-specs && \
git submodule sync && \
git submodule update --init

Expand Down
26 changes: 19 additions & 7 deletions saw-core-coq/coq/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
all: build
all: Makefile.coq

Makefile.coq: _CoqProject
coq_makefile -f $< -o $@

build: Makefile.coq
make -f Makefile.coq
include Makefile.coq

clean: Makefile.coq
make -f Makefile.coq clean
# Set the SAW variable to the appropriate command. Always look in the path
# first, otherwise fall back on cabal run saw, unless running in CI because if
# saw is not in the path in CI then something else is terribly wrong and that
# should be an error
SAW=$(shell which saw)
ifeq ($(SAW),)
ifeq ($(CI),)
SAW=cabal run saw
else
$(error Could not find SAW executable; PATH = $(PATH))
endif
endif

%.vo: Makefile.coq
make -f Makefile.coq $@
generated/CryptolToCoq/SAWCorePrelude.v: ../../saw-core/prelude/Prelude.sawcore
(mkdir -p generated/CryptolToCoq; cd ../saw; $(SAW) generate_scaffolding.saw)

generated/CryptolToCoq/CryptolPrimitivesForSAWCore.v: ../../cryptol-saw-core/saw/Cryptol.sawcore
(mkdir -p generated/CryptolToCoq; cd ../saw; $(SAW) generate_scaffolding.saw)
1 change: 1 addition & 0 deletions saw-core-coq/coq/generated/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.v
Loading

0 comments on commit bc564dd

Please sign in to comment.