Repository navigation
chore(sync): merge upstream Bun development history - #222
Draft
vincentkoc wants to merge 201 commits into
Draft
vincentkoc wants to merge 201 commits into
vincentkoc wants to merge 201 commits into
Conversation
Fixes four rare CSS bundling bugs left after oven-sh#47797. **A layer could be declared too late.** Bun hoists an external `@import` out of a bare `layer` import. It then prints in an anonymous layer of its own. ```css /* entry.css */ @import "./a.css" layer; /* a.css */ @import "https://example.com/ext.css" layer(w); @import "./g.css"; /* @layer v { ... } */ @import "./f.css" layer(w); ``` Nothing kept the place of `w`, so `v` came first and the wrong rule could win. Bun now prints `@layer w;` at that place. **An `@import` behind an unknown at-rule could apply twice.** Bun hoisted it and also left it in the file body. Bun now removes it from the body. **An `@import` behind an unknown at-rule with a `url()` could use the wrong import record.** Bun now looks up each import by its own record. **An import that is not CSS could lose its layer.** `@import "./a.svg" layer(x)` did not declare `x`. A second import of the same file was taken for a cycle. An import that fails to load still declares its layer, so each one now does. **Visible changes.** - A bare `layer` import can print an extra statement, such as `@layer w;`. - An `@import` of a non-CSS file behind an unknown at-rule is now dropped. It was already dropped without the at-rule. **Testing.** Random import graphs with external, asset and cyclic imports kept the right rule order 800 of 800 times. A model of the cascade gives the expected order, not a browser. It takes each external file to be empty. These graphs start from a bare `layer` import. A second set has conditions and external imports at the root. 33 of 250 of those graphs still differ from the model, down from 60 on an earlier commit of this PR. None got worse. Some are limits of the model, and they are not sorted yet. The dev server CSS tests were not run locally on the last commit. **Not fixed:** - A layer declared only under `@media` can still print too early. oven-sh#46934 found this shape in none of 10,116 real stylesheets. - If an import that loads nothing has a layer and a condition, such as `@import "./a.svg" layer(w) screen`, its own layer can print behind external imports. A later `@layer` statement stays ahead of them.
…-sh#48413) ### What does this PR do? Two places get a check that a neighbouring code path already has. **`bun run` / `bunx` on Windows.** When the resolved bin is a `.cmd`/`.bat` file, an argument containing a cmd.exe special character is refused with an error. `Bun.spawn`, Bun Shell, `bun run --shell=system` and the `.bunx` shim already do this; `run_binary_without_bunx_path` did not. It uses the same `bun_which::is_batch_file` / `batch_arg_has_cmd_metachars` helpers. ``` error: Failed to run "say.cmd": argument "%PATH%" contains a cmd.exe special character and cannot be passed to a .bat/.cmd file ``` **Macros.** A macro call in a `data:` URL module is an error, in `bun build` and at runtime. The two call sites (call expression and tagged template) now share one helper with the `node_modules` check. ``` error: Macros cannot be run from a "data:" URL module. ``` An earlier revision of this branch also changed `trustedDependencies`. That part has been dropped. ### How did you verify your code works? New tests: - `test/bundler/transpiler/macro-test.test.ts`: a macro call and a tagged-template macro call in a `data:` URL module, imported from a file and from another `data:` URL module, under `bun build` and `bun run`. They fail on the current release and pass with this branch. - `test/cli/install/bun-run.test.ts` (Windows only, which I could not run locally): a `.cmd` bin runs with a plain argument and is refused with `"`/`&` and with `%PATH%` Also ran the rest of `macro-test.test.ts`. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do? An entry of `test/vendor.json` now names the commit its test suite is checked out at, next to the release tag. `scripts/runner.node.ts` fetches that commit. The `update-vendor` workflow updates the commit together with the tag, and links the comparison of the two commits. ### How did you verify your code works? Checked the pinned commit out with it. CI runs the suite. --- _Generated by [Claude Code](https://claude.ai/code)_
…ests (oven-sh#48120) Bun's side of the ahead-of-time compiler rewrite (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1001, oven-sh/WebKit#1008 and oven-sh/WebKit#1021. About 31,000 files, +430,000 -34,000. Almost all of that is stored programs and stored test runs under test/aot. A stored program is a small program that CI compiles with `--aot`, runs, and compares with `bun run`. A stored test run does the same with `bun test --aot` and `bun test`. [skip size check], as in 607519a: the binary is 3.5 to 5 MB over the size check's limit on all 12 targets. If you don't use `--aot` - Built-in modules. Earlier AOT work edited files under src/js in place. Those files are back to what main had before that work, or within a few lines of it. The versions that compiled programs run now live beside them in src/js/ahead-of-time. - `util.inspect()` of an error that shares four or more stack frames with its `cause` prints them once, like Node. - A run-time `onResolve` plugin is passed `kind`, `namespace` and `resolveDir`, as bun.d.ts declares. It used to get only `path` and `importer`. - `Bun.resolveSync()` and its relatives accept an absolute path from an `onResolve` plugin even when nothing is on disk there. - `bun build --splitting` with many entry points is faster, with byte-identical output. - The first `pipe()` no longer creates `process.stdout` and `process.stderr` just to check whether the destination is one of them. - `Bun.build({ compile })` without `aot`, called from an executable that was built without the JIT, throws a clear error. - `bun check`, `bun lint` and `bun build --dts` (src/sema): a file with no `import` that contains both `export` and `namespace` may declare a global; `bun check` on a few named files also loads a file that another one names in `declare module "./x"`; `new.target` written with an escape is reported. - Some native files gain a check that is always false without compiled code. The largest change is to module mocks in src/jsc/bindings/BunPlugin.cpp, BunPlugin.h and BunCompiledModules.cpp. The pull request's description lists the others. With `--aot` The engine's changes are described in the three WebKit pull requests. On this side: - Function source text, and the lines that error messages quote, are stored in compressed blocks. - A package whose name is passed to a helper that loads it ends up in the executable. `createRequire(__dirname + "/plugins/")` is followed at build time. - Fewer type errors that `bun check` does not report stop a build. - Fixes to wrong answers, refused `require()` calls and stopped builds in mixed ES and CommonJS graphs, under `"sideEffects": false`, and in loops. Each has stored programs. - `bun test --aot`: the original of a partial mock runs compiled. `createRequire()` works in a test run in which the global object escapes, as it does with `lodash`. Many fixes to module mocks: preloads that mock, `--isolate`, `--rerun-each`, `__mocks__` folders, factories that fail or wait, failed loads, and files that re-export each other. - A new build warning, `TS100098`, says when a program reads a file next to its code that the executable will not contain. - Bun's C++ and Rust use the engine's new idiomatic names. Tests - 25 native tests and 572 IR tests that need Bun's table of built-ins move here from WebKit's repository, to test/aot/native and test/aot/engine-tests. - Stored test runs in which `bun test` itself has two answers are compared with a stored answer instead of a fresh `bun test` run. - test/aot/goals-not-met-yet.md lists what the compiler does not do yet: 241 goals in 134 files and 43 wrong answers in 14 files. The pull request's description has the table of known differences from `bun run` and `bun test` where main is right.
…en-sh#48436) Bun's side of a round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1025. This follows oven-sh#48120. About 9,400 files, +53,000 -22,000. About 3,200 of the files only move. Most of the rest is tests. [skip size check], as in 607519a. If you don't use `--aot` - The transpiler's visit pass skips an empty list that it used to drain for every scope. src/jsc/RuntimeTranspilerStore.rs counts the transpiler jobs that were scheduled and completed: two additions per job. - x64: byte-sized atomic subtract, and, or, xor in WebAssembly whose result is unused stored a wrong byte in the optimizing JIT; four encodings lacked a prefix. Hot JavaScript used the same encodings on x64: `Atomics.sub`, `and`, `or` and `xor` on an `Int8Array` or `Uint8Array` with an unused result stored a wrong byte. Fixed in the engine. - arm64 without LSE atomics: a compare-exchange that has to fail could store when its store-exclusive was lost. Fixed in the engine. - From the engine: `new WebAssembly.Module(bytes)` parses the bytes in place where no code can run in between; the optimizing JIT threads jumps through a `br_table` and tests a state machine's first state before its table; `Object.getOwnPropertyDescriptor()` and its relatives test one bit of the structure; each byte of a `WebAssembly.Memory` is reported to the collector once, not again for each new `buffer`; on x64, the stack check of a WebAssembly function compares with memory. `bun compile` - `bun compile rollup` compiles the executable that an installed package provides under that name, not the package's library. A source file of that name in the working directory comes first. `bun compile` stops if the executable would overwrite an entry point; files are compared by inode number, or by their real path on a file system that reports none. - An entry point without an extension is read as code if its first line is a `#!` line that names node or bun. - The build prints three rows, `bundle`, `check` and `compile`, whose times add up to the whole build. Notes come below them, grouped. Better messages for `--trim`, `--trim-without`, `--aot-harden` and `--library --target`. With `--aot` The engine's changes are described in oven-sh/WebKit#1025. On this side: - A real type error stops the build again in a project without `@types/bun`, and type errors are reported again where tsc has no type for an import. - A barrel in a `"sideEffects": false` package stays where its namespace is used as a value, and an import statement that tree shaking dropped no longer takes away names that the link looks up. - A `require()` path is followed through nested array patterns and rest elements. A load whose name is partly unknown embeds the files that its known alternatives name. - An asset outside the build's root keeps its place relative to the modules, and its short name is found under every spelling that names its own file in `bun run`, except on Windows (see the known issues). A folder without files adds no name to the listing of the root. - `Buffer.from("text")`, `Uint8Array.fromBase64("text")` and `Uint8Array.fromHex("text")` with constant strings are encoded during the build. - `bun test --aot`: about twenty fixes to module mocks. The bodies of an import cycle run, in the order of `bun test`, after `require()` gave up on one of its modules. An importer that is loaded again under a mock whose factory fails gets the first error again. - `Buffer.concat`'s descriptor says `writable: false`, so that tar 7 and npm 11 work. - `// bun-ignore TS100064` silences a compiler warning at a line. New and wider build warnings about files and paths that an executable will not find: TS100098, TS100099. Docs - The pages under docs/compiler are cut to what a user can hit, and checked against a build. About twenty wrong claims are fixed. The flag lists under docs/snippets/cli are held against `--help` by a test. Names - Bun follows the engine's new idiomatic names, 1,253 of them in the wire schema. Tests spell those names. No logic changes with the names. Known issues - Executables: a CommonJS file that the program loads with `import()` and that a computed `require()` of the same program also names runs in sloppy mode. - `bun test --aot` with `--rerun-each`: in the second pass, a refused `import()` behind an unrelated mock gives another error object. - `bun test --aot` with `--rerun-each`: in the second pass, a test that mocks and unmocks files of a package with a cycle of `export *` and a CommonJS file fails. Before, it passed, with wrong values. Contrived. - `bun test --aot` with `--rerun-each`: in the second pass, a CommonJS test file times out when a mock factory takes the original of a file that threw. Before, it passed. - `bun test --aot`: mocking three files of a package twice in a loop makes the second import of their barrel throw. - Executables on Windows: an embedded file is not found by `existsSync()` and `Bun.file().exists()` if its path ends in a separator, climbs out of a file (`a.txt/../a.txt`) or, from an ES module, has a lower-case drive letter. Under `bun run` it is found. Not compared with main.
…les, module mocks, build cost (oven-sh#48478) Bun's side of a round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1028 and oven-sh#1030. This follows oven-sh#48436. 2,879 files, +62,642 -4,043; of it test 2,562 files, +48,499 -741. [skip size check], as in 607519a. If you don't use `--aot` - Linux: the four libc signal functions that ask who called them are no longer inlined, so a chained handler gets the mask that the kernel would have set. - From the engine: on x64 a WebAssembly load whose low bytes alone are used returned a value at the end of the memory where it should trap; `f32.demote_f64` of a converted 64-bit integer rounded once where it rounds twice; a signaling NaN stayed signaling through `f32.demote_f64` of `f64.promote_f32`; all three in the optimizing JIT. Fixed. The data segments of a WebAssembly module lie in one buffer. - Plain `fstatSync()` takes 255.5 M instructions in our loop, 256.7 M before. - scripts/verify-baseline-static: the three allowlists name PackWordsImpl and UnpackWordsImpl, two new Highway functions that run-time dispatch alone calls. The Windows lines are by analogy with x64. Executables and builds - Two tests of bounds in a row, such as `if (v < 3) { a = 5; continue; } if (v > 9) { b = 7; continue; }`, took the first's arm for both where both arms are short. Fixed in the engine. - With the React Compiler in the same build, a callback that isn't memoized could be left out of the executable, and calling it ended the program. Fixed. - With the React Compiler, a component beside an `export *` could stop the build, and a file that is imported only for code that the compiler drops did not run. Fixed. - Stack traces name a source by its path relative to the folder of the build, as in `./src/lib/inner.ts:2:13` instead of `/$bunfs/root/lib/inner.ts`, and report the positions that `bun run` reports. What code looks files up by, such as `getFileName()` and `import.meta`, stays. - A build that compiles ahead of time refuses to write its executable over a file of its program (`--outfile`, `bun compile`, `compile.outfile`). `--compile-inspector` over `export *` no longer stops the build. - An entry point's own import statements always run, whatever "sideEffects" says: the command line tools of uuid and vitest printed nothing. - With `--aot-allow-code-from-disk`: files from disk find files on disk before compiled ones in packages that they ask for by name, `new Function("module", "return import(module)")` loads, and the library of evaluated code is kept. Found by postcss, @babel/cli, depcheck, knex, webpack and prettier. - A file that only an import() names must parse, also where it never runs, as with `bun build --compile`; before, a package with "sideEffects": false could leave it out. - import() of a data: URL that the program writes is part of the executable, also under `--disallow-code-generation-from-strings=strict`. - CommonJS: an ES module that imports a barrel runs its getters as `bun run` does, require() of a file whose `module.exports` is a getter runs it, a module loaded by a fresh require() names its parent. A `require()` whose computed name the build has followed gives way to an `import()` that names the same CommonJS file, so a bare .cjs file that the import loads runs in strict mode as in `bun run`. - Workers: files that URLs name are found beside any use of import.meta, a start that leads to no file warns (TS100082), a worker that runs the entry file has import.meta.main false, and a file that imports what cannot be resolved warns and reports the error event instead of stopping the build. - `--asset`: a folder outside the root that shares its base name with a folder below it is merged with it. Reads that an asset cannot answer warn (TS100087). A read through a symbolic link inside an --asset folder is warned of (TS100165), and the warning names the link to pass as an asset of its own. - A file of at least 1 MB is embedded at a multiple of 16 bytes; on Linux readFile() maps its pages. fs.fstatSync(), lstat() and open() of embedded files answer alike; below an embedded file they answer ENOTDIR. On Windows an embedded file is found with a trailing separator, over a.txt/../a.txt and with a lower-case drive letter. - A script without an extension takes octal escapes, and one with a byte order mark before `#!` is read. A comparison such as `process.argv[1] === __filename` is true where both name one file. - The build no longer warns about a path that is overwritten before anything reads it. A very long chain of operators no longer ends the build by a signal. `bun test --aot` - `--isolate` with jsdom and happy-dom: what the build compiled runs in their realms. In 41 test files of a public suite that use jsdom 246 tests pass, 101 before, 249 in `bun test`. - Mocks: chains whose factories take their original, originals that import each other in a cycle, names that a mocked file's module lacks, files that fail behind a mock, mocks below originals. A test file that never finishes loading names the mock that it waits for. In the second pass of `--rerun-each` a refused import() gives the same error object as under `bun test`. - Coverage counts stored fields and emitted enums as in `bun test`. Build cost - Less memory: packed layouts and function records, smaller type records and string tables, pages that the front end is done with are given back. Less work: indexes of import sites built once a file, and quadratic cases in unions, enums, barrels and nested patterns. Names - BunPlugin.cpp and what calls it: 210 plainer names and shorter comments. No logic changes with the names. Known issues - `bun test --aot`: a test file that mocks, with its original, a module of its own running graph, beside another such mock in a helper, can end with "never finished loading". Before, it did not. - With `--aot-harden=proof-checks`, a method that is replaced by that of another class stops a build. These can stop one: a replaced generator method that is stepped by hand, a test of a list's length against the length before a push() or pop(), a closure with two captured variables that is called in a loop and, beside it, inside a list callback, `row[i] += factor * b[i]` in a nest of two loops where `factor` is undefined in one call, a getter that switches on a variable of its file that holds a constant, and a method of a record in a list that adds strings to its parameters in loops. Before, they did not. - `bun test --aot`: with `vi.doMock()`, a factory that imports its own file and `vi.importActual()`, and with a mock of a file that a package has imported before, the answer is wrong as before, without the notice that was given before. - A build does not end where some eight or more branches of one if / else chain join onto the same field, or some 24 objects' fields are joined twice each from the next one's, and a file read uses the field; before, it did. - In a stack trace, where the conversion of an operand throws, or a constructor whose object is kept in a variable, the caller's line names the start of the expression and not the operator; before, it was the operator. - As before: a bare .cjs file loaded with import() runs in sloppy mode when a require() that never runs also names it. - A line of a stack trace no longer includes import.meta.path; that is by design. The embedded file lookups on Windows were not run.
WEBKIT_VERSION is 7f020d2818, the merge commit of oven-sh/WebKit#1015.
…ost (oven-sh#48617) Bun's side of a round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1036. This follows oven-sh#48478. 10,044 files, +195,171 -7,216; of it test 9,609 files, +166,986 -3,748. [skip size check], as in 607519a. Tests - CI compiles a stored program with `--aot`, runs it and compares it with `bun run`; a stored test run likewise, with `bun test --aot` and `bun test`. Where the answer of `bun test` depends on its threads, the reference is read on one thread. If you don't use `--aot` - `require()` of a module whose load an `import()` has begun no longer throws. That includes a chunk of a `--splitting` executable that is imported and, some microtasks later, required. - `bun test`: which files a later mock evicts no longer changes from run to run. A module that a test imports while a mock's factory runs shares no turn with that factory, so a factory that the test ends later does not keep both waiting (`BunPlugin.cpp`, `JSCommonJSModule.cpp`). - `bun:sqlite` asks one boolean where a read-only open failed. - Four corrections of the engine's DFG (`test/js/bun/jsc`): values that join a double, loads of constants, arguments of tail calls, elements that are read twice. Executables and builds - Files that the packages of a program read by paths that the build knows are embedded without `--asset`, and so is the `package.json` nearest above the entry point (`--explain` lists them). What the build can't know is told (TS100166, TS100170 to TS100175). - Shell built-ins, `bun:sqlite` (read-only) and `node:fs` find embedded files. Where the sources are gone, writes, renames and removals of them are refused, as on main. - A Worker's file that the program names by a URL, a path or a text is compiled where no start tells which file it is (TS100167, TS100168); one that can't be compiled warns (TS100169) and stops no build. - Functions that a file makes from a template by `eval` or `new Function` are compiled where the build can work out the strings. - `import.meta.main`, `require.main` and `package.json` files are those of the file that asks. `require("./index.mjs").name` off the call itself was undefined behind some stars; fixed. - `--explain` names the line to change, where the compiler lost track of a type, and the lines that run slower. - Large source files are checked and lowered in parts; the checker runs in two passes. `bun test --aot` - Originals of mocked modules are compiled, and more forms of mocks: under pending loads and in cycles, CommonJS and data files, spies, `resetModules()`, `--rerun-each`. - A test file or module that a mock cannot reach as in `bun test` is named at the end of the run, and so is a mocked file that may have run more often or shown other values. Known issues (none of them was there before) - Executables away from their sources, told: In rare forms a search for the nearest `package.json` finds a farther one, where main ends with an error. The build warns (TS100172, TS100174, TS100175), but not of a search from `path.dirname(__dirname)`, which finds none here and on main. - Executables, silent: A `Bun.file()` object of an embedded file, and what was made of it (a slice, a stream, a `Response`, a route), keeps the bytes from before the program's write: by an `import.meta.dirname` path, or by a `__dirname` path away from the sources. Objects that are made behind the write are right. - Executables, silent: Where a program defines two accessors on a prototype one after the other, an object that was made before and is read between the two can give the second one's answer, where `bun run` gives `undefined`. - Executables, silent: In strict code, a direct `eval` of a string that the build knows and that strict code refuses (a function that assigns to `arguments`, a parameter named `yield`) can make a function where `bun run` throws a `SyntaxError`. - Executables away from their sources, silent: In a folder that the program makes itself, where files lie that were embedded unasked, a listing shows what the disk has and a read finds the embedded ones; an append to one starts an empty file; `mkdirSync()` of an embedded folder succeeds. A read under `import.meta.dirname` of a file that `cp` of `Bun.$` wrote gives the embedded one. - Executables away from their sources, loud: A write into a folder that holds files embedded unasked is refused, and so are `chmod()`, `rename()` and `unlink()` of such a file, and `Bun.write()`, `write()`, `writer()` and `delete()` of its `Bun.file()`. - Builds under `--aot-harden=proof-checks`, loud: A loop whose two arms store one parameter into an element (`if (a[i] < 0) a[i] = x; else a[i] = x`), and that then adds the next element and multiplies the stored one, can stop the build where the list holds numbers, holes and strings. - Builds, loud: The compiler ends at some loops over BigInts that take the remainder of a product, `(a * b) % c`. - Builds, a warning: The build warns (TS100098) about some files that the program only writes. - `bun test --aot`, silent: If a test lays, replaces or removes a mock while the mocked file or one above it is still loading, lays a second patching mock over one that has not run, or mocks over a preload's mock behind a module reset, a file can run once more, once less or in another turn, without the notice that the previous version printed. - `bun test --aot`, silent: Over mocks whose factories wait, module bodies can run in another order or number, and a test that fails with an error of a module that cannot be found can pass. - `bun test --aot`, silent: The order of jobs around a top-level await of a mocked file can differ from `bun test`, without the notice that the previous version printed. - `bun test --aot`, told: After several mocks of one file or of one above another mock, after `jest.resetModules()`, after a mock was taken off and laid again, or over a mock whose factory waits for `importActual()`: an older mock or the original can answer, or the factory is called behind a CommonJS file that `bun test` runs after it. - `bun test --aot`, told: Where a hook of a preload imports a module and a test file then mocks a file below it, also behind a reset, the importers of the hook run again. - `bun test --aot`, told: Behind a reset or `vi.doUnmock()`, also in the next test file, a JSON file or a file of a package can be another object of the same contents. - `bun test --aot`, silent: Behind `vi.doUnmock()` of a mock whose original a test asked for (`vi.importActual()`, `jest.requireActual()`), an ES module of a package can be another namespace object of the same contents, and the `default` of a JSON file the same object where `bun test` makes another. - `bun test --aot`, told: A resolve plugin that redirects an import of a mocked file, or a mocked ES module above a CommonJS file that the test stored into `require.cache`, ends with a `ReferenceError`. - `bun test --aot`, told: The original of a mocked file that a store into `require.cache` has evicted runs from its source in the interpreter. The answers are right. - `bun test --aot`, told: An ES module that an earlier test file stored in `require.cache`, and whose import was mocked, runs from its source with other values. - `bun test --aot`, silent: A CommonJS file that a test file loaded by `importActual()` and then mocked can run once more for `importActual()` in a later test file. - `bun test --aot`, silent: The namespace of `import defer` of a CommonJS file that a test mocks can show the mock where `bun test` shows the original, or the original where it shows the mock, without the notice that the previous version printed. - `bun test --aot`, loud: An import of a mocked CommonJS file that an earlier test file wrote ends with a `TypeError`. - `bun test --aot`, loud: A chain of three thousand files whose last one is mocked ends with `RangeError`; two thousand are right. - `bun test --aot`, loud: In a shared run of several hundred files, two files of one project can fail that pass under `bun test`; isolated they pass. The embedded file lookups on Windows were run in CI alone.
…ven-sh#48423) ### What does this PR do? - Both `find_shell` functions share one `PATH` helper. - `Scripts::get_list` reads package.json for both lockfile formats. - Lifecycle scripts in hoisted installs resolve the bins of their package's dependencies from the install tree. - `NamesIterator` opens the right path for `directories.bin`. - Stricter pax header parsing for package tarballs. - Adds `Path::is_dependency`, used for macros. ### How did you verify your code works? Ran the install, tar and macro tests. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ies, mocks in import cycles (oven-sh#48677) Bun's side of a round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1040. This follows oven-sh#48617. 2,084 files, +88,328 -2,222: test 1,890 files, +71,847 -1,437; src 189 files, +16,434 -768; scripts 3 files, +28 -8; docs 2 files, +19 -9. [skip size check], as in 607519a. Tests - CI compiles a stored program with `--aot`, runs it and compares it with `bun run`; a stored test run likewise, with `bun test --aot` and `bun test`. If you don't use `--aot` - `concat()` keeps the elements of a species constructor's result where the argument has holes. - Reads of `node:fs` and `Bun.file()` ask one word of memory, which is zero outside an executable, and read as before. Wrong on main, fixed - A function that calls itself last behind `!`, `satisfies` or a JSDoc cast, beside such a call without one, lost what the first stored. - Inside `with (..)`, a test of a name (`typeof x`, `!x`, `if (x)`) was decided by the variable outside. Executables and builds - A mixin or a class factory (`Class.create()`, also in TypeScript) is copied for each call in module code, so each class has its own code. Constructors that are kept in variables, fields or namespaces are classes too. TypeScript enums are data. - The modules inside the output of webpack and Browserify are compiled as files, with their requests. Names that go through the helpers of Babel, esbuild, Rollup and swc are read directly. - What a package joins from its own files and hands to `new Function()` or `eval()` is compiled, and so are strings that such code evaluates in turn. If the string is another one at run time, that one is interpreted. - A WebAssembly file that glue code names beside itself is compiled. - Stores into a path's variables are followed in order, so a build finds reads that it passed over. Some files that the program only writes are no longer warned about (TS100098). - A server whose route is the `Bun.file()` of an embedded file threw at its start; it serves the file. - A data file that is imported under two types and then required by a path made at run time has the form that `bun run` gives it in more programs. - Names of packages and paths of data files are read when the program first needs them. `bun test --aot` - Partial mocks in import cycles: the files of the cycle run again with the mock, as in `bun test`. An `import()` behind an awaited import waits for its own source. - After `vi.resetModules()`, a package that is kept keeps the exports of a built-in module that a later file mocks, and the factory of a hoisted mock over a package is called when something asks for it. - Fewer notices where a run is as in `bun test`. Known issues - oven-sh#48617 lists what main has. Of it, the two builds that stop (two arms that store one parameter into an element; the remainder of a product of BigInts) are fixed here, a direct `eval` in strict code of a string that strict code refuses throws, accessors that are defined one after the other each answer by their own definition, the notice about `import defer` of a mocked CommonJS file is printed again, and fewer files that the program only writes are warned about (TS100098). Not on main: - Executables, silent: Where a method of a constructor function gives many names to a few of its objects, all of them take the larger size (at most 128 bytes an object). - Executables away from their sources, silent: A route of `Bun.serve()` that is a `Bun.file()` of a file embedded by `--asset` or an import keeps the build's bytes when the program writes or removes that file later by a `__dirname` path, and answers a `Range` request with the whole file (status 200). - Executables, an error: Where the text that `eval()` is given depends on a variable that is changed only in the default of a parameter of a function with an empty body, the program ends with an error (exit 134). - Executables, an error: A file of a package is not embedded where the package reads it by a parameter whose default is a function that writes files, such as `(write = Bun.write) => write(path.join(__dirname, "one.txt"))`, and the caller passes one that reads: `ENOENT`. - The build, an error: Some programs that read and write several elements of a typed array held by a file's variable stop the build with an error (one of 400 drawn programs). - `--aot-harden=proof-checks`, an error: A product stored into an element and read back from it, where one of the lists has an accessor, a hole or a read-only element, can end the process. By default the answer is right.
…stores rule out (oven-sh#48714) 106 files, +3051 -368. Pins oven-sh/WebKit#1042 (merged) by the build of its last commit, `autobuild-preview-pr-1042-22a187ad`. - A store in the default of a parameter of a function with an empty body is seen, so a string that `eval()` is given is not taken for settled; the executable ended with an error (exit 134). - A default that writes files is taken for the function that is called only where it is known to be, so a file that such a parameter reads is embedded. - The build no longer warns (TS100098) about a path that a later store rules out; the file is embedded as before. - A copy of a function that creates classes or functions looks its names up where the function is written. Where a name around the call hides one of them, the function isn't copied. - An arrow function that creates classes isn't copied where `this`, `new.target`, `arguments` or `super` in an `extends` or a computed key belong to what is around it. - A function that reads a private name of the class around it isn't copied. - Where code that never runs replaces a function that creates classes, the build no longer stops. - An `eval()` is left out only where every text that can arrive is proven; everywhere else the `eval()` itself stands there. - In a file that begins with `// @bun`, and in a text that is evaluated, functions and classes have the names that they have as written. - An async or generator function in the form of webpack's `require` is no such function: a call answers with its promise or its generator. - A loader in the form of webpack's or Browserify's is taken for one only where no default runs, nothing is disposed and no variable is read before its declaration. - A body in the output of a bundler may call its exports (`module.exports(x)`). - An iteration that awaits or yields behind a condition disposes the resources that it declares with `using`. - A text that the build computes with `indexOf("")` or `includes("")` is the one that the program computes. - The build shares what it knows of the ways of a file that chooses a path: in stored tests it takes 235 to 312 MB where it took 535 to 2,124. - A text that the build knows and that stores to a constant, an import or a member of a namespace throws where it does so; the executable ended with exit 134. - An executable holds no times of folders outside what it embeds: a folder is as new as the newest embedded file in it. - With `--trim`, an executable no longer holds the JavaScript parser of `bun test --coverage`: Hello world has 25,599,456 bytes (27,340,320 without this). - With the engine, on x64: where a `for`, `while` or `for..of` loop in a function changes a number in a variable of the file or of an enclosing function, and then ends with the engine's TypeError for a null or undefined element, the loop's changes are kept. - With the engine: a text that a loop with a `continue` cuts is cut. - With the engine: where a function asks `data[Symbol.asyncIterator]` and then walks a generator by `for..of`, the generator of the caller is finished afterwards. - With the engine: a property that a loop stores on an array to which it also pushes keeps its value. - With the engine: the build of a function that calls itself with a large number added no longer stops; nor, under `--aot-harden=proof-checks`, of one that reads an object literal under a template key. - With the engine: a spread (`{ ...q }`) of what `require()` of an ES file gave in a `try` or behind a condition copies the exports; the executable ended with an abort. - With the engine: where a method called in a loop gives a field a new list and Object.assign() copied the object before, the copy shows its own list's elements. - With the engine: where a native function defines a static field of a class again, a method of the class reads the new value. - With the engine: the build of a method of an array that is called without a receiver in a loop no longer stops. - With the engine: the build of some programs that read and write several elements of a typed array held by a file's variable no longer stops. - With the engine: where a loop in a `try` passes a value of unknown type to String.fromCharCode() and a later error is caught, the `catch` reads the value itself. - With the engine: a build on many threads could, rarely, stop, or differ from another; it no longer does. - Tests: Linux counts for a child the memory of the process that starts it until the child runs its program, so the driver of the stored programs could be told 248 MB of a program that holds 31 to 34. Where that count is over the bound, both sides are run again below a small process and judged by that; a memory that was not told fails. The bound stays. - Tests of plain Bun that could fail on a busy machine are restated by their causes: the abort test of `serve-direct-readable-stream.test.ts`, `csrf.test.ts`, `filesink.test.ts` and `node-http-connect.test.ts`. - Known issue, on main too: where a program stores a method again and again on a prototype to which it also adds elements under integer keys, an older method can be called. - Known issue, on main too: on x64, where a loop stores eight or more numbers 4 KB apart into one typed array, a number that it carries from the iteration before can be stored as it was in front of the loop. - Known issue, on main too: `x % y` beside `(x / y) | 0` can give `-4294967296` instead of `-0` where `x` is `-2147483648` and `y` is `-1`. - Known issue, on main too: the build of a program that captures an alias of `globalThis` in a closure, beside a property `get`, `has` or `apply` of an unknown object, can stop. - Known issue, on main too: on x64, the build of a program whose outer loop sums integers around a relaxation over the rows of a grid can abort. - Known issue, on main too: where a helper applies a generator function that it is given and its `catch` names the generator, the generator does not see what was added to the function's own `prototype`.
### What does this PR do? Pins WebKit to `b553971ea817`, the merge of oven-sh/WebKit#1042, in place of its preview build `autobuild-preview-pr-1042-22a187ad`. That commit also contains oven-sh/WebKit#1041, so this supersedes oven-sh#48730. ### How did you verify your code works? The release for the commit is published. CI is the check. --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do? Releases are built from a `release/bun-vX.Y.Z` branch instead of main, and CI prepares the draft releases. 1. Create the branch from a main commit, or from the previous tag with cherry-picks. `package.json` must have that version. 2. Click New Build on the branch. It builds with canary off, signs the Windows and macOS binaries, and uploads the zips to drafts on `oven-sh/bun` and `oven-sh/bun-releases-for-updater`. 3. Publish the drafts, in that order. Publishing still creates the tag. Another New Build replaces the drafts. A draft is titled "incomplete" until its files match the build. The build stops right away if the version differs from `package.json`, is not newer than the latest tag, or the commit is not the head of the branch. Also: - Pushes to and rebuilds of a release branch are canary builds that sign and upload nothing. - main no longer signs. - `[release]` in a commit subject does nothing, and a build at or behind the latest tag stays a canary. The canary revision lookup is deleted. - `upload-release.sh` is now `upload-release.ts`, typechecked with the other CI scripts. - Canary gets the Android and FreeBSD `-baseline` zips that tagged releases have. - The npm job of `release.yml` checks out the tag instead of main. - Closing a pull request does not cancel builds of a release branch. ### How did you verify your code works? Ran the pipeline generator and the scripts locally against stand-ins for `git`, `gh`, `buildkite-agent`, `codesign` and the GitHub API. The canary upload makes the calls the shell script made, plus the four new zips. The 36 file names match 1.4.4. Not run yet: a real canary upload, and a real build of a release branch, including macOS signing and creating the drafts. --- _Generated by [Claude Code](https://claude.ai/code)_
### What does this PR do? Sets the version in `package.json` to 1.4.5 and `LATEST` to 1.4.4, now that 1.4.4 is released. ### How did you verify your code works? The same two lines as earlier bumps. --- _Generated by [Claude Code](https://claude.ai/code)_
### What does this PR do? - `testFFI`, `jsc`, `testaot`, `aot-tests/`, `aot-engine/` and `aot_builtin_table.json` move from the profile zips, which are released, to `test-tools-<triplet>.zip`, which only the test steps download. It unpacks into the same folder, so tests find the tools where they did. - The draft on `oven-sh/bun` is created with `RELEASE_DRAFT_GITHUB_TOKEN`, so the author of the release is a user account instead of the app. GitHub keeps the creator of the draft as the author. Everything else still uses the app. - The Windows signing step signs only `bun.exe` and `bun-profile.exe`, as the macOS step does. - `.buildkite/ci.ts` no longer reads `RELEASE`. New Build on a `release/bun-vX.Y.Z` branch turns canary off by itself, and other manual builds have the canary option. ### How did you verify your code works? - Ran the packaging and unpacking code before and after with stand-in files: the same files end up beside Bun. The test steps of this PR's build use the real ones. - Ran `upload-release.ts` with Node against stand-ins for `gh`, the GitHub API and `buildkite-agent`: each call gets the right token, and the canary upload does not read the new one. - Nothing else in the repository sets or reads `RELEASE`. - The typecheck and the source lints pass. The signing and draft steps only run in a release build, so they have not run with these changes. --- _Generated by [Claude Code](https://claude.ai/code)_
…sh#48799) ### What does this PR do? The step that creates the draft releases lists contributors with GitHub's REST comparison of the previous tag and the commit. That request also builds the diff, and it failed the step with `422: this diff is taking too long to generate`. It now uses a GraphQL query that returns only the commits: the number of commits since the tag, and that many from the history of the commit. `compare.commits` is not used because it stops at 1000. ### How did you verify your code works? Ran the new function against GitHub and got the same contributors as the old code for 1.3.14 → 1.4.0 (2,036 commits), 1.4.0 → 1.4.1, 1.4.2 → 1.4.3, 1.4.3 → 1.4.4, 1.4.4 → main, and a base that is not an ancestor. `tsc -p scripts/tsconfig.json` and `test/internal/source-lints/` pass. It was run with a user token. The step uses an app token, which only a release build exercises. --- _Generated by [Claude Code](https://claude.ai/code)_
### What does this PR do? A release build now refuses to start, and to replace the drafts, unless: - every commit of the release branch is on `main`, or is a `git cherry-pick -x` of a commit on `main` - every commit of the previous release is in this one: as an ancestor, as the `main` commit it was picked from, or picked again A release branch can start from `main` or from the previous tag. Either way it cannot drift from `main`, or drop a commit that has already shipped. The error lists the commits. Only the messages are read. What a conflict resolution changed inside a cherry-pick is left to the review of the pull request into the release branch. ### How did you verify your code works? Ran `checkRelease()` on 22 scenarios in a local repository: releases from `main`, patches on a patch, resolved conflicts, reverts, and branch-only, squashed, merged or dropped commits. Against this repository, each release from 1.4.1 to 1.4.4 and current `main` pass, while the head of an open pull request and a commit older than the latest tag are refused. It takes about 4 seconds. `tsc -p scripts/tsconfig.json` and `test/internal/source-lints/` pass. It has not run in a release build yet. --- _Generated by [Claude Code](https://claude.ai/code)_
… awaiting files, known strings (oven-sh#48771) Bun's side of a round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental). The JavaScriptCore side is merged: oven-sh/WebKit#1045, as `de043228c294c72404a687634e1943f549f39048`. This follows oven-sh#48714. 1,718 files, +70,470 -2,660: test 1,466 files, +55,460 -853; src 250 files, +15,006 -1,803; docs 1 file, +3 -3; scripts 1 file, +1 -1. [skip size check], as in 607519a. Tests - CI compiles a stored program with `--aot`, runs it and compares it with `bun run`; a stored test run likewise, with `bun test --aot` and `bun test`. If you don't use `--aot` - What oven-sh/WebKit#1045 lists: the length of `[, ...list]`, and the message of replaceAll() on null or undefined. - `click(selector)` of `Bun.WebView` could click an element that was about to move. It looks once a frame now, and an element with a pending animation counts as moving. Wrong on main, fixed - Where an entry point imports a file only for its effects, the file's package says `"sideEffects": false`, and the file reads a member that an index of `export *` takes off a built-in module and passes the namespace on, the build stopped, or the member was undefined. - Where a closure captures an alias of `globalThis`, beside a property `get`, `has` or `apply` of an unknown object, the build could stop. - Where a `catch` behind a top-level `await`, or an operator, sets a path, the build did not warn that the program may read another file. - Where the value of a destructuring assignment stores to a field that the pattern reads, or an attribute of an element to one that its `key` reads (JSX's automatic runtime), the field was read as it was before. - With `--minify-syntax`, a function that another one returns and that reads `process.env[key]` gave the value of the build for the key `"NODE_ENV"`. A member of an `enum` under a key that a call passes to such a function was read as it was written, though the program stored into it. Executables and builds - Classes: parents that are parameters, members, results of calls or of `require()` are followed, also through the helpers of Babel, TypeScript and swc. Functions with prototypes assigned later, and decorated classes that are exported, are classes. - Objects: prototypes written into literals, `Object.create()` with a literal, and accessors that a helper defines are read from the source. - Bundles: universal wrappers (UMD), standalone output of Browserify, and exports that are getters are read directly. Requests beside `eval()` and `with` in a bundle are kept. - Strings the build knows: scripts that are joined from constants, names that such code declares, and calls of constants are evaluated when the program is built. - Files: an embedded file that a child process writes is read from the disk. A library that `dlopen()` opens stays the one that was embedded. - Size: an executable leaves out the test runner where nothing in it can reach `Bun.jest`, `bun:test` or `node:test`. With `--trim` it leaves out what only mocks enter, too. `bun test --aot` - The original of a mocked file outlives later runs of the file, and a mock visits only the modules that it concerns. Known issues - oven-sh#48677 lists what main has; what it says of typed arrays in a file's variable, of the defaults of parameters and of products under `--aot-harden=proof-checks` is fixed since or here. Of the rest, main has too: - Executables, silent: Where a method of a constructor function gives many names to a few of its objects, all of them take the larger size (at most 128 bytes an object). - Executables away from their sources, silent: A route of `Bun.serve()` that is a `Bun.file()` of a file embedded by `--asset` or an import keeps the build's bytes when the program writes or removes that file later by a `__dirname` path, and answers a `Range` request with the whole file (status 200). - Builds, loud: The build of a program whose object literals have more than about 65,000 different numbers as fields stops. - Executables, loud: A method of lists called on a typed array whose prototype was set to that of a class that extends `Array` aborts where nothing else uses that method. - Executables, loud: A store to `process.env` behind `Object.setPrototypeOf(process.env, {})` throws a `RangeError`. - Executables, silent: A CommonJS file whose code threw and that is asked for again by `require.bind()`, `eval()`, `new Function()` or `node:vm` gives its first error instead of running again. - Builds, loud: Under `--aot-harden=proof-checks`, the build of some loops over lists that may be buffers stops; with default flags the answer is right.
### What does this PR do?
The CSS AST stored arena and source slices as `*const [u8]` or `&'static
[u8]`, and most callers cast their arena to `'static`. It now carries
the lifetime of the arena, from `Parser` up to `StyleSheet` and the
bundler's chunk types, so the borrow checker proves in `src/css` what
the `SAFETY` comments claimed. The bundler's worker tasks still fill
that lifetime in with `'static` (`ParseTask`, `Worker::arena`), and
`shared_block_edges` is one more user of that accessor.
Removes 62 `unsafe` blocks, 3 `unsafe fn` and 2 `unsafe impl`. Three
blocks are left in `src/css` (the `Log` pointer in `ParserOptions`).
Most of the diff is `<'bump>`. By commit:
1. **Dead code**: `dependencies.rs` and `Url.loc`
(`analyze_dependencies` is never set),
`CssModule.{exports_by_source_index, references}`,
`ErrorLocation.filename` and the fields that fed it, three
`MinifyErrorKind` variants.
2. **Arena lifetime**: deletes `arena_str`, `src_str`, `arena_static`,
`bump_static`, `decl_*_static`, `BasicParseError`, `HTMLImportManifest`,
`EscapedJson`. `IdentOrRef` is an enum, not a pointer packed in a
`u128`.
3. **Import records and selectors**: one `&mut Vec` in place of two raw
pointers to it, `drain` and `into_inner` in place of `ptr::read` with
`set_len(0)`.
4. **Nesting context**: an argument in place of a printer field that
pointed at the stack.
5. **`bun pm diff`**: one arena per style sheet.
6. Review fixes, `DashedIdent::new` and `CustomIdent::new` for checks
that were repeated at each struct literal, and the test helper fix of
oven-sh#47613, whose false alarm this branch's macOS arm64 layout hits.
### Where the compiled code changes
- **`bun pm diff` output**: it leaked its CSS arena, so it stopped
normalizing style sheets after 64 MB in total. The arena is freed per
file and that limit is gone. New test.
- **Less work**: the printer no longer maintains the state from (1). Two
copies are borrows: literals in the `syntax` of `@property`, and the
source of a CSS module at run time. The size of an HTML import manifest
is counted without `fmt`.
- **One new branch**: a bundled `@import` tests the parser's `Option` of
import records, as `url()` does. `on_import_rule` goes from 105
instructions to 49. No other new check, and no new copy or allocation.
- **Layout**: references have a niche and raw pointers do not. 122 types
in `bun_css` changed size or alignment and none grew (`Property` 224 →
216 bytes). None is serialized or crosses FFI.
- **Instructions** (release, x64, before LTO): `bun_css` −3,585,
`bun_bundler` −2,023, `bun_runtime` −551, `bun_css_jsc` −494. No
function differs in any other crate that ships.
- **Longer functions**: 55 in `bun_css` against 108 shorter, 47 of them
by under 10 instructions, from decoding a tag out of a niche, a
different field order or register allocation. The larger ones inlined a
callee that used to be a call (`minify_nested` +101, `SmallList<Mask>`
clone +43) or duplicated a block's tail (`Source::to_css` +29,
`GenericSelector::deep_clone` +24).
### How did you verify your code works?
- Output is byte for byte the same as `main` for 3,933 CSS inputs in 5
modes, and for 42 `bun build` runs (CSS modules, `@import` conditions,
nesting, source maps, error messages), CSS modules at run time and
`Bun.color`.
- 28 CSS and bundler test files pass on a debug build (3,705 tests).
- The new `bun pm diff` test fails on `main`.
---
_Generated by [Claude Code](https://claude.ai/code)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
…en-sh#48854) ### What does this PR do? A timer runs JavaScript that sets and clears timers, so `timer::All` and the nodes in its heaps are reached again while a caller still uses them. They were handed out as `&'static mut`, or as raw pointers to dereference field by field. `&mut All` was live across callbacks in `drain_timers`, `get_timeout` and `set_timeout` (`valueOf`), and `wtf_arm` formed one on other threads. What changes while shared is now a `Cell`, `All` takes `&self`, and `timer_all()` returns `&All`. Removes 114 `unsafe` blocks and 8 `unsafe fn`. - Owners hold a plain `EventLoopTimer`, not a `JsCell` of one. - `All::remove` and `VirtualMachine::timer_remove` take a reference. The test for an armed timer moved into `timer_remove` from its callers, so it is safe. `All::remove` still expects a linked timer. - `All::insert` and `All::update` take a raw pointer as before, because the heap keeps it. - Still `unsafe`: linking a node into the heap, reading a node out of it, and the collections, which are borrowed in blocks in which no JavaScript runs. - Deleted: `timer_all_mut`, the per-module accessors (`timer_all`, `timer_heap`, `vm_timer`), the SQL timer hooks (they repeated the ones on `VirtualMachine`), `ClearedTimers`, `Deactivated`, `EventLoopDelayMonitor.rs`, `Timeout::cancel`, three resets of links the heap had already cleared, and `WTFTimer.repeat` (never read). ### Where the compiled code changes - **Layout**: a cell has no niche, so `RuntimeState` and `EventLoopTimer` are `repr(C)` to keep `timer` and `next` at offset 0. No type grew. - **Android only**: the existing `RUNTIME_STATE` is declared with `#[thread_local]`, like the VM pointer, instead of `thread_local!`. A tick now names it three times instead of once, and on Android the macro's reads are not merged. A read compiles to the same code on Linux, macOS, Windows and FreeBSD. - **Less work**: `FakeTimers::clear` releases each timer as it pops it and no longer collects them. - **Instructions** (release, x64, before LTO): `bun_runtime` −274, `bun_event_loop` −7, `bun_jsc` +4, `bun_sql_jsc` +86 (`reset_connection_timeout` is inlined into its 7 callers, 32 fewer calls). 216 crates are byte-identical. - **Hot paths**: `auto_tick` −4, `auto_tick_active` −4, `get_timeout` −2, `insert` −1, `set_timeout` −13. - **Longer functions**: 14 in `bun_runtime` against 29 shorter, by 1 to 7 instructions (`stop_advancing` +7, `Histogram::set_enabled` +6, `use_fake_timers_with_default` +6), from fields read again after a call and register allocation. No new check, copy or allocation. ### How did you verify your code works? Debug build, 28 test files for timers, fake timers, `AbortSignal.timeout`, `watchFile`, cron, TLS and libuv timers: 24 in full (721 pass), the 4 slow ones by test name (cron's `--hot` test and the rest of `node-tls-connect` are left to CI). The 4 tests that fail also fail on `main`. --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>
…sh#48866) ### What does this PR do? What a tick runs reaches the `EventLoop` again, and other threads post to it, yet its methods took `&mut self`. Safe code got that borrow from a `&VirtualMachine` (`event_loop_mut`, `event_loop_ref`), the rest dereferenced a raw pointer. Every method but `deinit` now takes `&self`, and `VirtualMachine::event_loop` returns `&EventLoop`. Removes 51 `unsafe` blocks and 3 `unsafe fn` (the new unit test adds 2 of each). - **Bug fix**: `&mut self` lets the optimizer keep fields across a callback. In release builds `DeferredTaskQueue::run` read the map's keys through a pointer loaded before the callback, which frees them if it posts a task and the map grows. - The enter guards borrow the loop, so `enter_scope` is safe. - A loop is made with its VM, so `virtual_machine` is not an `Option`. The pointer fields that safe methods trust are private, but for `imminent_gc_timer`. - Still `unsafe`: the task queues, borrowed in blocks in which no task runs. - Deleted: `event_loop_mut`, `event_loop_ref`, `event_loop_shared`, four `black_box` calls that hid the aliasing, `EventLoopSqlExt`, `ThreadSafeFunction::loop_mut`, `ReadFileUV::start_with_ctx` (merged into `start`), `impl Default for EventLoop`, and `EventLoop.waker` (never read). ### Where the compiled code changes - **The fix**: `DeferredTaskQueue::run` reloads the map after each callback (+3 instructions). - **Instructions** (release, x64, before LTO): `bun_jsc` −299, `bun_runtime` −113, `bun_event_loop` +3, `bun_http_jsc` +5. 215 crates are byte-identical. - **Longer functions**: `has_work_left` +55 (inlines two deleted helpers of 95), `__bun_spawn_sync_destroy_event_loop` +47 (inlines drop glue that was a call), `run_callback` +5, `auto_tick_asleep` +3, and four by 1 or 2. 57 are shorter. No new check, copy or allocation. ### How did you verify your code works? - A unit test for `DeferredTaskQueue::run` that Miri rejects on `main`. `bun_event_loop` is added to the Miri run. - 30 test files for the event loop, workers, sockets, streams, N-API and `spawnSync` on a debug build: the 4 tests that fail also fail on `main`. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…paths (oven-sh#48873) ### What does this PR do? - The temporary folder setup of the AOT tests now applies to all tests. `autoInstallTempDir` makes a folder outside of it. - `bun <file>.html` resolves every entry point as a path. ### How did you verify your code works? Ran the changed test files with a debug build. CI runs the rest. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…en-sh#48667) ### What does this PR do? When a request head does not fit in one write, the HTTP/1.1 client serialized the whole head again on every writable event and skipped what it had already sent. Now it keeps the serialized head until all of it is written and resumes from those bytes. The head inside a proxy tunnel does the same. A head that goes out in one write takes the same path as before. ### How did you verify your code works? Type-checked `bun_http`. I could not do a full build where I wrote this, so it has not been run yet and relies on CI. No new test is added here, and the existing short-write tests do not cover this path. --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do?
Script reaches the VM through `VirtualMachine::get()` under any call
that can run it, so a `&mut VirtualMachine` held across such a call is
aliased. Code either did that through the safe `as_mut()`, or avoided it
by passing `*mut VirtualMachine` and dereferencing it field by field.
Fields that change after `init` are now cells, every method takes
`&self`, and the raw pointers become `&VirtualMachine`. The same goes
for what the VM hands out: `RareData`, `SocketGroup`, `Debugger`,
`ModuleLoader`, the transpiler store and the queue of modules that wait
for an install. `SavedSourceMap` and `SSLContextCache` keep their table
inside its lock. A source lint keeps `&mut VirtualMachine` from coming
back.
Removes 250 `unsafe` blocks and 30 `unsafe fn`. For about 45 of the
blocks the compiler checks no more than before: 35 borrow a `JsCell`
field (mostly `transpiler`), 6 call `ssl_ctx_cache()`, and 3 exports
take a reference from C++.
- **Became `unsafe`**, because only `&mut VirtualMachine` made them
safe: `destroy` takes a pointer, `package_manager()` returns one, and
the hot reloader's `bust_dir_cache` and `install_bun_watcher` take one.
- **Still aliased**: a parse that runs a macro re-enters `vm.transpiler`
while it is borrowed (it used to be the whole VM), `log_mut` and
`env_mut` remain, and the watcher and transpiler threads read other VM
fields as before.
- **Deleted**: `VirtualMachine::{as_mut, get_mut, jsc_vm_mut,
debugger_mut, rare_data_ptr, run_with_api_lock_mut, hold_api_lock,
event_loop_ctx}`, `JSGlobalObject::bun_vm_ptr`, the `vm_mut`, `vm_get`
and `_slot` accessors around them, `EventLoopTimer::fire`,
`with_ssl_ctx_cache`, `SavedSourceMap::{lock, unlock}`, `entropy_slice`,
and `vm.arena` with the four arenas that were made for it and never
read.
### Where the compiled code changes
**Allocations**
| | Where | How often |
|---|---|---|
| fewer | a mimalloc heap (`vm.arena`, never read) | 1 per `Worker`, per
`bun test --parallel` worker, per `bun repl`, per Bake production build
|
| fewer | copy of `argv` for lint plugins (1 + one per argument) | was
per lint VM, now once per process |
| fewer | the default CSRF secret (16 bytes, now inside `RareData`) | 1
per VM that uses it |
| **more** | copy of the loader table for the watcher thread (5 + one
per extension, 25 by default) | once at start-up of `--hot` and
`--watch`, not on Windows |
| **not freed** | `vm.debugger`, if the debugger thread fails to start |
at most once per process |
- **Hash lookups, loops, reference counts**: none added, none removed.
- **Locks**: remapping a stack trace takes the source map lock once
fewer per frame.
- **Sizes**: `VirtualMachine` keeps its size. `RareData` and
`RuntimeState` (one per VM) grow by 8 bytes, the init options by 16,
`SourceMapHandlerGetter` (on the stack) by 8. `WebWorker` shrinks by 32.
- **Other work**: a VM that is at hand is not looked up again, and
timers fire through a direct call. Some functions read a field again
after a call (`_resolve`, `resolve_entry_point_specifier`, `setCwd`,
`fetch`). `StatWatcher::drop` tests its keep-alive before the call that
tested it, so that it forms no reference to a VM that is gone.
- **Instructions** (release, x64, before LTO): about 700 fewer. 192
crates are byte-identical.
### How did you verify your code works?
About 180 test files on a debug build (workers, module graphs, macros,
REPL, inspector, hot reload, test isolation, resolver, dev server, SQL
against real servers, TLS, timers). The tests that fail also fail on
`main`.
---
_Generated by [Claude Code](https://claude.ai/code)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do? The shell's environments and their strings were freed by hand on every path. They now have owners. - `EnvStr` was a `Copy` value packed into a `u128`, with `ref_()`/`deref()` at each use. It is an enum that is `Clone` and `Drop`, and `EnvMap` drops its strings as fields. - `ShellExecEnv` was a raw pointer passed from node to node, freed through `deinit_impl`, `deinit_embedded` or `deinit_child_duped_env`. The node that duplicates one owns it, and its cwd descriptor closes in `Drop`. - New: `bun_ptr::AliasableBox`, a `Box` that stays valid to point into after it moves. Child nodes keep pointers to their parent's env, which a moved `Box` would invalidate. - Deleted: `Tag` and the packing, `ref_strings`/`deref_strings`, `OwnedWalker`, `CleanupState`, and the walk that compared pointers to find who owned an env. Removes 4 `unsafe` blocks and 2 `unsafe fn`. ### Where release timing changes - A pipeline member's cwd descriptor closes after its node is freed instead of before. - The envs of an interpreter that never finished drop with its fields. - An `EnvMap` frees its keys, then its values, instead of pair by pair. - `memory_cost` no longer counts strings made by `export`. ### Allocations, lookups and loops - **Allocations: one fewer, none added.** Dropping an interpreter that never finished no longer collects its envs into a `Vec`. Counting every allocator call per call site on release builds, 23 scripts (pipelines, subshells, substitutions, `export`, `cd`, `which`, spawns) allocate, reallocate and free the same number of times as `main`. - **Sizes:** a pipeline's list of members grows from 8 to 16 bytes per member, because it holds the member's env. The list that a bare `export` sorts shrinks from 32 to 16 bytes per variable. `Script`/`Subshell` 88 → 96 fit in `Node`, which stays 176. `EnvStr`, `Interpreter` and `ShellExecEnv` keep their size. - **Hash lookups:** none added or removed. A lookup no longer refs and derefs the value. - **Loops:** the walk over all nodes that found who owned an env is gone. Cloning an `EnvMap` was two `memcpy`s and a pass that took refs, and is one pass over the keys and one over the values. Dropping one is two passes as well, instead of one. - **More work:** 2 instructions of 6,066 per command substitution. Whole scripts run 8,400 to 12,900 fewer. ### How did you verify your code works? - 44 shell test files on a debug build and `bunshell`, `leak` and `shell-load` on a release build. `bun-run.test.ts` has the same 28 failures on `main`. - `strace` shows the same closes as `main`, no leak is reported at exit, and Miri passes on `AliasableBox`. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ven-sh#48885) ### What does this PR do? Gives the event loops under the VM the lifetime and the sharing they really have. Three commits, 55 `unsafe` blocks and 2 `unsafe impl` fewer. **The uws loop.** `Loop::get()` returned a raw pointer to a loop that lives as long as its thread runs, and every user dereferenced it again. It returns `&'static ThreadLoop`, and what keeps the loop (socket groups, UDP, QUIC, timers) asks for `'static`. `ThreadLoop` has the two methods that need uWS's `LoopData`, so they cannot be called on the loop of `spawnSync`. **The mini loop.** What a tick runs reaches the loop again and other threads post to it, yet `tick*` took `&mut self`. `MiniEventLoop` and `AnyEventLoop` take `&self`. Bundler and install workers no longer form a `&mut` to post or to wake. `AnyEventLoop::tick` is one turn, and `sleep_until` lends the manager to its callback instead of passing a raw pointer through a trampoline. - **Became `unsafe`**, because they end a `'static` loop early: `free_thread_loop`, `close_thread_loop` and `SpawnSyncEventLoop::init`. Three other `unsafe fn` are gone. - **Still raw**: the libuv loop, the pointers other threads keep for `wakeup`, the loop that C passes to DNS, and the linker's pointer to its loop. - **Deleted**: `AnyEventLoop::tick_raw`, `MiniEventLoop::{tick, loop_ptr, top_level_dir}`, `mini_mut`, `file_polls_raw`, the `uws_loop_ref` accessors, `EventLoopCtx::platform_event_loop`, `FilePollRef::uws_loop`, `BundleV2::loop`, `HttpThread.loop_`, `UDPSocket.loop_`, and the `Send` impls of the two `rm` tasks, which nothing used. ### Where the compiled code changes **Allocations** | | Where | How often | |---|---|---| | fewer | copy of the working directory in `MiniEventLoop` (its one reader overwrote it first) | 1 per thread that makes a mini loop (HTTP thread, `bun run <script>`, `bun exec`, `bunx`, …), 1 more for `bun run x.sh` | None added. - **Hash lookups, loops, locks, reference counts**: none added, none removed. The wait loop moved from `tick_raw` into its callers, which call their condition directly instead of through a function pointer. - **System calls**: `init_global` no longer calls `getcwd`. - **HTTP thread**: contexts get their loop from `Loop::get()` instead of a second `&mut HttpThread`. - **Windows**: a spawn with a forgotten `loop_` hits its assertion instead of dereferencing null first. - **Instructions** (release, x64, before LTO): about 400 fewer. ### How did you verify your code works? About 60 test files on a debug build (spawn, workers, sockets, UDP, QUIC, fetch, shell, `--filter`, install with lifecycle scripts and the security scanner, `Bun.build` plugins, dev server). The tests that fail also fail on `main`. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…oven-sh#48880) ### What does this PR do? Descriptors that were closed by hand on each exit path now get an owner when they are opened. 136 close calls go and 5 come back inside `Drop` (21 become a `drop(x)` where the timing matters). Also gone: 33 scope guards, the 25 `cleanup(..)` calls in `inject`, and the flags that tracked what was still open (`close_handles`, `OutputFile.close`, `Plucker.found`, `child_closed`, `IOWhich`). - `File` and `Dir` own their descriptor. `close()`, `File::stdin()`/`stdout()`, `Fd::is_stdio` and the `Fd::INVALID` check are gone, with the five unit tests for them. Views of stdio use `File::borrow`, "not open" is `Option<File>`. - `File::drop` is now `fd.close()`, so **with debug assertions it aborts on a descriptor that is already closed** (on Windows, on any close error). The resolver's `package.json` and `tsconfig.json` closes get that assertion too. Release builds ignore the error as before. - New `Drop`: `Tmpfile`, the three directory stacks, and the unfinished `--compile` output. Deleted `Drop`: `OutputFile`, `TarballStream`, `ApplyDir`, `DirectoryRoute`, `Walker`, `AutoCloseFd`, POSIX `Endpoints`, and `ls`'s guard. - On POSIX `fd.close()` skips 0–2 and `sys::close` does not, which matters after `fs.closeSync(0)`. Every site JS can reach keeps the one it had. Three CLI-only directories (isolated linker ×2, `pm diff`) became `Dir`. - Sites that an open PR already rewrites are left alone, among them the router and pack's walkers, which still disarm a `File` or `Dir` they don't own. ### Where release timing changes - Closed after the parse instead of before: pack's ignore files, `/proc/version`, `/proc/self/cgroup`. - Closed at the end of the scope: a git checkout's directory (still before `ls-tree`), the empty file `Bun.write` creates. - Error paths only: pty ends close in another order, sync spawn frees its buffers after the kill, `inject` releases the template before deleting the temp file, and an archive write error is logged after the close. - `bun create` now closes the `package.json` it plucked when a second one follows or extraction fails. It leaked until exit. - Every close that preceded a rename, unlink, rmdir, spawn, chdir or exit still does. ### Allocations, lookups and loops - **Allocations: the same number, from the same places.** The diff adds and removes no allocating call on any platform. Measured on release builds against `main` by counting every allocator call per call site, over 31 CLI commands and 63 JS scenarios: no site allocates, reallocates or frees more or less often. - **Sizes:** `Terminal` 344 → 336 bytes. No other allocation changes size (`Walker`, `Tmpfile`, `EntryWriter`, `Plucker`, `TarballStream`, `DirectoryRoute`, `CopyFile` and the directory stacks' items were checked). - **Hash lookups:** none added or removed. - **Loops:** none added. The five that closed or freed things on the way out (three directory stacks, sync spawn's pipes and buffers) are now the drop of the container. Recursive `readdirSync` opens its root before the loop instead of on the first pass. - **Copies:** `Dir::delete_tree` no longer copies its 8 KB iterator on each pop. - **More work:** one branch per tar entry and per pipe EOF in sync spawn (assigning over an `Option<File>`), and 5 instructions of 1,024 in plain `readdirSync` (register allocation). Total code is 3,967 instructions shorter. ### How did you verify your code works? - `strace` against `main`: 63 JS scenarios (also with 0, 1, 2 closed) and 35 CLI commands (install, pack, patch, `--compile`, failures included) make the same calls and closes, in the same order but for work spread over pool threads. - 83 test files on debug and release builds. The 15 tests that fail also fail on `main`. No leak reported at exit. - `cargo check` for Windows, macOS, FreeBSD and Android. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do?
The tar reader has two modes. npm mode, which installs packages, now
follows npm's reader in more places, and fails on a tarball that has no
single reading.
- `bun publish` and `bun pm diff` use npm mode, and `bun pm diff` names
files the way `bun install` does
- a package has at most one gzip layer
The general mode (`Bun.Archive`, `bun create`, GitHub tarballs) does not
follow npm, as before. It gets a few smaller changes to sparse files,
symlinks and entry names, among them:
- sparse maps are validated before any data is read
- `extract()` creates symlinks last with a glob, as it does without one
- `new Bun.Archive({ "dir/": "contents" })` throws
### How did you verify your code works?
Compared npm mode with `tar` 6.2.1, 7.4.3 and 7.5.22 on generated
archives. 2,857 package tarballs, and 29 written by GNU tar, bsdtar,
Python, Go, git, npm and Bun, read the same as before.
The existing archive, install, pack, publish and `pm diff` tests pass on
Linux. Three fixtures are re-recorded and two expectations updated.
Windows and macOS were only type-checked.
---
_Generated by [Claude Code](https://claude.ai/code)_
…usively (oven-sh#48893) ### What does this PR do? `KeepAlive` and `Process` are shared, but their methods took `&mut self`. Two commits, 36 `unsafe` blocks and 9 `unsafe fn` fewer. **`KeepAlive`.** Its one byte of state is a `Cell`, so 23 owners hold the value itself instead of a `JsCell` or a take-and-put-back. The same for `jsc::Ref` and `CountedKeepAlive`. **`Process`.** What changes is in cells and the exit status is written once. What may free the process takes a `ThisPtr`. The waiter thread's queue, its tasks and the auto killer own their refs. Exit handlers are no longer passed the process. - **Still raw**: the `FilePoll` slot and the libuv handle, each behind one private method. - **One new lint baseline entry**: the macOS wrapper that moves a process to its reaper thread holds a `RefPtr` instead of a raw pointer. - **Deleted**: `ProcessHandle::{process_mut, kill, as_ptr}`, `Process::{deref, on_wait_pid_from_event_loop_task}`, `Subprocess::process_mut`, `release_ref_from_waiter_thread`, `PollerWindows`, `SyncWindowsProcess.process`, `WebWorker::with_parent_poll_ref`. ### Bugs this fixes | Bug | Where | When | |---|---|---| | use after free | `watch_or_reap` read the exit status after a handler that may have freed the process | macOS and FreeBSD, when the child is gone before it can be watched | | use after free | the waiter thread posted through a poster that the JS thread could free before `post` returned | wherever the waiter thread is used | Both are races that a test cannot force. No open issue is known for them. ### Where the compiled code changes - **Allocations**: none added, none removed. - **Reference counts**: the waiter thread clones the poster once per exit, one atomic increment and decrement (the second fix above). The counts on `Process` are the same ones, now held by `RefPtr`. - **Hash lookups, loops, locks**: none added, none removed. - **More work**: freeing a `Process` or reading its status tests one more value of the same byte. - **Less work**: lifecycle scripts no longer compare the exited process with their own, the Valkey client no longer resets its `KeepAlive` before reconnecting, and dropping a `WebSocket` no longer clears a field that is already empty. - **Instructions** (release, x64, before LTO): about 120 fewer. ### How did you verify your code works? About 55 test files on a debug build (spawn, also with the waiter thread forced, shell, cron, `--filter`, `--parallel`, install with the security scanner and git dependencies, terminal, webview, zlib, WebSocket, Valkey, workers, N-API). The tests that fail also fail on `main`. --- _Generated by [Claude Code](https://claude.ai/code)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ven-sh#48815) Bun's side of the next round of work on the ahead-of-time compiler (`bun build --compile --aot` and `bun test --aot`, both experimental), with some fixes of plain Bun beside it. The JavaScriptCore side is merged: oven-sh/WebKit#1047, as `c495a7e0e4e6ebc599b6022541ba57537be345a3`. This follows oven-sh#48771. 247 files, +3,687 -462: test 199 files, +2,682 -231; src and packages 46 files, +1,003 -229; docs and the pin 2 files. The text of functions - An executable stores the source text of its functions as it is and reads it in place, where it stored it in compressed blocks. The first `toString()` of a function takes 0.05 ms, where it took 0.19 ms. An executable is larger by about 1.5% over 119 npm packages (the TypeScript compiler 3.4 MB). A test run whose files hold more than 64 MB of text needs more memory. Wrong on main, fixed, in executables - A CommonJS file that is imported plainly and also under a type of code ran twice. - A member of an `enum` that a string known at build time reads was read as it was written, though the program stores into the enum's object. - `--explain` and the metafile did not list the files that a package's path leads to without a read that the build sees. - Where the first source in a folder beside an executable was gone, removed files in it counted as embedded ones. - An object that is made below a `var` while the variable's own initializer runs, or while an imported file runs first, had the variable's later value as its prototype. Wrong on main, fixed, in test runs - A test that stores into an `enum` of another file: the other files read the stored value, as in `bun test`. - Behind `vi.doMock()` and `vi.doUnmock()` over a preload's mock, `importActual()`, `requireActual()` and `importMock()` see the preload's module. `vi.resetModules()` takes the preload's module that a later mock displaced, and behind it `require()` gives the automock of a CommonJS file that only a mock had loaded. - Where a mock is replaced or removed while modules that use it load, imports, loads in flight and files that run again see the mocks that they see in `bun test`. One such run aborted. If you don't use `--aot`, fixes of plain Bun - TLS: a socket that is closed while its last data or its close_notify waits to be written sends them. HTTP/2: the close of a socket whose transport was rejected is not lost to a flush, and a session error that waited for the tick is told. HTTP/3: a server with port 0 tries ports until one is free for UDP too. Development server: a route that reaches a file that failed in an earlier bundle shows the failure. - `--watch`: a signal that asks the process to end, that another process sent and no listener has seen, ends it in every way that it restarts. Child processes with `ipc`: the last messages of a child that has exited are delivered. `Bun.build()` with `compile` on Linux and FreeBSD: the executable that it has written can be started while other child processes are starting. - `bun fmt`: a reader that closes the socket of the output on macOS is no error. `bun lint` and `bun fmt` on Windows resolve again the path of a file that another thread replaces.
Merge oven-sh/bun ca7729d while preserving OpenClaw runtime, transport, filesystem and build integration fixes. Conflict resolutions were independently source-reviewed. Native build, runtime and matching WebKit source qualification remain pending; this commit is for draft qualification.
|
Hi! I'm the It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Merge upstream Bun development history through
ca7729d01a30856c5f613886057a8d45d7c21a74, the version bump after 1.4.5. Signed merge2ec205221266e058ed61e77a2962b49a42d11281retains fork parent9debcc4b9db331d8ea8be404754baf1ffd0c7175and upstream ancestry. Land with a merge commit.Preserve the fork's transport, async-context, filesystem, process, build-provenance and consumer-qualification behavior across upstream ownership and AOT changes. All 166 conflict resolutions and subsequent source repairs received independent review.
Validation
Current head:
108557a84b535cd7ae65e1155739cdde0b2a6346.4fe734bbe9f8546ad0d61d24941481399559fc39: https://github.com/openclaw/bun/actions/runs/44686700965. The broader report still contained 21 failing test files.108557a84b535cd7ae65e1155739cdde0b2a6346: https://github.com/openclaw/bun/actions/runs/44690757600. It is running with matched ICU and all fixes below. The superseded system-ICU replay was cancelled; it cannot qualify this head.module.exportsaliases, final IPC replies after write failure, map-free transpiler cache persistence, decoded plugin importer URLs and directive normalization. Existing failing regressions remain the runtime proof targets.ea0d868505a2e7ae8fcc8a91a6465efd98d91d94). Independent VLQ decoding confirms all 18 old points remain and exactly two opening-parenthesis points are added; the directive mapping is unchanged.108557a84b535cd7ae65e1155739cdde0b2a6346;git diff --checkpassed. The exact-head default JavaScript lint job reports zero lint errors, then fails the two schema-generator cases against the old engine pin described above. No local native build or runtime qualification is claimed.Matched engine prerequisite
The published engine lacks APIs required by this source. Default pinned-engine jobs do not qualify the source pair.
Companion: openclaw/WebKit#56. At engine
2672541eb4f9a44519709d535c2e43509ba2bb0e, 1,901 JSC stress and 1,639 module tests, sampling/accounting/stack gates, Windows ARM64 build/runtime and the macOS artifact lane passed. Linux ARM64 passed at the preceding metadata-only engine head.After the full source-pair pass succeeds, update the engine's frozen consumer manifest and rerun its pipeline. Latest native/runtime results are pending.
This remains draft until matched native/runtime and consumer qualification pass. Published assets and OpenClaw consumer pins are unchanged. No release, tag or rollout is included.