Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine/dune): disable js build by default #506

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/engine_js_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test JS build

on:
pull_request:
merge_group:
workflow_dispatch:
push:
branches: [main]

jobs:
engine-js-build:
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build .\#hax-engine.passthru.js -L
4 changes: 3 additions & 1 deletion CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
FStar, we do not run Coq or FStar on the extractions.
- [`test_installs`](./.github/workflows/test_installs.yml): compiles
the toolchain on two versions of Ubuntu and two versions of MacOS
using `apt` or `homebrew` and the `setup.sh` script.
using `apt` or `homebrew` and the `setup.sh` script;
- [`engine-js-build`](./.github/workflows/engine_js_build.yml): tests
the build the JS version of the engine.

## Merge queue
Additional actions are triggered on pull requests in the merge queue. They are
Expand Down
12 changes: 4 additions & 8 deletions engine/bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@
(modules native_driver)
(libraries lib))

(executable
(optional)
(name js_driver)
(modes js)
(modules js_driver)
(js_of_ocaml
(javascript_files js_stubs/mutex.js js_stubs/stdint.js js_stubs/unix.js))
(libraries zarith_stubs_js js_of_ocaml lib))
; The following line is commented: by default, we don't want to
; generate javascript.

; (include dune-js)
W95Psp marked this conversation as resolved.
Show resolved Hide resolved

(env
(_
Expand Down
8 changes: 8 additions & 0 deletions engine/bin/dune-js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(executable
(optional)
(name js_driver)
(modes js)
(modules js_driver)
(js_of_ocaml
(javascript_files js_stubs/mutex.js js_stubs/stdint.js js_stubs/unix.js))
(libraries zarith_stubs_js js_of_ocaml lib))
2 changes: 2 additions & 0 deletions engine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
name = "hax-engine.js";
nativeBuildInputs = old.nativeBuildInputs ++ [closurecompiler gnused];
buildPhase = ''
# Enable JS build
sed -i "s/; (include dune-js)/(include dune-js)/g" bin/dune
# Compile JS target
dune build bin/js_driver.bc.js
# Optimize the size of the JS file
Expand Down
Loading