Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f2888ae
ci: add Cargo license policy
PHPCraftdream Oct 28, 2026
0ff3b5e
ci: inspect npm and platform package licenses
PHPCraftdream Oct 28, 2026
ee244bc
test: cover npm license and platform policy
PHPCraftdream Oct 28, 2026
d8451f0
ci: check Cargo and npm licenses
PHPCraftdream Oct 28, 2026
27bf598
ci: check committed and resolved npm graphs
PHPCraftdream Oct 28, 2026
a635b42
ci: audit Vite example dependencies
PHPCraftdream Oct 28, 2026
e2a3633
fix: build genuine musl Node addons
PHPCraftdream Oct 29, 2026
d53d7fa
test: require dynamic musl libc in addons
PHPCraftdream Oct 29, 2026
318e3b2
docs: clarify musl build comment
PHPCraftdream Oct 29, 2026
f3e2c16
ci: audit WASM notices in actual npm packages
PHPCraftdream Oct 30, 2026
58ae382
ci: retain exact NAPI upstream license notices
PHPCraftdream Oct 30, 2026
701369b
ci: preserve original npm release resolution evidence
PHPCraftdream Oct 30, 2026
beabea1
ci: preserve WASM build script hashbang in overlay
PHPCraftdream Oct 30, 2026
334c354
ci: capture exact GNU NAPI runtime link inputs
PHPCraftdream Oct 30, 2026
eef16fe
ci: snapshot original NAPI linker arguments
PHPCraftdream Oct 30, 2026
550b491
ci: preserve exact non-UTF8 SDK notice bytes
PHPCraftdream Oct 30, 2026
188d7b4
ci: bind GNU NAPI inputs to pinned SDK bytes
PHPCraftdream Oct 30, 2026
3274d0b
fix: retain the reviewed JS Cargo build graph
PHPCraftdream Oct 30, 2026
8e6f5ce
fix: retain numbered GNU copying documents
PHPCraftdream Oct 31, 2026
fd325b2
ci: bind GNU NAPI notices to reviewed inputs
PHPCraftdream Oct 31, 2026
71a0fe2
feat: retain complete GNU notices in NAPI addons
PHPCraftdream Oct 31, 2026
f6b74d4
fix: apply notice retention to the selected NAPI source
PHPCraftdream Oct 31, 2026
de71212
ci: inspect actual macOS NAPI and C ABI inputs
PHPCraftdream Oct 31, 2026
51ec15d
fix: drop unused libiconv from macOS NAPI addons
PHPCraftdream Oct 31, 2026
4d4861c
ci: probe Windows GNU LLVM C ABI compatibility
PHPCraftdream Oct 31, 2026
6f5db3d
fix: recognize the Windows ProcessPrng system module
PHPCraftdream Oct 31, 2026
99d6edd
ci: capture actual MSVC NAPI runtime inputs
PHPCraftdream Oct 31, 2026
4c3992d
ci: identify oversized MSVC legal originals before copying
PHPCraftdream Oct 31, 2026
77269a4
fix(ci): collect the complete observed MSVC notice
PHPCraftdream Oct 31, 2026
d782af2
fix(ci): check out pinned corpus for MSVC consumer
PHPCraftdream Oct 31, 2026
7d8148a
fix: retain Cargo and std notices in JS C ABI libraries
PHPCraftdream Oct 31, 2026
98abb68
fix: bind Windows C ABI notices to actual DLL runtime inputs
PHPCraftdream Oct 31, 2026
3f9569c
fix(ci): bind oversized SDK legal reads to document bytes
PHPCraftdream Oct 31, 2026
bb3a732
ci: gate GNU C ABI resources on exact Zig runtime inputs
PHPCraftdream Oct 31, 2026
873997c
fix(ci): query cargo-zigbuild version at CLI root
PHPCraftdream Oct 31, 2026
659b3c8
ci: capture original musl native resources and actual inputs
PHPCraftdream Nov 1, 2026
ad1dfaf
fix: gate musl resources on exact retained source grants
PHPCraftdream Nov 1, 2026
eea7945
fix(ci): run browser checks on supported Ubuntu 24.04
PHPCraftdream Nov 1, 2026
9152133
fix(licenses): retain GNU NAPI libm notices
PHPCraftdream Nov 1, 2026
0eb4370
ci(licenses): probe GNU NAPI source variant
PHPCraftdream Nov 1, 2026
4d9615c
ci(licenses): bind GNU NAPI grants to native inputs
PHPCraftdream Nov 1, 2026
27a33ed
fix(licenses): bind the explicit patched NAPI grant
PHPCraftdream Nov 1, 2026
201f2d1
fix(licenses): preserve exact original grant text bytes
PHPCraftdream Nov 1, 2026
6607949
fix(licenses): bind the GNU NAPI loader linker input
PHPCraftdream Nov 1, 2026
56bf7a3
ci(licenses): preserve complete native npm role payloads
PHPCraftdream Nov 1, 2026
7a3407a
ci(licenses): share the verified native npm release path
PHPCraftdream Nov 1, 2026
1486be4
fix(licenses): canonicalize native payload inventory order
PHPCraftdream Nov 1, 2026
b1ecc29
test(licenses): exercise installed native npm tarballs
PHPCraftdream Nov 1, 2026
b31fdad
fix(ffi): decode installed library URLs as filesystem paths
PHPCraftdream Nov 1, 2026
5b1b43b
fix(ci): run original Deno corpus outside node_modules
PHPCraftdream Nov 1, 2026
5e93ff1
ci(licenses): bind common JS compiler grants to exact source
PHPCraftdream Nov 1, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-24.04, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
with:
Expand Down
218 changes: 218 additions & 0 deletions .github/workflows/gnu-cabi-notice-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
name: Linux GNU C ABI notice evidence

on:
workflow_call:

permissions:
contents: read

env:
SOURCE_REF: 562deb3fde092d63a78f359be095e5079929d0d1
LC_ALL: C

jobs:
gnu-cabi:
name: GNU C ABI notices / ${{ matrix.target }}
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
env:
CABI_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- name: Preserve reviewed source overlay and notice tools
shell: python
run: |
import os
import shutil
from pathlib import Path
stage = Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-tools'
stage.mkdir()
names = ['scripts/rust_compiler_notices.py', 'ci/rust-compiler-notices.json', 'ci/test_js_compiler_materials.py', 'ci/licenses/rust-compiler-originals/compiler-builtins-LICENSE.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-Cargo.toml.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-build.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-aarch64.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-aarch64-outline-atomics.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-aarch64-lse.S.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-aarch64-cpu-model.c.txt', 'ci/licenses/rust-compiler-originals/compiler-rt-LICENSE.TXT', 'ci/licenses/rust-compiler-originals/compiler-rt-CREDITS.TXT', 'ci/licenses/rust-compiler-originals/compiler-builtins-math-mod.rs.txt', 'ci/licenses/rust-compiler-originals/libm-trunc.rs.txt', 'ci/licenses/rust-compiler-originals/libm-LICENSE.txt', 'ci/licenses/rust-compiler-originals/libm-generic-trunc.rs.txt', 'ci/licenses/rust-compiler-originals/compiler-builtins-float-conv.rs.txt', 'scripts/native_npm_payload.py', 'scripts/windows_gnu_napi_variant.py', 'Cargo.lock', 'ci/js-build-lock.json', 'crates/cabi/build.rs', 'scripts/patch_cabi_notice_source.py', 'ci/test_cabi_notice_overlay.py', 'scripts/prepare_js_notices.py', 'scripts/cargo_notice_bundle.py', 'scripts/collect_cargo_notices.py', 'scripts/source_license_supplements.py', 'scripts/check_embedded_notices.py', 'scripts/check-npm-licenses.mjs', 'ci/about.toml', 'ci/licenses/js-source-supplements.json', 'scripts/zig_runtime_notices.py', 'scripts/capture-zig-link.sh', 'scripts/check_gnu_cabi_evidence.py', 'ci/zig-runtime-catalog.json', 'ci/test_gnu_cabi_notices.py']
for name in names:
path = stage / name
path.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(name, path)
- uses: actions/checkout@v4
with:
ref: ${{ env.SOURCE_REF }}
submodules: recursive
persist-credentials: false
- name: Restore only the original C ABI notice hook and include
shell: python
run: |
import hashlib
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
if subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() != os.environ['SOURCE_REF']:
raise SystemExit('unexpected GNU C ABI source')
overlay = ['crates/cabi/build.rs', 'crates/cabi/src/lib.rs']
baseline = {name: hashlib.sha256(Path(name).read_bytes()).hexdigest() if Path(name).is_file() else None for name in overlay}
stage = Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-tools'
for path in stage.rglob('*'):
if path.is_file():
destination = Path(path.relative_to(stage))
destination.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(path, destination)
subprocess.run([sys.executable, '-I', 'scripts/patch_cabi_notice_source.py', 'crates/cabi/src/lib.rs'], check=True)
protected = ['Cargo.toml', 'crates', 'tests', 'root-docs', 'package.json', 'package-lock.json']
changed = set(subprocess.check_output(['git', 'diff', '--name-only', '--', *protected], text=True).splitlines())
changed.update(subprocess.check_output(['git', 'ls-files', '--others', '--exclude-standard', '--', *protected], text=True).splitlines())
if changed != set(overlay):
raise SystemExit('GNU source changed beyond its notice hook/include')
record = {'source_ref': os.environ['SOURCE_REF'], 'tooling_ref': os.environ['GITHUB_SHA'], 'target': os.environ['CABI_TARGET'], 'notice_overlay': {name: {'baseline_sha256': baseline[name], 'compiled_sha256': hashlib.sha256(Path(name).read_bytes()).hexdigest()} for name in overlay}, 'scope': 'Original 0.8.1 parser APIs and reviewed dependency graph with C ABI notice metadata only; not historical published dependency evidence.'}
(Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-source.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8')
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@1.99.1
with:
targets: ${{ matrix.target }}
components: rust-docs
- uses: mlugg/setup-zig@v2
with:
version: 0.14.0
- uses: taiki-e/install-action@v2
with:
tool: cargo-zigbuild@0.24.0
- uses: taiki-e/install-action@v2
with:
tool: cargo-about@0.9.3
- name: Verify source, archive, notice and ELF regression guards
shell: bash
run: |
set -euo pipefail
python3 -I -m unittest discover -s ci -p test_cabi_notice_overlay.py -v
python3 -I -m unittest discover -s ci -p test_gnu_cabi_notices.py -v
- name: Prepare full reviewed Cargo/std and Zig runtime notices
shell: python
run: |
import os
import shutil
import subprocess
import sys
from pathlib import Path
evidence = Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-evidence'
subprocess.run([sys.executable, 'scripts/prepare_js_notices.py', str(evidence)], check=True)
subprocess.run([sys.executable, '-I', 'scripts/zig_runtime_notices.py', 'prepare', str(evidence)], check=True)
shutil.copyfile(Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-source.json', evidence / 'source-provenance.json')
for name in ['LICENSE-MIT', 'LICENSE-APACHE']:
shutil.copyfile(name, evidence / name)
- name: Build original C ABI with exact Zig map and command capture
shell: bash
run: |
set -euo pipefail
if [[ -n "${RUSTFLAGS:-}" || -n "${CARGO_ENCODED_RUSTFLAGS:-}" ]]; then
printf '%s\n' 'Preexisting GNU linker flags require review' >&2
exit 1
fi
evidence="$RUNNER_TEMP/gnu-cabi-evidence"
zig version > "$evidence/zig-version.txt"
zig env > "$evidence/zig-env.json"
cargo-zigbuild --version > "$evidence/cargo-zigbuild-version.txt"
sha256sum "$(command -v cargo-zigbuild)" > "$evidence/cargo-zigbuild.sha256"
sha256sum "$(command -v zig)" > "$evidence/zig.sha256"
export ZIG_GLOBAL_CACHE_DIR="$RUNNER_TEMP/gnu-cabi-zig-cache"
mkdir "$ZIG_GLOBAL_CACHE_DIR"
export KTAV_REAL_ZIG="$(command -v zig)"
export KTAV_LINK_MAP="$evidence/native-link.map"
export KTAV_LINK_COMMAND="$evidence/native-link-command.json"
export CARGO_ZIGBUILD_ZIG_COMMAND="$PWD/scripts/capture-zig-link.sh"
unset CARGO_ZIGBUILD_ZIG_COMMAND_ARGS
chmod +x "$CARGO_ZIGBUILD_ZIG_COMMAND"
export KTAV_CABI_NOTICES_GZIP="$evidence/NOTICE.json.gz"
RUSTFLAGS='-C link-arg=-Wl,--print-map' cargo zigbuild --locked --release -p ktav-cabi --target "$CABI_TARGET.2.17"
python3 -I scripts/zig_runtime_notices.py verify "$evidence"
cp "target/$CABI_TARGET/release/libktav_cabi.so" "$evidence/libktav_cabi.so"
python3 -I scripts/check_gnu_cabi_evidence.py "$evidence/libktav_cabi.so" "$evidence" "$CABI_TARGET"
python3 -I scripts/check_embedded_notices.py "$evidence/libktav_cabi.so" "$evidence/NOTICE.json" > "$evidence/embedded-verification.json"
cmp Cargo.lock "$evidence/Cargo.lock"
- uses: actions/setup-node@v4
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
node-version: '24'
- uses: oven-sh/setup-bun@v2
if: matrix.target == 'x86_64-unknown-linux-gnu'
- uses: denoland/setup-deno@v2
if: matrix.target == 'x86_64-unknown-linux-gnu'
with:
deno-version: v2.x
- name: Run actual x64 Bun and Deno FFI corpus consumers
if: matrix.target == 'x86_64-unknown-linux-gnu'
shell: python
run: |
import hashlib
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
evidence = Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-evidence'
sdk = Path(json.loads((evidence / 'zig-env.json').read_bytes())['lib_dir']).resolve().parent
consumer = Path(os.environ['RUNNER_TEMP']) / 'gnu-cabi-consumer'
(consumer / 'release').mkdir(parents=True)
binary = consumer / 'release/libktav_cabi.so'
shutil.copyfile(evidence / binary.name, binary)
environment = {**os.environ, 'CARGO_TARGET_DIR': str(consumer), 'EXPECTED_CABI': str(binary)}
for key in ['PATH', 'LD_LIBRARY_PATH']:
environment[key] = os.pathsep.join(part for part in environment.get(key, '').split(os.pathsep) if part and not Path(part).resolve().is_relative_to(sdk))
shutil.copyfile('package-lock.json', evidence / 'consumer-npm-lock-source.json')
subprocess.run(['npm', 'install', '--ignore-scripts', '--no-audit', '--no-fund'], env=environment, check=True)
subprocess.run(['git', 'diff', '--exit-code', '--', 'package.json'], check=True)
shutil.copyfile('package-lock.json', evidence / 'consumer-npm-lock-resolved.json')
subprocess.run(['node', 'scripts/check-npm-licenses.mjs'], env=environment, check=True)
subprocess.run(['npm', 'run', 'build:ts'], env=environment, check=True)
preflight = 'import assert from "node:assert/strict";import {realpathSync} from "node:fs";import * as paths from "./tests/shared/test-paths.mjs";assert.ok(paths.cabiBuilt());assert.equal(realpathSync(paths.cabi),realpathSync(process.env.EXPECTED_CABI));'
subprocess.run(['node', '--input-type=module', '-e', preflight], env=environment, check=True)
for role, command in [('bun', ['bun', 'run', 'tests/bun/run-bun-ffi.mjs']), ('deno', ['deno', 'run', '--allow-ffi', '--allow-env', '--allow-read', 'tests/deno/run-deno-ffi.ts'])]:
result = subprocess.run(command, env=environment, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(evidence / (role + '-consumer-stdout.txt')).write_bytes(result.stdout)
(evidence / (role + '-consumer-stderr.txt')).write_bytes(result.stderr)
sys.stdout.buffer.write(result.stdout)
sys.stderr.buffer.write(result.stderr)
if result.returncode or b'passed' not in result.stdout or b'skipping' in result.stdout.lower():
raise SystemExit(role + ' actual GNU C ABI corpus failed or skipped')
if binary.read_bytes() != (evidence / 'libktav_cabi.so').read_bytes():
raise SystemExit('actual consumer library bytes changed')
record = {'binary_sha256': hashlib.sha256(binary.read_bytes()).hexdigest(), 'target': os.environ['CABI_TARGET'], 'actual_bun_corpus': True, 'actual_deno_corpus': True, 'sdk_paths_removed': True, 'scope': 'Matching-x64 C ABI corpus only; ARM cross binary inspected, not executed.'}
(evidence / 'consumer-verification.json').write_text(json.dumps(record, sort_keys=True, indent=2) + '\n', encoding='utf-8')
- name: Stage complete source-bound native npm roles
env:
NPM_TARGET: ${{ matrix.target }}
shell: python
run: |
import os
from pathlib import Path
import subprocess
import sys
sys.path.insert(0, str(Path('scripts').resolve()))
from native_npm_payload import TARGETS
target = os.environ['NPM_TARGET']
rid = next(name for name, value in TARGETS.items() if value == target)
root = Path(os.environ['RUNNER_TEMP'])
evidence = root / 'gnu-cabi-evidence'
for role in ['cabi']:
output = root / ('native-npm-' + rid + '-' + role)
subprocess.run([sys.executable, '-I', 'scripts/native_npm_payload.py', str(evidence), str(output), rid, role], check=True)
with Path(os.environ['GITHUB_ENV']).open('a', encoding='utf-8') as destination:
destination.write('NPM_RID=' + rid + '\n')
- uses: actions/upload-artifact@v4
with:
name: ${{ env.NPM_RID }}-cabi
path: ${{ runner.temp }}/native-npm-${{ env.NPM_RID }}-cabi/
include-hidden-files: true
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: always()
with:
name: gnu-cabi-evidence-${{ matrix.target }}
path: ${{ runner.temp }}/gnu-cabi-evidence/
if-no-files-found: warn
39 changes: 39 additions & 0 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: License checks

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
cargo-licenses:
name: Cargo dependency licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@b66acf5e9fe20f8aba065be86778a8a4c846f902
with:
command: check licenses

npm-licenses:
name: npm dependency licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
- run: node --test tests/npm-license-policy.test.mjs
- name: Check committed npm lockfile
run: node scripts/check-npm-licenses.mjs
- name: Resolve npm graph without lifecycle scripts
run: npm install --ignore-scripts
- name: Check resolved npm graph
run: node scripts/check-npm-licenses.mjs
- name: Resolve Vite example dependencies without lifecycle scripts
run: npm --prefix examples/bundler-vite install --package-lock-only --ignore-scripts --no-audit --no-fund
- name: Check Vite example licenses
run: node scripts/check-npm-licenses.mjs examples/bundler-vite
Loading
Loading