From d92e36086d7ecadece7116ad55e1f354b1161f33 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 26 Nov 2024 21:35:59 +0100 Subject: [PATCH 1/3] tune flags --- compiler/dune | 4 +++- compiler/test/dune | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/dune b/compiler/dune index de1f90367..879578730 100644 --- a/compiler/dune +++ b/compiler/dune @@ -11,4 +11,6 @@ (env (_ (js_of_ocaml - (flags :standard --no-sourcemap --no-extern-fs --disable use-js-string)))) + (flags (:standard) --no-sourcemap --no-extern-fs --disable use-js-string) + (link_flags (:standard) --no-sourcemap --disable use-js-string) + (build_runtime_flags (:standard) --no-sourcemap --no-extern-fs --disable use-js-string)))) diff --git a/compiler/test/dune b/compiler/test/dune index df0641cee..8a56e35a4 100644 --- a/compiler/test/dune +++ b/compiler/test/dune @@ -12,6 +12,9 @@ (public_name test) (package grain-tests) (modes exe js) + (js_of_ocaml + (link_flags (:standard --linkall)) + ) (flags (:standard -linkall From e6d38edbbecf1a8e57398997dab67d8f8eb021a9 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 26 Nov 2024 21:36:47 +0100 Subject: [PATCH 2/3] Cleanup js runtime --- compiler/src/utils/hacks.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/compiler/src/utils/hacks.js b/compiler/src/utils/hacks.js index 2f5e87215..5f78bbda9 100644 --- a/compiler/src/utils/hacks.js +++ b/compiler/src/utils/hacks.js @@ -1,8 +1,3 @@ -//Provides: os_type -var os_type = (globalThis.process && - globalThis.process.platform && - globalThis.process.platform == "win32") ? "Win32" : "Unix"; - //Provides: unix_opendir //Requires: caml_jsstring_of_string //Requires: make_unix_err_args, caml_raise_with_args, caml_named_value From dff30ee48c2dd2986bc177525c73ce568171d3c1 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 26 Nov 2024 21:37:13 +0100 Subject: [PATCH 3/3] Improve DX --- compiler/test/TestFramework.re | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/test/TestFramework.re b/compiler/test/TestFramework.re index e3a386fe4..b0329daaa 100644 --- a/compiler/test/TestFramework.re +++ b/compiler/test/TestFramework.re @@ -54,7 +54,11 @@ let clean_output = output => let () = { /*** Override default stdlib location to use development version of stdlib */ - let stdlib_dir = Unix.getenv("GRAIN_STDLIB"); + let stdlib_dir = + try(Unix.getenv("GRAIN_STDLIB")) { + | Not_found => + failwith("GRAIN_STDLIB env variable need to be set in order to run tests") + }; let stdlib_dir = Filepath.String.derelativize(stdlib_dir); Config.stdlib_dir := Some(Filepath.to_string(stdlib_dir)); clean_grain_output(test_input_dir);