Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport to v11 bundle and upload stdlib js runtime (#7255) #7268

Merged
merged 11 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 21 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, buildjet-2vcpu-ubuntu-2204-arm]
os: [ubuntu-24.04, ubuntu-24.04-arm]

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

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
needs:
- static-binaries-linux

runs-on: buildjet-2vcpu-ubuntu-2204-arm
runs-on: ubuntu-24.04-arm

steps:
- name: Checkout
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Copy exes to platform bin dirs
run: node ./scripts/copyExes.js
Expand All @@ -105,7 +105,7 @@ jobs:
os: [
macos-13, # x64
macos-14, # ARM
ubuntu-latest,
ubuntu-24.04,
windows-latest,
]
ocaml_compiler: [4.14.1]
Expand Down Expand Up @@ -140,20 +140,18 @@ jobs:
chmod +x _build/install/default/bin/*

- name: Use OCaml ${{matrix.ocaml_compiler}}
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3.2.5
if: matrix.os != 'windows-latest'
with:
ocaml-compiler: ${{matrix.ocaml_compiler}}
opam-pin: false
opam-depext: false

- name: Use OCaml ${{matrix.ocaml_compiler}} (Win)
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3.2.5
if: matrix.os == 'windows-latest'
with:
ocaml-compiler: ${{matrix.ocaml_compiler}}
opam-pin: false
opam-depext: false
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
Expand All @@ -168,7 +166,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Install npm packages
run: npm ci --ignore-scripts
Expand Down Expand Up @@ -228,24 +226,24 @@ jobs:
if: runner.os == 'Windows'
run: node scripts/ciTest.js -mocha -theme -format

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

- name: Build playground compiler
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-24.04'
run: |
opam exec -- node packages/playground-bundling/scripts/generate_cmijs.js
opam exec -- dune build --profile browser
cp ./_build/default/jscomp/jsoo/jsoo_playground_main.bc.js playground/compiler.js

- name: Test playground compiler
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-24.04'
run: node playground/playground_test.js

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

package:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand All @@ -278,7 +276,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: NPM install
run: npm ci --ignore-scripts
Expand All @@ -289,11 +287,8 @@ jobs:
- name: Move artifacts
run: ./scripts/moveArtifacts.sh

- name: Check artifact list
run: node ./scripts/makeArtifactList.js -check

- name: npm pack (rescript)
run: npm pack
- name: npm pack (rescript) + check artifact list
run: node ./scripts/npmPack.js

- name: Copy JS files to stdlib package
run: mkdir -p packages/std/lib && cp -R lib/es6 lib/js packages/std/lib
Expand Down Expand Up @@ -325,8 +320,8 @@ jobs:
os: [
macos-13, # x64
macos-14, # ARM
ubuntu-latest,
buildjet-2vcpu-ubuntu-2204-arm,
ubuntu-24.04,
ubuntu-24.04-arm,
windows-latest,
]

Expand All @@ -339,7 +334,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18

- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -362,7 +357,7 @@ jobs:

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

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand All @@ -371,7 +366,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org # Needed to make auth work for publishing

- name: Download artifacts
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
- Deprecate js_cast.res https://github.com/rescript-lang/rescript-compiler/pull/7074
- Deprecate top-level `"suffix"` option in `rescript.json`. https://github.com/rescript-lang/rescript-compiler/pull/7056

#### :house: Internal
- 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

# 11.1.4

- Fix issue where long layout break added a trailing comma in partial application `...`. https://github.com/rescript-lang/rescript-compiler/pull/6949
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ lib: build node_modules/.bin/semver
./scripts/prebuilt.js

artifacts: lib
./scripts/makeArtifactList.js
./scripts/npmPack.js -updateArtifactList

# Builds the core playground bundle (without the relevant cmijs files for the runtime)
playground:
Expand Down
4 changes: 2 additions & 2 deletions ninja/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from optparse import OptionParser
import os
import pipes
import shlex
import string
import subprocess
import sys
Expand Down Expand Up @@ -257,7 +257,7 @@ def _run_command(self, cmdline):
env_keys = set(['CXX', 'AR', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS'])
configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys)
if configure_env:
config_str = ' '.join([k + '=' + pipes.quote(configure_env[k])
config_str = ' '.join([k + '=' + shlex.quote(configure_env[k])
for k in configure_env])
n.variable('configure_env', config_str + '$ ')
n.newline()
Expand Down
Loading