#26740·oxc

oxlint: `RuleTester` refuses to run on Bun because it needs a 6 GiB `ArrayBuffer`

Author: mattstanbrellCreated Sep 16, 2026Updated Sep 17, 2026
LabelsA-linterA-linter-plugins

RuleTester (from oxlint/plugins-dev) throws on Bun before it parses anything:

`RuleTester` is not supported on 32-bit or big-endian systems, versions of NodeJS prior to v22.0.0, versions of Deno prior to v2.0.0, or other runtimes

Cause. apps/oxlint/src-js/package/parse.ts needs a 2 GiB block that starts on a 4 GiB boundary. JavaScript cannot request an aligned buffer. So the file allocates new ArrayBuffer(BLOCK_SIZE + BLOCK_ALIGN), 6442450928 bytes, and takes the aligned 2 GiB slice out of it. Bun limits one ArrayBuffer to 4 GiB. Thus rawTransferRuntimeSupported() returns false for Bun by name.

Measured on Bun 1.4.2 (macOS arm64):

new ArrayBuffer(2**32)       ok
new ArrayBuffer(2**32 + 16)  Out of memory
new ArrayBuffer(6442450928)  Out of memory

Bun's WebKit fork sets MAX_ARRAY_BUFFER_SIZE to 1ull << 32 in Source/JavaScriptCore/runtime/ArrayBuffer.h. The comment there says the limit stays at 4 GB until Bun is audited for larger buffers.

The linter itself runs JS plugins on Bun. bun --bun node_modules/.bin/oxlint on a project with 15 custom rules gives output identical to Node. In that path Rust allocates the block and gives JS a Uint8Array view of it (external_linter.rs, Uint8Array::with_external_data). Only the tester allocates from JS.

To reproduce, run this in apps/oxlint:

bun --bun node_modules/vitest/vitest.mjs run test/rule_tester.test.ts

Every case throws the message above.

Proposed fix. The tester takes its block the same way the linter does. Rust owns a fixed-size Allocator (a thread-local AllocatorPool::new_fixed_size(1)). Rust copies the source text into it with alloc_str, parses, and writes RawTransferMetadata into the allocator's metadata slot. JS gets a Uint8Array view of the block. This removes the 6 GiB ArrayBuffer, the TextEncoder write into the buffer tail, and the JS runtime version checks. I have this working locally: rule_tester.test.ts passes 135/135 on Bun 1.4.2 and the suite passes 633/633 on Node 24. I can open a PR.

Versions: oxlint 1.83.0 at 0db906ef0, Bun 1.4.2, Node 24.21.0, macOS 15 arm64.