Skip to content

Linux

Generated from docs/linux.md when the site was built at 7aa23e2.

Every check in tests/check.sh runs on Linux x86_64 except the Go timer app when Go isn’t installed (the script skips it) and the iOS and Android device runs. tests/check.sh --iced also renders tests/screens/cases.txt with the iced host (hosts/iced), offscreen, and compares each page with Chrome, which CHROME names here too. It stops at its first page for now: the iced host doesn’t report the stock text field style (fieldStyle in its probe) that tests/screens/compare.mjs has filled into the controls sheet since text fields took their CSS fill and border (73eb4eb). Tested on Arch Linux with user-level toolchains and no system packages beyond a C compiler, git, curl and fontconfig.

  • Rust (rustup’s stable) and a C compiler (cc) for QuickJS-ng and the C timer app.
  • Node and pnpm, for the examples and the Svelte fixture. Without root, pnpm installs into ~/.local with npm i -g --prefix ~/.local pnpm; npm 12 skips pnpm’s install scripts, and pnpm works without them.
  • Zig 0.17, for the Zig timer app.
  • A JDK 17 in JAVA_HOME, for the JVM binding, the Java timer app and ihatemyphone’s pages. The scripts put $JAVA_HOME/bin on the PATH, so it needn’t be there already. The Android build (hosts/android/native.sh) takes the javac on the PATH when JAVA_HOME is unset, and stops unless it is a JDK 17.
  • For Android builds, an x86_64 machine: native.sh uses the NDK’s linux-x86_64 (or darwin-x86_64) prebuilt toolchain, the only Linux one the NDK ships, so arm64 Linux can’t build the Android host.
  • Go, optionally, for the Go timer app.
  • Chrome or Chromium, for the Acid layout reference. Playwright’s Chromium works: CHROME names the binary.
Terminal window
export JAVA_HOME=$HOME/.local/opt/jdk17 # wherever the JDK is
export CHROME=$(ls -d ~/.cache/ms-playwright/chromium-*/chrome-linux*/chrome | sort -V | tail -1)
git submodule update --init
tests/wpt/fetch.sh # niso-wpt's own tests in cargo test read the checkout
cargo test --workspace
examples/lang/c/build.sh # and zig/, java/ (go/ with Go)
examples/ihatemyphone/test/run.sh
tests/svelte/run.sh
cargo run --release -p niso-wpt
tests/acid/fetch.sh
node tests/acid/run.mjs

or tests/check.sh for all of them. tests/wpt/fetch.sh needs the network only the first time, and when the pinned revision or its directories change. A cold cargo test --workspace (no target/) took 55 s on a 20-core Core Ultra 7 265K, of which about 40 s is compiling; tests/check.sh after it takes about 3 minutes more.

The hailgauge example builds against a hailgauge checkout beside niso (../hailgauge) through node_modules, and is skipped without one. NISO_LINK_HAILGAUGE names a checkout anywhere else (NISO_LINK_HAILGAUGE=~/hailgauge examples/ihatemyphone/test/run.sh); HAILGAUGE still works for now.

  • Fonts. The generic families come from fontconfig: on a GNOME-style system serif is Noto Serif, sans-serif Noto Sans, and system-ui Adwaita Sans, whose opsz axis runs from 14 to 32 (SF’s runs from 17 to 96). The render tests derive the baseline from the font’s own ascent and line gap, and the optical size from the font’s own axis range, so they hold for any font.
  • Acid. Chrome is given fontconfig’s families too (tests/acid/run.mjs), so both lay out the same fonts, and Linux has only the differences every platform has. macOS’s extra Acid2 differences are under acid2 darwin in tests/acid/expectations.json.
  • WPT. No subtest fails on Linux for a platform reason. One depends on timing: FileAPI/file/File-lastModified.html fails now and then (12 runs of 40 under 20 jobs), because step_wait polls on virtual-time timers for Date.now(), which is the real clock, to move on, so it passes only when a real millisecond goes by during the polls. Date.now() follows niso’s clock (niso_dom_wall_clock) only once the engine lets the binding set it: QuickJS-ng needs JS_SetDateNowFunc (repros/quickjs-date-now-hook, enabled by niso-quickjs’s date-now-hook feature; with it the test passes 40 runs of 40 and hr-time/basic.any.js passes its fifth subtest too), and Porffor has no hook yet (repros/porffor-date-now-hook). The worker variants of WebCryptoAPI/derive_bits_keys used to time out under 20 jobs too; since the runner gives a test with variants its timeouts once per variant (it runs them all in one page), they pass.
  • hosts/android/native.sh asked /usr/libexec/java_home for a JDK; on Linux it takes the javac on the PATH when JAVA_HOME is unset.
  • The Android SDK defaulted to ~/Library/Android/sdk; on Linux it defaults to Android Studio’s ~/Android/Sdk (native.sh, apk.sh, tests/screens/compare.mjs). ANDROID_HOME overrides both.
  • tests/check.sh added only macOS’s pnpm home (~/Library/pnpm/bin) to the PATH; it adds Linux’s (~/.local/share/pnpm) too.
  • tests/porffor/run.mjs measured memory with GNU time (/usr/bin/time -f 'maxrss %M'), which Arch doesn’t install by default and macOS’s BSD time doesn’t support. niso-run --time now prints its own peak RSS (getrusage), which the script reads instead.
  • The iOS host and --ios device runs need Xcode, so macOS.
  • tests/check.sh --iced: the iced host doesn’t report the stock text field style (fieldStyle in its probe) that tests/screens/compare.mjs fills into the controls sheet, so the comparison stops at its first page.
  • Porffor: two modules:: binding tests fail besides the four docs/engines/porffor.md lists (see there).