Skip to content

Commit 27b5943

Browse files
committed
Merge branch 'master' into cleanup-stale-build
2 parents 91ec3f8 + 12f2578 commit 27b5943

File tree

121 files changed

+5597
-3256
lines changed

Some content is hidden

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

121 files changed

+5597
-3256
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LABEL org.opencontainers.image.description="Docker image for ReScript developmen
44

55
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
66
&& apt-get -y install --no-install-recommends \
7+
yarn \
78
opam \
89
musl-tools \
910
python-is-python3 \

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
*.mli linguist-language=OCaml
33
*.res linguist-language=ReScript
44
*.resi linguist-language=ReScript
5+
6+
.yarn/releases/* binary linguist-vendored

.github/workflows/ci.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ jobs:
135135
- name: Use Node.js
136136
uses: actions/setup-node@v4
137137
with:
138+
cache: yarn
138139
node-version-file: .nvmrc
139140

140141
- name: Get artifact dir name
@@ -244,6 +245,24 @@ jobs:
244245
fi
245246
shell: bash
246247

248+
- name: Compiler build state key
249+
id: compiler-build-state-key
250+
shell: bash
251+
run: |
252+
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" \
253+
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"
254+
255+
- name: Restore compiler build state
256+
if: github.base_ref == 'master' || github.ref == 'refs/heads/master'
257+
id: compiler-build-state
258+
uses: actions/cache/restore@v4
259+
with:
260+
path: |
261+
D:\.cache\dune
262+
~/.cache/dune
263+
_build
264+
key: ${{ steps.compiler-build-state-key.outputs.value }}
265+
247266
- name: Build compiler
248267
if: runner.os != 'Linux'
249268
run: opam exec -- dune build --display quiet --profile release
@@ -252,8 +271,30 @@ jobs:
252271
if: runner.os == 'Linux'
253272
run: opam exec -- dune build --display quiet --profile static
254273

274+
- name: Delete stable compiler build state
275+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
276+
shell: bash
277+
run: |
278+
gh extension install actions/gh-actions-cache
279+
gh actions-cache delete ${{ steps.compiler-build-state-key.outputs.value }} \
280+
-R ${{ github.repository }} \
281+
-B ${{ github.ref }} \
282+
--confirm || echo "not exist"
283+
env:
284+
GH_TOKEN: ${{ github.token }}
285+
286+
- name: Save compiler build state
287+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
288+
uses: actions/cache/save@v4
289+
with:
290+
path: |
291+
D:\.cache\dune
292+
~/.cache/dune
293+
_build
294+
key: ${{ steps.compiler-build-state-key.outputs.value }}
295+
255296
- name: Install npm packages
256-
run: npm ci --ignore-scripts
297+
run: yarn install
257298

258299
- name: Copy compiler exes to platform bin dir
259300
run: node ./scripts/copyExes.js -compiler
@@ -401,10 +442,11 @@ jobs:
401442
- name: Use Node.js
402443
uses: actions/setup-node@v4
403444
with:
445+
cache: yarn
404446
node-version-file: .nvmrc
405447

406448
- name: NPM install
407-
run: npm ci --ignore-scripts
449+
run: yarn install
408450

409451
- name: Download artifacts
410452
uses: actions/download-artifact@v4
@@ -495,6 +537,7 @@ jobs:
495537
- name: Use Node.js
496538
uses: actions/setup-node@v4
497539
with:
540+
cache: yarn
498541
node-version-file: .nvmrc
499542
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
500543

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,10 @@ tests/tools_tests/**/*.res.js
8181
tests/tools_tests/lib
8282
tests/analysis_tests*/lib
8383
tests/analysis_tests/**/*.bs.js
84+
85+
.yarn/*
86+
!.yarn/patches
87+
!.yarn/plugins
88+
!.yarn/releases
89+
!.yarn/sdks
90+
!.yarn/versions

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

.yarn/releases/yarn-4.7.0.cjs

Lines changed: 935 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
yarnPath: .yarn/releases/yarn-4.7.0.cjs
2+
3+
nodeLinker: node-modules
4+
5+
nmMode: hardlinks-global

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@
2727

2828
- Replace ~date with ~day in Date.make\*. https://github.com/rescript-lang/rescript/pull/7324
2929
- Remove `-bs-jsx-mode`. https://github.com/rescript-lang/rescript/pull/7327
30+
- Drop Node.js version <20 support, as it is reaching End-of-Life. https://github.com/rescript-lang/rescript-compiler/pull/7354
31+
- Treat `int` multiplication as a normal int32 operation instead of using `Math.imul`. https://github.com/rescript-lang/rescript/pull/7358
3032

3133
#### :house: Internal
3234

3335
- Clean up legacy tags handling. https://github.com/rescript-lang/rescript/pull/7309
36+
- Use Yarn (Berry) workspaces for internal tooling. https://github.com/rescript-lang/rescript/pull/7309
3437

3538
#### :nail_care: Polish
3639

@@ -39,6 +42,7 @@
3942
- Deprecate unsafe host-specific bindings from stdlib. https://github.com/rescript-lang/rescript/pull/7334
4043
- Make unsafe function names consistent in Stdlib.String. https://github.com/rescript-lang/rescript/pull/7337
4144
- `rescript` package does not trigger `postinstall` script anymore. https://github.com/rescript-lang/rescript/pull/7350
45+
- Add Stdlib Bool and Char modules and improve Pervasives deprecation messages. https://github.com/rescript-lang/rescript/pull/7361
4246

4347
#### :bug: Bug fix
4448

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Happy hacking!
1414

1515
> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!
1616
17-
- [NodeJS v18](https://nodejs.org/)
17+
- [Node.js](https://nodejs.org/) v20.x
18+
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
1819
- C compiler toolchain (usually installed with `xcode` on Mac)
1920
- Python <= 3.11 (required to build ninja)
2021
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
@@ -58,7 +59,7 @@ opam install . --deps-only --with-test --with-dev-setup -y
5859

5960
#### npm install
6061

61-
Run `npm install --ignore-scripts`. This will install the npm dependencies required for the build scripts.
62+
Run `yarn install`. This will install the npm dependencies required for the build scripts.
6263

6364
### B. Devcontainer
6465

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ ninja/ninja:
2626

2727
ninja: ninja/ninja
2828

29-
node_modules/.bin/semver:
30-
npm install
31-
3229
test: lib
3330
node scripts/test.js -all
3431

@@ -54,7 +51,7 @@ test-all: test test-gentype test-analysis test-tools
5451
reanalyze:
5552
reanalyze.exe -set-exit-code -all-cmt _build/default/compiler _build/default/tests -exclude-paths compiler/outcome_printer,compiler/ml,compiler/js_parser,compiler/frontend,compiler/ext,compiler/depends,compiler/core,compiler/common,compiler/cmij,compiler/bsb_helper,compiler/bsb
5653

57-
lib: build node_modules/.bin/semver
54+
lib: build
5855
./scripts/buildRuntime.sh
5956
./scripts/prebuilt.js
6057

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
lib
2-
.merlin
2+
.merlin
3+
package-lock.json
4+
yarn.lock

analysis/examples/example-project/package-lock.json

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/node_modules
2-
/lib
2+
/lib
3+
package-lock.json
4+
yarn.lock

0 commit comments

Comments
 (0)