Make native installs portable and smaller (#599)

* Make native installs portable and smaller

- Support glibc 2.34 with portable compiler binaries and static LLVM helpers.
- Bundle the host runtime and discover optional cross-target packs from project dependencies.
- Add application build benchmarks covering latency, executable size, and memory.

* Keep bootstrap tools available in Sandbox validation

- Isolate Zig for native compiler bootstrap and glibc entropy contracts.
- Preserve the existing toolchain scope for cache and corpus tests.

* Fix portable compiler bootstrap linking

- Keep native support objects compatible with the destination host linker.
- Resolve installed targets using the host declared by the toolchain manifest.
This commit is contained in:
Chris Tate
2026-10-01 10:46:16 -05:00
committed by GitHub
parent 2069684b40
commit 0845c7ff56
53 changed files with 682 additions and 147 deletions
+21
View File
@@ -201,6 +201,27 @@ jobs:
helper: "false"
- run: pnpm build
- run: pnpm test tests/harness/self-hosting-native-driver.test.ts
env:
SCRIPTC_BOOTSTRAP_PACKAGE_DIR: ${{ runner.temp }}/native-cli-package
- name: Verify packed compiler and Linux ABI
if: matrix.flavor == 'plain'
run: |
pnpm test packages/runtime/test/glibc-random.test.ts
node scripts/verify-native-cli.mjs "$RUNNER_TEMP/native-cli-package" --run
node scripts/smoke-native-install.mjs "$RUNNER_TEMP/native-cli-package"
- name: Install and compile on Amazon Linux 2023 (glibc 2.34)
if: matrix.flavor == 'plain'
run: |
NODE_ROOT=$(dirname "$(dirname "$(command -v node)")")
docker run --rm --volume "$GITHUB_WORKSPACE:/work:ro" \
--volume "$RUNNER_TEMP/native-cli-package:/native:ro" --volume "$NODE_ROOT:/node:ro" \
--env PATH=/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin \
--workdir /work amazonlinux:2023 sh -c '
set -eu
dnf install --assumeyes clang tar gzip
test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.34"
node scripts/smoke-native-install.mjs /native
'
# A real host-clang/glibc build, not the zig cross-target lane: catches
# Linux feature-test macro omissions at compile time and separate-libm
+12
View File
@@ -244,6 +244,18 @@ jobs:
pnpm --filter @scriptc/compiler --filter scriptc build
pnpm --filter @scriptc/${{ matrix.cli }} build:native
node scripts/verify-native-cli.mjs packages/${{ matrix.cli }} --run
- name: Verify GNU npm distribution on glibc 2.34
if: matrix.platform == 'linux-x64' || matrix.platform == 'linux-arm64'
run: |
NODE_ROOT=$(dirname "$(dirname "$(command -v node)")")
docker run --rm --volume "$GITHUB_WORKSPACE:/work:ro" --volume "$NODE_ROOT:/node:ro" \
--env PATH=/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin \
--workdir /work amazonlinux:2023 sh -c '
set -eu
dnf install --assumeyes clang tar gzip
test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.34"
node scripts/smoke-native-install.mjs packages/${{ matrix.cli }}
'
- name: Verify packed Darwin helper on its build host
if: matrix.platform == 'darwin-arm64'
run: |