Skip to content

Commit e6b6fbf

Browse files
committed
Build the whole compiler with dune
1 parent 5beb7bd commit e6b6fbf

Some content is hidden

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

78 files changed

+250
-609256
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/prebuilt.js
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/bsb_exe/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name rescript_main)
33
(public_name rescript)
4-
(modes exe)
54
(flags
65
(:standard -w +a-d-4-9-40-41-42-70))
76
(libraries bsb common ext str unix))

jscomp/bsb_helper_exe/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name bsb_helper_main)
33
(public_name bsb_helper)
4-
(modes exe)
54
(flags
65
(:standard -w +a-9-40-42))
76
(libraries bsb_helper))

jscomp/bsc/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name rescript_compiler_main)
33
(public_name bsc)
4-
(modes exe)
54
(flags
65
(:standard -w +a-4-9-30-40-41-42-48-70))
76
(libraries

jscomp/bspack/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name bspack_main)
33
(public_name bspack)
4-
(modes exe)
54
(flags
65
(:standard -w +a-50))
76
(libraries unix))

jscomp/cmij/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name cmij_main)
33
(public_name cmij)
4-
(modes exe)
54
(flags
65
(:standard -w +a-4-9-40-42))
76
(libraries core))

jscomp/cmjdump/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(executable
22
(name cmjdump_main)
33
(public_name cmjdump)
4-
(modes exe)
54
(flags
65
(:standard -w +a-40-42))
76
(libraries core))

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 *)

0 commit comments

Comments
 (0)