Skip to content

Report process.platform as 'linux' under WASIX - #114

Closed
Arshia001 wants to merge 2 commits into
mainfrom
fix/wasix-process-platform-linux
Closed

Report process.platform as 'linux' under WASIX#114
Arshia001 wants to merge 2 commits into
mainfrom
fix/wasix-process-platform-linux

Conversation

@Arshia001

Copy link
Copy Markdown
Member

Split out of #111.

process.platform differing between targets ('linux' vs 'wasi') made packages that switch on it behave differently per target — playwright-core's registry throws at require time on unknown platforms, which broke Uptime Kuma's boot only on WASIX. WASIX emulates Linux syscall semantics, so report 'linux'.

Consequences handled here:

  • Node tests guarded by common.isLinux now run on the WASIX suite; test-pipe-abstract-socket-http is skipped (abstract sockets are a Linux kernel feature WASIX does not implement).
  • js-remix-staticsite is skipped on the WASIX edge framework stage: its serve binary now takes arch's getconf execSync path (platform=linux, arch unknown) and WASIX cannot spawn /bin/sh. Proper fix (harness-internal static server) tracked separately.

Verified: full wasix quickjs suite green locally (1671 passed, 0 failed).

🤖 Generated with Claude Code

Arshia001 and others added 2 commits July 15, 2026 11:07
Native and WASIX must expose the same functionality, and process.platform
differing ('linux' vs 'wasi') made packages that switch on it behave
differently per target — playwright-core's registry throws at require time
on unknown platforms, which broke Uptime Kuma's boot only on WASIX. WASIX
emulates Linux syscall semantics, so report 'linux'.

Consequence: node tests guarded by common.isLinux now run on the WASIX
suite; skip test-pipe-abstract-socket-http (abstract sockets are a Linux
kernel feature WASIX does not implement). Full wasix quickjs suite green
locally: 1671 passed, 0 failed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…x + arch)

Regression exposed by 'Report process.platform as linux under WASIX': the
app's start command is `serve` (Vercel static server), which statically
imports clipboardy -> arch@2.2.0. arch's getconf-execSync path is gated on
process.platform === 'linux' and only reached because process.arch is
'unknown' under WASIX (the x64/ia32 fast-returns don't fire). WASIX cannot
spawn /bin/sh (EACCES), so `serve` crashes at import. Under the old 'wasi'
platform arch returned 'x86' without shelling out, so this passed.

Skip on the WASIX edge stage only (matches js-astro-ssr-standalone); Node
baseline and QuickJS native keep full coverage. process.platform='linux'
stays — it is load-bearing for Uptime Kuma (playwright). Proper long-term
fix is to serve static-site apps via the harness's internal static server on
edge stages so `serve` is never invoked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Arshia001

Copy link
Copy Markdown
Member Author

@syrusakbary and I both believe this change doesn't make a lot of sense to include, so closing this.

@Arshia001 Arshia001 closed this Jul 17, 2026
Arshia001 added a commit that referenced this pull request Jul 20, 2026
PRs #113 (disable native addon loading) and #114 (process.platform='linux'
under WASIX) were closed without merging, so this branch no longer carries
them. Two apps depended on that behavior, each on one stage only:

* js-hedgedoc on native — its optional ws accelerators bufferutil and
  utf-8-validate ship legacy NAPI_MODULE prebuilds that call the unexported
  napi_module_register from a static constructor during dlopen, killing the
  process (exit 127) before any JS runs. #113's early catchable throw is what
  made this fall back to the pure-JS path. Passes on WASIX (no dlopen).
* js-uptime-kuma on WASIX — playwright-core's registry throws
  `Unsupported platform: wasi` at require time. Passes on native.

js-remix-staticsite is unskipped again on WASIX: it was only skipped because
#114 made `arch` take its execSync path, and it passes now (verified 1/1).

Verified locally: native 17 pass / WASIX 16 pass, with the pre-existing local
js-etherpad environment failure (pnpm-in-app + oidc-provider ttl; green in CI)
the only remainder.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant