From d63bab2c59b2ea72a805b2029e348e451ca0d3c4 Mon Sep 17 00:00:00 2001 From: Julian Goldstein Date: Mon, 22 Jun 2026 21:57:40 -0500 Subject: [PATCH 1/2] template: drop the npm requirement from the build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The starter imports only `yeet:*` builtins and local `@/` modules, and esbuild is vendored by the toolchain (build/toolchain.lock) — so the `npm install` the Makefile ran only installed a second, unused copy of esbuild into node_modules. Remove npm from the required build path: - Makefile: drop the node_modules target, the NPM var, and bundle's dependency on node_modules; bundle now runs the vendored esbuild directly. - package.json: drop the esbuild devDep and the build script (it shelled out to a bare `esbuild`); slim to a manifest with empty dependencies. - package-lock.json: delete (dead npm artifact); scripts/new no longer substitutes __NAME__ into it. - README: npm/node removed from prerequisites; the build and npm/jsr sections now explain deps are optional and resolved from node_modules with any package manager. - toolchain.lock: ESBUILD_VERSION is now the sole esbuild pin. The deps door stays open — esbuild inlines whatever is in node_modules — but npm is no longer required to build the starter. Co-Authored-By: Claude Opus 4.8 --- scripts/new | 2 +- template/Makefile | 30 +- template/README.md | 25 +- template/build/toolchain.lock | 3 +- template/package-lock.json | 499 ---------------------------------- template/package.json | 7 +- 6 files changed, 34 insertions(+), 532 deletions(-) delete mode 100644 template/package-lock.json diff --git a/scripts/new b/scripts/new index 8888116..f4ebb99 100755 --- a/scripts/new +++ b/scripts/new @@ -48,7 +48,7 @@ cp -R "$SRC/." "$DEST/" # Substitute __NAME__ in the files that carry it. Portable in-place edit # (BSD and GNU sed disagree on -i), so go through a temp file. -for f in package.json package-lock.json README.md; do +for f in package.json README.md; do [ -f "$DEST/$f" ] || continue tmp="$DEST/$f.tmp.$$" sed "s/__NAME__/$NAME/g" "$DEST/$f" >"$tmp" diff --git a/template/Makefile b/template/Makefile index c6c94dd..59f0eac 100644 --- a/template/Makefile +++ b/template/Makefile @@ -3,7 +3,7 @@ # make — build everything (BPF objects + JS bundle) # make bpf — compile bpf/*.bpf.c into bin/* only # make veristat — load the built object with veristat (verifier check on this kernel) -# make bundle — resolve npm/jsr deps and bundle the JS entry +# make bundle — bundle the JS entry with esbuild # make postgen — finalize a freshly generated project (git init) # make clangd — write a local .clangd pointing at the resolved toolchain # make clean — remove build artifacts @@ -24,31 +24,27 @@ include build/toolchain.mk include build/bpf.mk -NPM ?= npm - all: bpf bundle -# Bundle the entry with the vendored esbuild. esbuild inlines node_modules -# and honors tsconfig `paths` (so `@/` resolves at bundle time), while -# `yeet:*` builtins and `*.bpf.o` objects stay external. The bundle is -# written to src/index.jsx, which the entry ladder prefers over src/main.jsx -# — so once built, that is what runs. The .jsx extension keeps the bundle -# eligible for component auto-mount. Compiled BPF objects in bin/ are loaded -# by path at runtime, never imported, so they are not bundled. +# Bundle the entry with the vendored esbuild. esbuild honors tsconfig `paths` +# (so `@/` resolves at bundle time), while `yeet:*` builtins and `*.bpf.o` +# objects stay external. The bundle is written to src/index.jsx, which the +# entry ladder prefers over src/main.jsx — so once built, that is what runs. +# The .jsx extension keeps the bundle eligible for component auto-mount. +# Compiled BPF objects in bin/ are loaded by path at runtime, never imported, +# so they are not bundled. # -# `npm install` still runs first: esbuild resolves the project's own -# dependencies out of node_modules when inlining them. +# The build needs no npm/node: the starter imports only `yeet:*` builtins and +# local `@/` modules, which esbuild resolves on its own. If you add third-party +# packages to package.json, install them into node_modules with the package +# manager of your choice — esbuild inlines whatever it finds there. ESBUILD_FLAGS := --bundle --format=esm --platform=neutral \ --main-fields=module,main --conditions=import,module \ --outfile=src/index.jsx --jsx=automatic --jsx-import-source=yeet:tui -bundle: node_modules | toolchain +bundle: | toolchain $(ESBUILD) src/main.jsx $(ESBUILD_FLAGS) '--external:yeet:*' '--external:*.bpf.o' -node_modules: package.json - $(NPM) install - @touch node_modules - # Post-generation finalize: initialize a git repository with the vendored git # (fetched via `vendored-git`). Idempotent — skipped if this is already a repo. # The scaffolders (`yeet new`, `scripts/new`) run `make postgen` after creating diff --git a/template/README.md b/template/README.md index b88e5b7..ddc8b2c 100644 --- a/template/README.md +++ b/template/README.md @@ -39,7 +39,7 @@ shares its `control`; each probe module attaches its own maps. Makefile build frontend — orchestrates the two compilers build/bpf.mk clang + bpftool rules: src/bpf/*.bpf.c -> bin/probe.bpf.o build/gen-vmlinux.sh generates src/bpf/include/vmlinux.h from kernel BTF -package.json esbuild bundle script + npm deps +package.json project manifest + optional npm/jsr deps tsconfig.json `#/` -> project root, `@/` -> ./src path aliases src/main.jsx entry — composition root: input + mount src/probes/probe.js loads the shared BPF object (binds maps, start()) @@ -68,8 +68,10 @@ yeet run . # runs the bundled src/index.jsx (needs root for BPF) `make` runs two independent compilers: **clang + bpftool** compile `src/bpf/*.bpf.c` and link them into one loadable object `bin/probe.bpf.o`; -**esbuild** bundles `src/main.jsx` into `src/index.jsx`, inlining npm deps and -the `@/` alias and leaving `yeet:*` builtins external. +**esbuild** bundles `src/main.jsx` into `src/index.jsx`, resolving the `@/` +alias (and inlining any npm/jsr deps you add) and leaving `yeet:*` builtins +external. esbuild is vendored by the toolchain, so the build needs no +node/npm. The data layer loads the object at runtime: @@ -122,9 +124,14 @@ which is why the BPF object is located with `import.meta.dirname`. ## npm / jsr packages -Add dependencies to `package.json` and import them normally; esbuild inlines -them at bundle time. Only packages that run in bare V8 work — no Node builtins -(`fs`, `net`, …), and no `Intl` / `TextEncoder` / `TextDecoder`. +The starter needs no third-party packages — it imports only `yeet:*` builtins +and local `@/` modules, so `make` builds with no npm/node and no `node_modules`. + +To pull in a dependency, add it to `package.json` and install it into +`node_modules` with whatever package manager you like (`npm`, `pnpm`, `bun`, …) +— esbuild inlines whatever it finds there at bundle time. Only packages that +run in bare V8 work: no Node builtins (`fs`, `net`, …), and no `Intl` / +`TextEncoder` / `TextDecoder`. ## Pure-JS scripts @@ -135,5 +142,7 @@ feed the components from any source that exposes the same signals. - `clang` and `bpftool` (for the BPF leg; `bpftool` generates `src/bpf/include/vmlinux.h` from the host kernel, which needs `CONFIG_DEBUG_INFO_BTF`) -- `node` + `npm` at build time for esbuild (authoring only — not needed on - hosts that merely *run* the built project) + +No node/npm is required: esbuild is vendored by the toolchain, and the starter +has no third-party deps. (You only need a package manager if you add npm/jsr +dependencies of your own — see *npm / jsr packages* above.) diff --git a/template/build/toolchain.lock b/template/build/toolchain.lock index ac204f1..8b6d4b9 100644 --- a/template/build/toolchain.lock +++ b/template/build/toolchain.lock @@ -56,7 +56,8 @@ GIT_SHA256_aarch64=19c6dda22c811324649e6e4aa8c369a8d822463d61d794d0e23e72fb77b53 # esbuild — official static (Go) binary from the @esbuild/ npm # package, re-hosted on our "toolchain" release. CI records the binary -# checksum. Keep ESBUILD_VERSION in sync with template/package.json. +# checksum. This pin is the project's only esbuild version (the build vendors +# it; there is no npm install), so bump it here to upgrade. ESBUILD_VERSION=0.28.1 ESBUILD_SHA256_x86_64=0c6588b092a2c291a72bab90659f3c9e0e25e0fe59c9ac12b4dae4d945e5548c ESBUILD_SHA256_aarch64=51e829ba36f36be6d9aea6e329ddc4f9350302339b16aaca96a3cb97f64a8ebb diff --git a/template/package-lock.json b/template/package-lock.json deleted file mode 100644 index c29732a..0000000 --- a/template/package-lock.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "name": "__NAME__", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "__NAME__", - "version": "0.1.0", - "devDependencies": { - "esbuild": "^0.28.1" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" - } - } - } -} diff --git a/template/package.json b/template/package.json index 9ba9ad6..d53d19c 100644 --- a/template/package.json +++ b/template/package.json @@ -4,10 +4,5 @@ "private": true, "type": "module", "description": "__NAME__ — a yeet script.", - "scripts": { - "build": "esbuild src/main.jsx --bundle --format=esm --platform=neutral --main-fields=module,main --conditions=import,module --outfile=src/index.jsx --jsx=automatic --jsx-import-source=yeet:tui '--external:yeet:*' '--external:*.bpf.o'" - }, - "devDependencies": { - "esbuild": "^0.28.1" - } + "dependencies": {} } From c52e8ddd894d118a3a68d941e945b97b1a1cabf1 Mon Sep 17 00:00:00 2001 From: Julian Goldstein Date: Mon, 22 Jun 2026 22:01:37 -0500 Subject: [PATCH 2/2] ci: resolve newest lvh image per kernel line in kernel-matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from #24. The floating `-main` tags can't be consumed by little-vm-helper@v0.0.30: it derives the VM qcow2 filename by stripping a trailing numeric build stamp, so a `-main` tag yields a name that doesn't match the file lvh unpacks and the run fails with "invalid reference format". Keep the readable list of kernel lines in the matrix and have each job look up that line's newest date-stamped tag (`-YYYYMMDD.HHMMSS`, which the action handles) from the quay registry at run time — tracking the latest build with no tag to bump, immune to quay pruning old stamps. Co-Authored-By: Claude Opus 4.8 --- template/.github/workflows/kernel-matrix.yml | 51 ++++++++++++++------ 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/template/.github/workflows/kernel-matrix.yml b/template/.github/workflows/kernel-matrix.yml index 75927ad..daecdb8 100644 --- a/template/.github/workflows/kernel-matrix.yml +++ b/template/.github/workflows/kernel-matrix.yml @@ -7,12 +7,20 @@ name: kernel-matrix # QEMU/KVM on the runner. Each job writes a detail table to its step summary and # uploads its result; the final `matrix` job pivots them into one ✅/❌ grid. # -# Tune `matrix.kernel` to the kernels your script must support. Available tags -# live at https://quay.io/repository/lvh-images/kind?tab=tags — the `-main` -# entries track the latest build of each line. The example probes are CO-RE -# tracepoint programs, so they need a BTF-capable kernel (~5.4+); a program that -# uses newer features (ringbuf, sched_ext, …) will legitimately fail to load on -# kernels that predate them — which is exactly what this matrix surfaces. +# Tune `matrix.kernel` to the kernel lines your script must support (`6.6`, +# `bpf-next`, …); available lines live at +# https://quay.io/repository/lvh-images/kind?tab=tags. Each line is resolved to +# a concrete image at run time rather than using the floating `-main` tag, +# which the action can't consume: little-vm-helper@v0.0.30 derives the VM image +# filename by stripping a trailing *numeric* build stamp, so a `-main` tag +# yields a name that doesn't match the file `lvh` actually unpacks and the run +# dies with "invalid reference format". So each job looks up the newest +# date-stamped tag (`-YYYYMMDD.HHMMSS`, which the action handles) — always +# tracking the latest build, with no tag to bump and immune to quay's pruning of +# old stamps. The example probes are CO-RE tracepoint programs, so they need a +# BTF-capable kernel (~5.4+); a program that uses newer features (ringbuf, +# sched_ext, …) will legitimately fail to load on kernels that predate them — +# which is exactly what this matrix surfaces. on: workflow_dispatch: @@ -29,17 +37,32 @@ jobs: strategy: fail-fast: false matrix: + # Kernel lines to verify. Each is resolved to its newest date-stamped + # lvh image at run time (see the header). kernel: - - '5.10-main' - - '5.15-main' - - '6.1-main' - - '6.6-main' - - '6.12-main' - - 'bpf-next-main' + - '6.1' + - '6.6' + - '6.12' + - 'bpf-next' name: kernel ${{ matrix.kernel }} steps: - uses: actions/checkout@v4 + - name: Resolve newest lvh image tag + id: img + env: + KERNEL: ${{ matrix.kernel }} + run: | + set -euo pipefail + # Newest -YYYYMMDD.HHMMSS tag (date-stamps sort + # lexicographically, so tail -1 is the most recent build). + newest="$(curl -sf "https://quay.io/api/v1/repository/lvh-images/kind/tag/?onlyActiveTags=true&limit=100&filter_tag_name=like:${KERNEL}-" \ + | jq -r '.tags[].name' \ + | grep -E "^${KERNEL}-[0-9]{8}\.[0-9]+$" | sort | tail -1)" + [ -n "$newest" ] || { echo "::error::no date-stamped tag found for kernel line '${KERNEL}'"; exit 1; } + echo "resolved ${KERNEL} -> ${newest}" + echo "tag=${newest}" >> "$GITHUB_OUTPUT" + - name: Build BPF object + stage veristat run: | set -euo pipefail @@ -65,7 +88,7 @@ jobs: with: test-name: veristat-${{ matrix.kernel }} image: kind - image-version: ${{ matrix.kernel }} + image-version: ${{ steps.img.outputs.tag }} host-mount: ${{ github.workspace }} install-dependencies: 'true' cmd: | @@ -140,7 +163,7 @@ jobs: m = re.match(r"(\d+)\.(\d+)", k) return (1, 0, 0) if not m else (0, int(m.group(1)), int(m.group(2))) kernels.sort(key=keyf) - short = lambda k: k.replace("-main", "") + short = lambda k: re.sub(r"-(main|\d{8}\.\d+)$", "", k) print("## 🐧 Kernel verification matrix\n") if not progs: