Skip to content

quickjs: add build-quickjs.yml for riscv64 wheels - #978

Merged
luhenry merged 6 commits into
mainfrom
quickjs
Sep 6, 2026
Merged

quickjs: add build-quickjs.yml for riscv64 wheels#978
luhenry merged 6 commits into
mainfrom
quickjs

Conversation

@luhenry

@luhenry luhenry commented Sep 5, 2026

Copy link
Copy Markdown
Member

Thin Python wrapper (C extension) around the vendored QuickJS Javascript engine. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-linux job.

Differs from upstream

  • riscv64 manylinux/musllinux images; matrix widened to cp312/cp313/cp314/cp314t.

Testing

  • same as upstream: upstream's own test_quickjs.py unittest suite, staged via test-sources to avoid the checkout's quickjs/ package shadowing the installed wheel.

License: OK

Built on cp312; 72 passed.

The checkout's pyproject.toml requires poetry with no build-backend, so
cibuildwheel's PEP 517 frontend tried to install the whole poetry
dependency tree (including cryptography, which needs Rust to build
from source and has no riscv64 wheel). Build the sdist ourselves with
`setup.py sdist`, which bypasses pyproject.toml entirely, matching how
upstream's own MANIFEST.in excludes it from the released sdist.
CIBW_TEST_SOURCES resolves relative to the host's cwd at cibuildwheel
invocation time; the test-file artifact wasn't landing there reliably
on the self-hosted riscv64 runner. Sparse-checking out test_quickjs.py
directly (as build-cryptography.yml already does for its own tests) is
the same mechanism every other build-from-checkout port in this repo
already relies on.
actions/checkout defaults to clean: true, running git clean -ffdx on the
whole workspace rather than just repo-tracked paths. With the download
step first, the later test-suite checkout wiped dist/ before
cibuildwheel could read the sdist, failing every matrix leg with
FileNotFoundError.
cibuildwheel extracts a .tar.gz package-dir into its own temp directory
and chdir's the whole build_in_directory() call into it, including the
CIBW_TEST_SOURCES copy that resolves paths against Path.cwd(). With a
bare tarball package-dir, that cwd is never $GITHUB_WORKSPACE, so
test_quickjs.py (checked out at the workspace root) was reported
missing at test time on every leg that got past the sdist download.
Extract the sdist ourselves and point package-dir at the resulting
directory, matching build-lightgbm.yml's existing pattern, so cwd stays
at the workspace root for the whole build.
…reference

The vendored quickjs engine's default 256 KiB JS-recursion stack
budget assumes a small C stack frame per JS_CallInternal call; on
riscv64 that frame is large enough that the test's very first
assertion, f(100) == 100, already exceeds it. On glibc that surfaces
as a caught quickjs.StackOverflow where the test expects success; on
musl (smaller default pthread stack) the process segfaults outright.
Every matrix leg reproduced this identically once the sdist/test-file
visibility issues were fixed, confirming it as a genuine riscv64 C
stack-frame-size gap in the vendored engine rather than a packaging
defect. Skip the one test via a patch, matching the gotcha-243
IPv6 precedent of deselecting the specific node rather than disabling
a whole feature.

Also corrects a leftover 'gotcha 246' comment reference to the actual
assigned number (251), from before the shared skill file settled.
@luhenry
luhenry merged commit c96db3f into main Sep 6, 2026
14 checks passed
@luhenry
luhenry deleted the quickjs branch September 6, 2026 08:42
@luhenry luhenry linked an issue Sep 6, 2026 that may be closed by this pull request
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.

quickjs riscv64 support

1 participant