Skip to content

Commit 9969786

Browse files
committed
Align Js_runtime build and Assemblyscript_runtime build.
1 parent c1b5c27 commit 9969786

File tree

11 files changed

+52
-77
lines changed

11 files changed

+52
-77
lines changed

Makefile

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,11 @@ cleanmost-qcert-compiler:
113113

114114
## Configure
115115

116-
runtimes/javascript/qcert_runtime.ml:
117-
$(MAKE) -C runtimes/javascript
118-
119-
compiler/lib/js_runtime.ml: runtimes/javascript/qcert_runtime.ml
120-
cp runtimes/javascript/qcert_runtime.ml compiler/lib/js_runtime.ml
121-
122116
compiler/lib/static_config.ml:
123117
echo "(* This file is generated *)" > compiler/lib/static_config.ml
124118
echo "let qcert_home = \"$(CURDIR)\"" >> compiler/lib/static_config.ml
125119

126-
prepare: compiler/lib/js_runtime.ml compiler/lib/static_config.ml Makefile.coq
120+
prepare: compiler/lib/static_config.ml Makefile.coq
127121

128122
configure:
129123
@echo "[Q*cert] "
@@ -134,8 +128,6 @@ configure:
134128
clean-configure:
135129

136130
cleanall-configure:
137-
$(MAKE) -C runtimes/javascript cleanall
138-
rm -rf compiler/lib/js_runtime.ml
139131
rm -rf compiler/lib/static_config.ml
140132
rm -f compiler/.merlin compiler/*/.merlin
141133

@@ -243,22 +235,13 @@ qcert-runtimes:
243235
@echo "[Q*cert] "
244236
@echo "[Q*cert] Building runtimes"
245237
@echo "[Q*cert] "
246-
ifneq ($(JAVASCRIPT),)
247-
@$(MAKE) javascript-runtime
248-
endif
249238
ifneq ($(JAVA),)
250239
@$(MAKE) java-runtime
251240
endif
252241
ifneq ($(SPARK),)
253242
@$(MAKE) spark2-runtime
254243
endif
255244

256-
javascript-runtime:
257-
@echo "[Q*cert] "
258-
@echo "[Q*cert] JavaScript runtime"
259-
@echo "[Q*cert] "
260-
@$(MAKE) -C runtimes/javascript
261-
262245
java-runtime:
263246
@echo "[Q*cert] "
264247
@echo "[Q*cert] Java runtime"
@@ -272,14 +255,12 @@ spark2-runtime:
272255
@$(MAKE) -C runtimes/spark2
273256

274257
clean-runtimes:
275-
- @$(MAKE) -C runtimes/javascript clean
276258
- @$(MAKE) -C runtimes/java clean
277259
- @$(MAKE) -C runtimes/spark2 clean
278260
- @rm -rf bin/lib
279261
- @rm -f bin/javaRunner.jar
280262

281263
cleanall-runtimes:
282-
- @$(MAKE) -C runtimes/javascript cleanall
283264
- @$(MAKE) -C runtimes/java cleanall
284265
- @$(MAKE) -C runtimes/spark2 cleanall
285266
- @rm -rf bin/lib
@@ -337,10 +318,7 @@ demo:
337318
bin/qcertJS.js:
338319
@$(MAKE) qcert-javascript
339320

340-
runtimes/javascript/qcert-runtime.js:
341-
@$(MAKE) javascript-runtime
342-
343-
qcert-demo: bin/qcertJS.js runtimes/javascript/qcert-runtime.js
321+
qcert-demo: bin/qcertJS.js
344322
@echo "[Q*cert] "
345323
@echo "[Q*cert] Compiling Web Demo in TypeScript"
346324
@echo "[Q*cert] "

compiler/dune

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
(library
1010
(name qcert_lib)
1111
(public_name coq-qcert)
12-
(libraries base64 uri calendar wasm coq-qcert.assemblyscript)
13-
)
12+
(libraries base64 uri calendar wasm
13+
coq-qcert.runtime.assemblyscript
14+
coq-qcert.runtime.js))
1415

1516
(copy_files util/*.{ml,mli})
1617
(copy_files wasm/*.{ml,mli})

compiler/wasm/wasm_backend.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end = struct
2121
open ImpEJson
2222
module Encoding = Wasm_binary_ejson.Make(ImpEJson)
2323

24-
let runtime = Lazy.force Assemblyscript.Runtime.wasm_ast
24+
let runtime = Lazy.force Assemblyscript_runtime.wasm_ast
2525

2626
let ejson_of_cejson = function
2727
| Coq_cejnull -> Coq_ejnull

runtimes/assemblyscript/assemblyscript.ml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let string = Stringified.runtime
2+
3+
let wasm_ast =
4+
lazy (
5+
let open Wasm in
6+
let m = Decode.decode "runtime.wasm" string in
7+
let () = Valid.check_module m in
8+
m
9+
)

runtimes/assemblyscript/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(library
2-
(name assemblyscript)
3-
(public_name coq-qcert.assemblyscript)
2+
(name assemblyscript_runtime)
3+
(public_name coq-qcert.runtime.assemblyscript)
44
(libraries wasm))
55

66
(rule ; not evaluated for package release (-p flag)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(tests
22
(names force_wasm_ast)
3-
(libraries coq-qcert.assemblyscript))
3+
(libraries coq-qcert.runtime.assemblyscript))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
let _ = Lazy.force Assemblyscript.Runtime.wasm_ast
1+
let _ = Lazy.force Assemblyscript_runtime.wasm_ast

runtimes/javascript/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
qcert-runtime.js
2-
qcert_runtime.ml

runtimes/javascript/Makefile

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)