Skip to content

Commit b10eaa4

Browse files
committed
Don't snapshot
1 parent 5beb7bd commit b10eaa4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+242
-609174
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,18 @@ jobs:
4040
opam-pin: false
4141
opam-depext: false
4242

43+
- name: "Install OPAM dependencies"
44+
run: opam install . --deps-only
45+
46+
- name: "Build compiler (pass 1 - dev)"
47+
run: opam exec -- dune build
48+
4349
- name: Use Node.js
4450
uses: actions/setup-node@v3
4551
with:
4652
node-version: 16
4753

48-
- name: NPM install
54+
- name: Install npm packages
4955
run: opam exec -- npm ci --ignore-scripts
5056

5157
- name: "Check if syntax subfolder has changed"
@@ -58,14 +64,6 @@ jobs:
5864
echo "syntax_status=changed" >> $GITHUB_ENV
5965
fi
6066
61-
- name: "Syntax: install OPAM dependencies"
62-
if: env.syntax_status == 'changed'
63-
run: opam install . --deps-only
64-
65-
- name: "Syntax: build CLI"
66-
if: env.syntax_status == 'changed'
67-
run: opam exec -- dune build
68-
6967
- name: "Syntax: Run roundtrip tests"
7068
if: ${{ env.syntax_status == 'changed' && runner.os != 'Windows' }}
7169
run: opam exec -- make test-syntax-roundtrip
@@ -84,10 +82,13 @@ jobs:
8482
- name: Build ninja
8583
run: node scripts/buildNinjaBinary.js
8684

87-
- name: Run install script
88-
run: opam exec -- node scripts/install.js
89-
env:
90-
RESCRIPT_FORCE_REBUILD: 1
85+
- name: Build runtime/stdlib
86+
# if: runner.os != 'Windows'
87+
run: |
88+
node scripts/copyExes.js
89+
opam exec -- node ./scripts/ninja.js config
90+
opam exec -- node ./scripts/ninja.js build
91+
node scripts/install.js -force-lib-rebuild
9192
9293
- name: Run tests
9394
if: runner.os != 'Windows'
@@ -113,17 +114,6 @@ jobs:
113114
name: lib-ocaml
114115
path: lib/ocaml
115116

116-
# Important: the ninja build must run after the artifact upload because for some reason
117-
# the bsc.exe created by the ninja build does not find the Pervasives module.
118-
# So this is run here just to test the normal dev workflow, too.
119-
- name: ninja config
120-
if: runner.os != 'Windows'
121-
run: opam exec -- node ./scripts/ninja.js config
122-
123-
- name: ninja build
124-
if: runner.os != 'Windows'
125-
run: opam exec -- node ./scripts/ninja.js build
126-
127117
- name: Check for changes in lib folder
128118
run: git diff --exit-code lib/js lib/es6
129119

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SHELL = /bin/bash
22

33
build:
44
dune build
5+
./scripts/copyExes.js
56

67
watch:
78
dune build -w
@@ -12,8 +13,11 @@ bench: build
1213
dce: build
1314
opam exec reanalyze.exe -- -dce-cmt _build
1415

16+
ninja/ninja:
17+
node scripts/buildNinjaBinary.js
18+
1519
test: build
16-
npm test
20+
dune exec -- node scripts/ciTest.js -all
1721

1822
test-syntax: build
1923
dune exec -- syntax_tests
@@ -36,7 +40,8 @@ test-all: test test-gentype
3640
# reanalyze.exe -set-exit-code -all-cmt _build/default -suppress syntax_tests,syntax_compiler_libs -exclude-paths syntax_compiler_libs
3741

3842
lib: build
39-
node scripts/install -force-lib-rebuild
43+
node scripts/ninja.js config
44+
node scripts/ninja.js build
4045

4146
artifacts: lib
4247
./scripts/makeArtifactList.js

jscomp/common/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
(library
22
(name common)
33
(wrapped false)
4+
(preprocess
5+
(action
6+
(run %{bin:cppo} %{env:CPPO_FLAGS=} %{input-file})))
47
(flags
58
(:standard -w +a-9-40-42))
69
(libraries napkin))

jscomp/common/js_config.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# 1 "common/js_config.pp.ml"
21
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
32
*
43
* This program is free software: you can redistribute it and/or modify
@@ -35,11 +34,10 @@ let diagnose = ref false
3534

3635
let get_diagnose () =
3736
!diagnose
38-
39-
# 38 "common/js_config.pp.ml"
37+
#ifndef RELEASE
4038
|| Sys.getenv_opt "RES_DEBUG_FILE" <> None
39+
#endif
4140

42-
# 41 "common/js_config.pp.ml"
4341
(* let (//) = Filename.concat *)
4442

4543
(* let get_packages_info () = !packages_info *)

jscomp/common/js_config.pp.ml

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

jscomp/core/bs_cmi_load.ml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# 1 "core/bs_cmi_load.pp.ml"
21
(* Copyright (C) Hongbo Zhang, Authors of ReScript
32
*
43
* This program is free software: you can redistribute it and/or modify
@@ -23,10 +22,55 @@
2322
* along with this program; if not, write to the Free Software
2423
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2524

25+
#ifdef RELEASE
26+
(*true *)
27+
28+
29+
let load_cmi ~unit_name : Env.Persistent_signature.t option =
30+
match Config_util.find_opt (unit_name ^".cmi") with
31+
| Some filename -> Some {filename; cmi = Cmi_format.read_cmi filename}
32+
| None ->
33+
if !Js_config.no_stdlib then None
34+
else
35+
match Ext_string_array.find_sorted Builtin_cmi_datasets.module_names unit_name with
36+
| Some cmi ->
37+
if Js_config.get_diagnose () then
38+
Format.fprintf Format.err_formatter ">Cmi: %s@." unit_name;
39+
let cmi : Cmi_format.cmi_infos =
40+
Ext_marshal.from_string
41+
Builtin_cmi_datasets.module_data.(cmi) in
42+
if Js_config.get_diagnose () then
43+
Format.fprintf Format.err_formatter "<Cmi: %s@." unit_name;
44+
Some {filename = Sys.executable_name ;
45+
cmi }
46+
| None -> None
47+
48+
let check () = ()
49+
(*
50+
Ext_array.iter
51+
Builtin_cmi_datasets.module_sets_cmi
52+
(fun (name,l) ->
53+
prerr_endline (">checking " ^ name);
54+
let cmi = Lazy.force l in
55+
(match cmi.cmi_crcs with
56+
| (unit , Some digest) :: _ ->
57+
Format.fprintf Format.err_formatter "%s -> %s@." unit (Digest.to_hex digest)
58+
| _ -> ());
59+
prerr_endline ("<checking " ^ name);
60+
);
61+
Ext_array.iter
62+
Builtin_cmj_datasets.module_sets
63+
(fun (name,l) ->
64+
prerr_endline (">checking " ^ name);
65+
let cmj = Lazy.force l in
66+
Format.fprintf Format.err_formatter "%b@." cmj.pure;
67+
prerr_endline ("<checking " ^ name);
68+
) *)
69+
#else
2670

27-
# 71 "core/bs_cmi_load.pp.ml"
2871
let check () = ()
2972
let load_cmi ~unit_name : Env.Persistent_signature.t option =
3073
match Config_util.find_opt (unit_name ^".cmi") with
3174
| Some filename -> Some {filename; cmi = Cmi_format.read_cmi filename}
3275
| None -> None
76+
#endif

jscomp/core/bs_cmi_load.pp.ml

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

0 commit comments

Comments
 (0)