Skip to content

Commit 2ed005b

Browse files
tsnobipcknitt
andauthored
Backport to v11 bundle and upload stdlib js runtime (#7255) (#7268)
* backport bundle stdlib JS files for playground (#7255) * replace deprecated pipes with shlex * update setup-ocaml * use node 18 * add rollup linux as an optional dependency * use ubuntu-24.04 and ubuntu-24.04-arm * backport fix for hanging tests (#6667) * update artifacts.txt * backport: CI: don't run npm pack twice (#6923) * CI: don't run npm pack twice * Add typedefs for PackOutput * Update comments * update artifacts * Fix CHANGELOG.md --------- Co-authored-by: Christoph Knittel <ck@cca.io>
1 parent 176f02d commit 2ed005b

File tree

13 files changed

+3179
-196
lines changed

13 files changed

+3179
-196
lines changed

.github/workflows/ci.yml

+21-26
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
os: [ubuntu-latest, buildjet-2vcpu-ubuntu-2204-arm]
32+
os: [ubuntu-24.04, ubuntu-24.04-arm]
3333

3434
runs-on: ${{matrix.os}}
3535

@@ -61,7 +61,7 @@ jobs:
6161
needs:
6262
- static-binaries-linux
6363

64-
runs-on: buildjet-2vcpu-ubuntu-2204-arm
64+
runs-on: ubuntu-24.04-arm
6565

6666
steps:
6767
- name: Checkout
@@ -82,7 +82,7 @@ jobs:
8282
- name: Use Node.js
8383
uses: actions/setup-node@v4
8484
with:
85-
node-version: 16
85+
node-version: 18
8686

8787
- name: Copy exes to platform bin dirs
8888
run: node ./scripts/copyExes.js
@@ -105,7 +105,7 @@ jobs:
105105
os: [
106106
macos-13, # x64
107107
macos-14, # ARM
108-
ubuntu-latest,
108+
ubuntu-24.04,
109109
windows-latest,
110110
]
111111
ocaml_compiler: [4.14.1]
@@ -140,20 +140,18 @@ jobs:
140140
chmod +x _build/install/default/bin/*
141141
142142
- name: Use OCaml ${{matrix.ocaml_compiler}}
143-
uses: ocaml/setup-ocaml@v2
143+
uses: ocaml/setup-ocaml@v3.2.5
144144
if: matrix.os != 'windows-latest'
145145
with:
146146
ocaml-compiler: ${{matrix.ocaml_compiler}}
147147
opam-pin: false
148-
opam-depext: false
149148

150149
- name: Use OCaml ${{matrix.ocaml_compiler}} (Win)
151-
uses: ocaml/setup-ocaml@v2
150+
uses: ocaml/setup-ocaml@v3.2.5
152151
if: matrix.os == 'windows-latest'
153152
with:
154153
ocaml-compiler: ${{matrix.ocaml_compiler}}
155154
opam-pin: false
156-
opam-depext: false
157155
opam-repositories: |
158156
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
159157
default: https://github.com/ocaml/opam-repository.git
@@ -168,7 +166,7 @@ jobs:
168166
- name: Use Node.js
169167
uses: actions/setup-node@v4
170168
with:
171-
node-version: 16
169+
node-version: 18
172170

173171
- name: Install npm packages
174172
run: npm ci --ignore-scripts
@@ -228,24 +226,24 @@ jobs:
228226
if: runner.os == 'Windows'
229227
run: node scripts/ciTest.js -mocha -theme -format
230228

231-
# Build the playground compiler on the fastest runner (ubuntu-latest)
229+
# Build the playground compiler on the fastest runner (ubuntu-24.04)
232230
- name: Install JSOO
233-
if: matrix.os == 'ubuntu-latest'
231+
if: matrix.os == 'ubuntu-24.04'
234232
run: opam install js_of_ocaml.4.0.0
235233

236234
- name: Build playground compiler
237-
if: matrix.os == 'ubuntu-latest'
235+
if: matrix.os == 'ubuntu-24.04'
238236
run: |
239237
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
240238
opam exec -- dune build --profile browser
241239
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js
242240
243241
- name: Test playground compiler
244-
if: matrix.os == 'ubuntu-latest'
242+
if: matrix.os == 'ubuntu-24.04'
245243
run: node playground/playground_test.js
246244

247245
- name: Upload playground compiler to CDN
248-
if: ${{ matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v') }}
246+
if: ${{ matrix.os == 'ubuntu-24.04' && startsWith(github.ref, 'refs/tags/v') }}
249247
env:
250248
KEYCDN_USER: ${{ secrets.KEYCDN_USER }}
251249
KEYCDN_PASSWORD: ${{ secrets.KEYCDN_PASSWORD }}
@@ -269,7 +267,7 @@ jobs:
269267

270268
package:
271269
needs: build
272-
runs-on: ubuntu-latest
270+
runs-on: ubuntu-24.04
273271

274272
steps:
275273
- name: Checkout
@@ -278,7 +276,7 @@ jobs:
278276
- name: Use Node.js
279277
uses: actions/setup-node@v4
280278
with:
281-
node-version: 16
279+
node-version: 18
282280

283281
- name: NPM install
284282
run: npm ci --ignore-scripts
@@ -289,11 +287,8 @@ jobs:
289287
- name: Move artifacts
290288
run: ./scripts/moveArtifacts.sh
291289

292-
- name: Check artifact list
293-
run: node ./scripts/makeArtifactList.js -check
294-
295-
- name: npm pack (rescript)
296-
run: npm pack
290+
- name: npm pack (rescript) + check artifact list
291+
run: node ./scripts/npmPack.js
297292

298293
- name: Copy JS files to stdlib package
299294
run: mkdir -p packages/std/lib && cp -R lib/es6 lib/js packages/std/lib
@@ -325,8 +320,8 @@ jobs:
325320
os: [
326321
macos-13, # x64
327322
macos-14, # ARM
328-
ubuntu-latest,
329-
buildjet-2vcpu-ubuntu-2204-arm,
323+
ubuntu-24.04,
324+
ubuntu-24.04-arm,
330325
windows-latest,
331326
]
332327

@@ -339,7 +334,7 @@ jobs:
339334
- name: Use Node.js
340335
uses: actions/setup-node@v4
341336
with:
342-
node-version: 16
337+
node-version: 18
343338

344339
- name: Download artifacts
345340
uses: actions/download-artifact@v4
@@ -362,7 +357,7 @@ jobs:
362357

363358
if: startsWith(github.ref, 'refs/tags/v')
364359

365-
runs-on: ubuntu-latest
360+
runs-on: ubuntu-24.04
366361

367362
steps:
368363
- name: Checkout
@@ -371,7 +366,7 @@ jobs:
371366
- name: Use Node.js
372367
uses: actions/setup-node@v4
373368
with:
374-
node-version: 16
369+
node-version: 18
375370
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing
376371

377372
- name: Download artifacts

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
- Deprecate js_cast.res https://github.com/rescript-lang/rescript-compiler/pull/7074
1818
- Deprecate top-level `"suffix"` option in `rescript.json`. https://github.com/rescript-lang/rescript-compiler/pull/7056
1919

20+
#### :house: Internal
21+
- Playground: Bundle and upload stdlib runtime so that the playground can execute functions from Core/Belt/Js. https://github.com/rescript-lang/rescript/pull/7268
22+
2023
# 11.1.4
2124

2225
- Fix issue where long layout break added a trailing comma in partial application `...`. https://github.com/rescript-lang/rescript-compiler/pull/6949

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ lib: build node_modules/.bin/semver
5050
./scripts/prebuilt.js
5151

5252
artifacts: lib
53-
./scripts/makeArtifactList.js
53+
./scripts/npmPack.js -updateArtifactList
5454

5555
# Builds the core playground bundle (without the relevant cmijs files for the runtime)
5656
playground:

ninja/configure.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from optparse import OptionParser
2525
import os
26-
import pipes
26+
import shlex
2727
import string
2828
import subprocess
2929
import sys
@@ -257,7 +257,7 @@ def _run_command(self, cmdline):
257257
env_keys = set(['CXX', 'AR', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS'])
258258
configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys)
259259
if configure_env:
260-
config_str = ' '.join([k + '=' + pipes.quote(configure_env[k])
260+
config_str = ' '.join([k + '=' + shlex.quote(configure_env[k])
261261
for k in configure_env])
262262
n.variable('configure_env', config_str + '$ ')
263263
n.newline()

0 commit comments

Comments
 (0)