Skip to content

Commit

Permalink
Add js_of_ocaml build and deployment
Browse files Browse the repository at this point in the history
Some comparison of different arguments we could pass:
```
''
(real: 1247.15, user: 1237.92, sys: 8.82, mem: 3524544 ko)
--pretty --no-inline --debug-info --source-map
(real: 554.62, user: 545.29, sys: 9.31, mem: 4551068 ko)
--source-map --no-inline
(real: 431.91, user: 428.62, sys: 3.26, mem: 4588916 ko)
--source-map
(real: 599.19, user: 597.36, sys: 1.82, mem: 4528112 ko)
```

```
     Time |   Peak Mem | File Name
---------------------------------------------------------------------------
29m31.04s | 4582528 ko | Total Time / Peak Mem
---------------------------------------------------------------------------
10m11.06s | 4187496 ko | ExtractionJsOfOCaml/fiat_crypto.js
 7m04.23s | 4582528 ko | ExtractionJsOfOCaml/bedrock2_fiat_crypto.js
 7m03.61s | 4553728 ko | ExtractionJsOfOCaml/with_bedrock2_fiat_crypto.js
 1m23.70s | 2376368 ko | ExtractionJsOfOCaml/with_bedrock2_fiat_crypto.ml
 1m02.46s | 2376740 ko | ExtractionJsOfOCaml/bedrock2_fiat_crypto.ml
 0m58.92s | 2324704 ko | ExtractionJsOfOCaml/fiat_crypto.ml
 0m36.52s | 2840248 ko | ExtractionJsOfOCaml/with_bedrock2_fiat_crypto.byte
 0m30.87s | 2893620 ko | ExtractionJsOfOCaml/fiat_crypto.byte
 0m30.58s | 2839784 ko | ExtractionJsOfOCaml/bedrock2_fiat_crypto.byte
 0m02.66s | 1047220 ko | Bedrock/Standalone/StandaloneJsOfOCamlMain.vo
 0m02.52s | 1014884 ko | StandaloneMonadicUtils.vo
 0m02.30s | 1017460 ko | StandaloneJsOfOCamlMain.vo
 0m00.61s |  103496 ko | ExtractionJsOfOCaml/with_bedrock2_fiat_crypto.cmi
 0m00.51s |  103272 ko | ExtractionJsOfOCaml/bedrock2_fiat_crypto.cmi
 0m00.50s |  100760 ko | ExtractionJsOfOCaml/fiat_crypto.cmi
 ```
  • Loading branch information
JasonGross committed Nov 18, 2023
1 parent 2177d3e commit 8180d54
Show file tree
Hide file tree
Showing 20 changed files with 902 additions and 49 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/coq-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,48 @@ jobs:
- name: make deps
shell: alpine.sh {0}
run: make TIMED=1 TIMING=1 -j2 deps
- name: all-except-generated
- name: all-except-generated-and-js-of-ocaml
shell: alpine.sh {0}
run: make TIMED=1 TIMING=1 -j2 CAMLEXTRAFLAGS="-ccopt -static" all-except-generated
- name: generated-files
shell: alpine.sh {0}
run: make TIMED=1 TIMING=1 -j2 generated-files
- run: tar -czvf generated-files.tgz fiat-*/
if: ${{ failure() }}
- name: upload generated files
uses: actions/upload-artifact@v3
with:
name: generated-files-${{ matrix.alpine }}
path: generated-files.tgz
if: ${{ failure() }}
run: make TIMED=1 TIMING=1 -j2 CAMLEXTRAFLAGS="-ccopt -static" all-except-generated-and-js-of-ocaml
- name: install-standalone-unified-ocaml
shell: alpine.sh {0}
run: make install-standalone-unified-ocaml BINDIR=dist
# - name: install-standalone-js-of-ocaml
# shell: alpine.sh {0}
# run: make install-standalone-js-of-ocaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-${{ matrix.alpine }}
path: dist/fiat_crypto
# - name: upload standalone js files
# uses: actions/upload-artifact@v3
# with:
# name: standalone-html-${{ matrix.alpine }}
# path: fiat-html
- name: upload OCaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionOCaml-${{ matrix.alpine }}
path: src/ExtractionOCaml
if: always ()
# - name: upload js_of_ocaml files
# uses: actions/upload-artifact@v3
# with:
# name: ExtractionJsOfOCaml-${{ matrix.alpine }}
# path: src/ExtractionJsOfOCaml
# if: always ()
- name: generated-files
shell: alpine.sh {0}
run: make TIMED=1 TIMING=1 -j2 generated-files
- run: tar -czvf generated-files.tgz fiat-*/
if: ${{ failure() }}
- name: upload generated files
uses: actions/upload-artifact@v3
with:
name: generated-files-${{ matrix.alpine }}
path: generated-files.tgz
if: ${{ failure() }}
- name: standalone-haskell
shell: alpine.sh {0}
run: make TIMED=1 TIMING=1 -j1 standalone-haskell GHCFLAGS='+RTS -M7G -RTS'
Expand All @@ -93,13 +107,13 @@ jobs:
run: make TIMED=1 TIMING=1 -j2 only-test-amd64-files-lite SLOWEST_FIRST=1
- name: install
shell: alpine.sh {0}
run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: install-without-bedrock2
shell: alpine.sh {0}
run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml
run: sudo make EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 SKIP_REGENERATING_EVERYTHING_V=1 install-without-bedrock2 install-standalone-ocaml
- name: install-dev
shell: alpine.sh {0}
run: sudo make EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml
run: sudo make EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: display timing info
run: cat time-of-build-pretty.log || true
- name: display per-line timing info
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/coq-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
- name: make deps
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh -j2 deps
- name: all-except-generated
- name: all-except-generated-and-js-of-ocaml
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh -j2 all-except-generated
run: etc/ci/github-actions-make.sh -j2 all-except-generated-and-js-of-ocaml
- name: generated-files
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh -j2 generated-files
Expand All @@ -60,17 +60,34 @@ jobs:
- name: install-standalone-unified-ocaml
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist
- name: standalone-js-of-ocaml
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh -j2 standalone-js-of-ocaml
- name: install-standalone-js-of-ocaml
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh install-standalone-js-of-ocaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-${{ matrix.env.DEBIAN }}
path: dist/fiat_crypto
- name: upload standalone js files
uses: actions/upload-artifact@v3
with:
name: standalone-html-${{ matrix.env.DEBIAN }}
path: fiat-html
- name: upload OCaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionOCaml-${{ matrix.env.DEBIAN }}
path: src/ExtractionOCaml
if: always ()
- name: upload js_of_ocaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionJsOfOCaml-${{ matrix.env.DEBIAN }}
path: src/ExtractionJsOfOCaml
if: always ()
- name: standalone-haskell
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-make.sh -j1 standalone-haskell GHCFLAGS='+RTS -M7G -RTS'
Expand All @@ -85,13 +102,13 @@ jobs:
run: etc/ci/github-actions-make.sh -j2 only-test-amd64-files-lite SLOWEST_FIRST=1
- name: install
shell: in-debian-chroot.sh {0}
run: sudo etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
run: sudo etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: install-without-bedrock2
shell: in-debian-chroot.sh {0}
run: sudo etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml
run: sudo etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 SKIP_REGENERATING_EVERYTHING_V=1 install-without-bedrock2 install-standalone-ocaml
- name: install-dev
shell: in-debian-chroot.sh {0}
run: sudo etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml
run: sudo etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: display timing info
run: cat time-of-build-pretty.log
- name: display per-line timing info
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/coq-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,43 @@ jobs:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: etc/ci/github-actions-docker-make.sh ${EXTRA_GH_REPORTIFY} -j2 all-except-generated
custom_script: etc/ci/github-actions-docker-make.sh ${EXTRA_GH_REPORTIFY} -j2 all-except-generated-and-js-of-ocaml
- name: standalone-js-of-ocaml
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.env.DOCKER_COQ_VERSION }}
ocaml_version: ${{ matrix.env.DOCKER_OCAML_VERSION }}
export: CI ALLOW_DIFF COQCHKEXTRAFLAGS
custom_script: |
eval $(opam env)
opam install -y js_of_ocaml
etc/ci/github-actions-docker-make.sh ${EXTRA_GH_REPORTIFY} -j2 standalone-js-of-ocaml
- name: install-standalone-js-of-ocaml
run: make -f Makefile.standalone install-standalone-js-of-ocaml
- name: backup .gitignore
run: mv .gitignore{,.bak}
- name: Deploy js_of_ocaml 🚀 ${{ ( github.ref != 'refs/heads/master' && '(dry run)' ) || '' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: fiat-html # The folder the action should deploy.
git-config-email: [email protected]
target-folder: .
single-commit: true # otherwise the repo will get too big
dry-run: ${{ github.ref != 'refs/heads/master' }}
- name: restore .gitignore
run: mv .gitignore{.bak,}
- name: upload standalone js files
uses: actions/upload-artifact@v3
with:
name: standalone-html-docker-coq-${{ matrix.env.DOCKER_COQ_VERSION }}
path: fiat-html
- name: upload js_of_ocaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionJsOfOCaml-${{ matrix.env.COQ_VERSION }}
path: src/ExtractionJsOfOCaml
if: always ()
- name: generated-files
run: etc/ci/github-actions-make.sh ${EXTRA_GH_REPORTIFY} -f Makefile.examples -j2 generated-files
if: github.event_name == 'pull_request' || ${{ matrix.env.COQ_VERSION }} != 'master'
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/coq-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
OPAMYES: "true"
OPAMCONFIRMLEVEL: "unsafe-yes"

- name: Install js_of_ocaml
run: |
set -e
eval $(opam env)
opam install js_of_ocaml
env:
OPAMYES: "true"
OPAMCONFIRMLEVEL: "unsafe-yes"

- name: echo build params
run: |
eval $(opam env)
Expand All @@ -70,6 +79,11 @@ jobs:
eval $(opam env)
etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist
- name: install-standalone-js-of-ocaml
run: |
eval $(opam env)
etc/ci/github-actions-make.sh install-standalone-js-of-ocaml
- name: only-test-amd64-files-lite
run: |
eval $(opam env)
Expand All @@ -80,23 +94,33 @@ jobs:
with:
name: ExtractionOCaml
path: src/ExtractionOCaml
- name: upload js_of_ocaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionJsOfOCaml
path: src/ExtractionJsOfOCaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-macos
path: dist/fiat_crypto
- name: upload standalone js files
uses: actions/upload-artifact@v3
with:
name: standalone-html-macos
path: fiat-html
- name: install
run: |
eval $(opam env)
etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: install-without-bedrock2
run: |
eval $(opam env)
etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml
etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 SKIP_REGENERATING_EVERYTHING_V=1 install-without-bedrock2 install-standalone-ocaml
- name: install-dev
run: |
eval $(opam env)
etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml
etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml
- name: display timing info
run: cat time-of-build-pretty.log
- name: display per-line timing info
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/coq-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
default: https://github.com/ocaml/opam-repository.git
- run: opam depext coq.${{ env.COQ_VERSION }}
- run: opam pin add --kind=version coq ${{ env.COQ_VERSION }}
- run: opam install js_of_ocaml

- name: Install System Dependencies
run: |
Expand Down Expand Up @@ -76,13 +77,22 @@ jobs:
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh install-standalone-unified-ocaml BINDIR=dist'
shell: cmd

- name: coq
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j1 coq'
shell: cmd
- name: all-except-generated
- name: all-except-generated-and-js-of-ocaml
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j1 all-except-generated-and-js-of-ocaml'
shell: cmd
- name: standalone-js-of-ocaml
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j1 standalone-js-of-ocaml'
shell: cmd
- name: install-standalone-js-of-ocaml
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j1 all-except-generated'
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh install-standalone-js-of-ocaml'
shell: cmd
- name: c-files lite-generated-files
run: |
Expand All @@ -97,22 +107,32 @@ jobs:
with:
name: ExtractionOCaml
path: src/ExtractionOCaml
- name: upload js_of_ocaml files
uses: actions/upload-artifact@v3
with:
name: ExtractionJsOfOCaml
path: src/ExtractionJsOfOCaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-windows
path: dist/fiat_crypto.exe
- name: upload standalone js files
uses: actions/upload-artifact@v3
with:
name: standalone-html-windows
path: fiat-html
- name: install
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml'
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml'
shell: cmd
- name: install-without-bedrock2
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml'
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 SKIP_REGENERATING_EVERYTHING_V=1 install-without-bedrock2 install-standalone-ocaml'
shell: cmd
- name: install-dev
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml'
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 SKIP_REGENERATING_EVERYTHING_V=1 install install-standalone-ocaml'
shell: cmd
- name: display timing info
run: type time-of-build-pretty.log
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ src/ExtractionOCaml/perf_unsaturated_solinas
src/ExtractionOCaml/perf_word_by_word_montgomery
src/ExtractionOCaml/*.ml
src/ExtractionOCaml/*.mli
src/ExtractionJsOfOCaml/*.ml
src/ExtractionJsOfOCaml/*.mli
src/ExtractionJsOfOCaml/*.js
src/ExtractionJsOfOCaml/*.map
src/Rewriter/PerfTesting/Specific/generated/*.v
src/Rewriter/PerfTesting/Specific/generated/*.log
src/Rewriter/PerfTesting/Specific/generated/*.sh
Expand All @@ -216,6 +220,8 @@ fiat-amd64/*.status
fiat-amd64/*.only-status
fiat-amd64/*.description
fiat-amd64/*.invocation
fiat-html/fiat_crypto.js
fiat-html/fiat_crypto.map
/Makefile.test-amd64-files.mk

# Rust
Expand Down
Loading

0 comments on commit 8180d54

Please sign in to comment.