Skip to content

Commit bc564dd

Browse files
authored
Merge pull request #1615 from GaloisInc/saw-core-coq/ci
Add generation of Coq translator libraries to CI
2 parents 87ab2f3 + 45af7a6 commit bc564dd

File tree

6 files changed

+25
-2181
lines changed

6 files changed

+25
-2181
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,10 @@ jobs:
267267

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

270-
# FIXME: the following builds the Coq libraries for the SAW core
271-
# to Coq translator; if we do other Coq tests, this should become
272-
# its own build artifact, to avoid downloading it twice
270+
# FIXME: the following steps generate Coq libraries for the SAW core to
271+
# Coq translator and builds them; if we do other Coq tests, these steps
272+
# should become their own build artifact, to avoid re-compiling the Coq
273+
# libraries
273274
- working-directory: saw-core-coq/coq
274275
shell: bash
275276
run: opam exec -- make -j

s2nTests/docker/blst.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN git clone https://github.com/GaloisInc/blst-verification.git /workdir && \
77
cd /workdir && \
88
git checkout 05d29b0e9d826053185e5bdba287045aab0b4669 && \
99
git config --file=.gitmodules submodule.blst.url https://github.com/supranational/blst && \
10+
git config --file=.gitmodules submodule.cryptol-specs.url https://github.com/GaloisInc/cryptol-specs && \
1011
git submodule sync && \
1112
git submodule update --init
1213

saw-core-coq/coq/Makefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
all: build
1+
all: Makefile.coq
22

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

6-
build: Makefile.coq
7-
make -f Makefile.coq
6+
include Makefile.coq
87

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

12-
%.vo: Makefile.coq
13-
make -f Makefile.coq $@
21+
generated/CryptolToCoq/SAWCorePrelude.v: ../../saw-core/prelude/Prelude.sawcore
22+
(mkdir -p generated/CryptolToCoq; cd ../saw; $(SAW) generate_scaffolding.saw)
23+
24+
generated/CryptolToCoq/CryptolPrimitivesForSAWCore.v: ../../cryptol-saw-core/saw/Cryptol.sawcore
25+
(mkdir -p generated/CryptolToCoq; cd ../saw; $(SAW) generate_scaffolding.saw)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.v

0 commit comments

Comments
 (0)