mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
Merge the macOS island fixes of ni/1-libnode-loader
The libnode-linux action becomes .github/actions/libnode, which serves the Linux x64 and macOS lanes: the libnode-packs cache for the runner's platform, else the development pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
name: libnode pack (Linux x64)
|
||||
name: libnode pack (Linux x64, macOS)
|
||||
description: >-
|
||||
Provide the linux-x64 libnode pack for the Node island tests and export
|
||||
Provide the runner's libnode pack for the Node island tests and export
|
||||
SCRIPTC_LIBNODE. Restores the libnode build that the libnode-packs
|
||||
workflow cached and assembles @scriptc/libnode-linux-x64-gnu from it (the
|
||||
workflow cached and assembles @scriptc/libnode-<platform> from it (the
|
||||
bridge compiles in seconds; Node is never built here). Until that cache
|
||||
exists for this ref, it falls back to the pinned, checksum-verified
|
||||
development pack (packages/libnode-common/dev-pack.json). Fails the job if
|
||||
@@ -10,33 +10,44 @@ description: >-
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Name the runner's pack
|
||||
id: target
|
||||
shell: bash
|
||||
run: |
|
||||
case "$RUNNER_OS-$RUNNER_ARCH" in
|
||||
Linux-X64) platform=linux-x64-gnu toolchain=manylinux_2_28-gcc-toolset-14 bridge=libscr_node_bridge.so ;;
|
||||
macOS-ARM64) platform=darwin-arm64 toolchain=macos-15-xcode-clang bridge=libscr_node_bridge.dylib ;;
|
||||
macOS-X64) platform=darwin-x64 toolchain=macos-15-xcode-clang bridge=libscr_node_bridge.dylib ;;
|
||||
*) echo "::error::no libnode pack for $RUNNER_OS $RUNNER_ARCH"; exit 1 ;;
|
||||
esac
|
||||
printf 'platform=%s\ntoolchain=%s\nbridge=%s\n' "$platform" "$toolchain" "$bridge" >> "$GITHUB_OUTPUT"
|
||||
- name: Compute the libnode cache key
|
||||
id: key
|
||||
shell: bash
|
||||
env:
|
||||
SCRIPTC_LIBNODE_TOOLCHAIN: manylinux_2_28-gcc-toolset-14
|
||||
run: node packages/libnode-common/scripts/cache-key.mjs --platform linux-x64-gnu >> "$GITHUB_OUTPUT"
|
||||
SCRIPTC_LIBNODE_TOOLCHAIN: ${{ steps.target.outputs.toolchain }}
|
||||
run: node packages/libnode-common/scripts/cache-key.mjs --platform ${{ steps.target.outputs.platform }} >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/cache/restore@v4
|
||||
id: libnode
|
||||
with:
|
||||
path: .libnode-cache/${{ steps.key.outputs.path }}
|
||||
key: ${{ steps.key.outputs.key }}
|
||||
- name: Assemble @scriptc/libnode-linux-x64-gnu
|
||||
- name: Assemble @scriptc/libnode-${{ steps.target.outputs.platform }}
|
||||
if: steps.libnode.outputs.cache-hit == 'true'
|
||||
shell: bash
|
||||
env:
|
||||
SCRIPTC_LIBNODE_TOOLCHAIN: manylinux_2_28-gcc-toolset-14
|
||||
SCRIPTC_LIBNODE_TOOLCHAIN: ${{ steps.target.outputs.toolchain }}
|
||||
SCRIPTC_LIBNODE_CACHE: ${{ github.workspace }}/.libnode-cache
|
||||
run: |
|
||||
node packages/libnode-linux-x64-gnu/scripts/build.mjs --from-cache
|
||||
node packages/libnode-common/scripts/verify.mjs packages/libnode-linux-x64-gnu
|
||||
echo "SCRIPTC_LIBNODE=$GITHUB_WORKSPACE/packages/libnode-linux-x64-gnu" >> "$GITHUB_ENV"
|
||||
node packages/libnode-${{ steps.target.outputs.platform }}/scripts/build.mjs --from-cache
|
||||
node packages/libnode-common/scripts/verify.mjs packages/libnode-${{ steps.target.outputs.platform }}
|
||||
echo "SCRIPTC_LIBNODE=$GITHUB_WORKSPACE/packages/libnode-${{ steps.target.outputs.platform }}" >> "$GITHUB_ENV"
|
||||
- uses: actions/cache@v4
|
||||
if: steps.libnode.outputs.cache-hit != 'true'
|
||||
id: devpack
|
||||
with:
|
||||
path: ${{ runner.temp }}/libnode-dev-pack
|
||||
key: libnode-dev-pack-linux-x64-${{ hashFiles('packages/libnode-common/dev-pack.json', 'packages/libnode-common/build-pack.mjs', 'packages/libnode-common/fetch-dev-pack.mjs', 'packages/libnode-common/bridge/**', 'packages/runtime/src/scr_node_bridge.h') }}
|
||||
key: libnode-dev-pack-${{ steps.target.outputs.platform }}-${{ hashFiles('packages/libnode-common/dev-pack.json', 'packages/libnode-common/build-pack.mjs', 'packages/libnode-common/fetch-dev-pack.mjs', 'packages/libnode-common/bridge/**', 'packages/runtime/src/scr_node_bridge.h') }}
|
||||
- name: Assemble the development pack
|
||||
if: steps.libnode.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
@@ -50,4 +61,4 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
test -f "$SCRIPTC_LIBNODE/manifest.json"
|
||||
test -f "$SCRIPTC_LIBNODE/libscr_node_bridge.so"
|
||||
test -f "$SCRIPTC_LIBNODE/${{ steps.target.outputs.bridge }}"
|
||||
@@ -215,7 +215,7 @@ jobs:
|
||||
# Node island tests (`// @requires-libnode` corpus programs and
|
||||
# node-island.test.ts) load Node from a libnode pack, and fail rather
|
||||
# than skip in this lane when none is configured.
|
||||
- uses: ./.github/actions/libnode-linux
|
||||
- uses: ./.github/actions/libnode
|
||||
# Ubuntu pipes core dumps to apport, and RLIMIT_CORE does not limit a
|
||||
# piped dump. The kernel then streams every page of the runtime's
|
||||
# reserved allocator address space through the pipe, so each expected
|
||||
@@ -284,6 +284,9 @@ jobs:
|
||||
path: ${{ runner.temp }}
|
||||
- run: tar -xzf "$RUNNER_TEMP/native-darwin-arm64.tar.gz"
|
||||
- run: pnpm build
|
||||
# Node island tests load Node from a libnode pack, and fail rather
|
||||
# than skip on macOS CI when none is configured.
|
||||
- uses: ./.github/actions/libnode
|
||||
- name: Tests (${{ (github.event_name != 'schedule' && inputs.macos_suite != 'full') && 'darwin suite' || 'corpus and integration suites' }})
|
||||
run: node scripts/ci-test.mjs
|
||||
|
||||
@@ -704,6 +707,12 @@ jobs:
|
||||
path: ${{ runner.temp }}
|
||||
- run: tar -xzf "$RUNNER_TEMP/native-darwin-arm64.tar.gz"
|
||||
- run: pnpm build
|
||||
# Node island tests load Node from a libnode pack, and fail rather
|
||||
# than skip on macOS CI when none is configured.
|
||||
- uses: ./.github/actions/libnode
|
||||
- name: Node island harness
|
||||
if: matrix.shard == 1
|
||||
run: pnpm test tests/harness/node-island packages/libnode-common
|
||||
- name: No-clang assembly/object contract
|
||||
if: matrix.shard == 1
|
||||
run: pnpm test packages/cli/test/native-output.test.ts
|
||||
@@ -761,7 +770,8 @@ jobs:
|
||||
if: ${{ needs.validation_scope.outputs.full == 'true' && needs.lanes.outputs.macos == 'true' }}
|
||||
name: test (macOS x64 LLVM artifacts, no clang)
|
||||
runs-on: macos-15-intel
|
||||
timeout-minutes: 20
|
||||
# The Node island tests take most of it.
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
@@ -776,6 +786,15 @@ jobs:
|
||||
with:
|
||||
target: darwin-x64
|
||||
- run: pnpm build
|
||||
# Node island tests load Node from a libnode pack, and fail rather
|
||||
# than skip on macOS CI when none is configured.
|
||||
- uses: ./.github/actions/libnode
|
||||
- name: Node islands (Intel)
|
||||
run: >-
|
||||
pnpm test tests/harness/node-island packages/libnode-common
|
||||
&& pnpm test tests/harness/differential.test.ts -t ' (68[0-9][0-9]|7661|7662)-'
|
||||
env:
|
||||
SCRIPTC_TEST_WORKERS: "3"
|
||||
- name: Intel Mach-O no-clang object contract
|
||||
run: |
|
||||
mkdir -p "$RUNNER_TEMP/traps"
|
||||
|
||||
Reference in New Issue
Block a user