chore: generate kernel artefacts from CMake instead of nox -s prepare#4190
chore: generate kernel artefacts from CMake instead of nox -s prepare#4190henryiii wants to merge 5 commits into
Conversation
Building awkward-cpp from the repository now runs the dev/ generation scripts (header-only copies, kernels.h, kernel signatures, kernel tests) at CMake configure time, guarded by an input-content hash so unchanged inputs are not regenerated. The generation scripts no longer touch outputs whose content is unchanged, so regeneration doesn't invalidate incremental builds. sdist builds run configure first (sdist.cmake), so sdists still ship the generated files; building from an sdist skips generation. pyyaml/numpy are build requirements only when not building from an sdist. The sdist include patterns are now anchored; the bare "header-only" pattern also matched build/*/header-only and leaked configure outputs into the sdist. nox -s prepare remains for the pure-Python awkward package build, docs data, and test workflows that cache the awkward-cpp wheel. Assisted-by: ClaudeCode:claude-fable-5
|
🤖 AI text below 🤖 What changed
CI — removed the Docs — README, CONTRIBUTING.md, and AGENTS.md updated (dev setup is now just What still uses
|
The generated test suites are shipped in the sdist but not needed to build a wheel, and generating them requires numpy, which pyodide's cross-compiling build environment cannot import host-side. Gate dev/generate-tests.py on SKBUILD_STATE=sdist and only add numpy to the build requirements in that state (currently cosmetic: scikit-build-core evaluates requires overrides with the default sdist state, but the pyodide env tolerates an uninstallable numpy requirement). Also fix the yaml loader fallback in dev/generate-tests.py: on Python < 3.13 (no sys._is_gil_enabled) it unconditionally used yaml.CSafeLoader, which doesn't exist when pyyaml is built without libyaml (windows-11-arm). Fixes the pyodide, docs WASM, and windows-11-arm CI failures. Assisted-by: ClaudeCode:claude-fable-5
Assisted-by: ClaudeCode:claude-fable-5
The cibuildwheel test-command runs the generated kernel test suites from the checkout, but wheel builds no longer generate them (only sdist packs do), so restore a generation step scoped to the tests. Assisted-by: ClaudeCode:claude-fable-5
…figure The generation scripts already leave unchanged outputs untouched, so the SHA256 input-hash stamp was a second change-detection layer that saved under a second of configure time while adding ~35 lines, a hidden cache variable, and a hand-maintained output list. Assisted-by: ClaudeCode:claude-fable-5
|
Ran 🤖 AI text below 🤖 Fixed
Skipped (with reasons)
|
|
The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR4190 |
|
#4236 would make this a little simpler. |
🤖 AI text below 🤖
Building
awkward-cppfrom the repository no longer needsnox -s prepare— a fresh clone builds with justpip install ./awkward-cpp.copy-cpp-headers.py,generate-kernel-signatures.py) when the repository sources are present, guarded by a content hash of the inputs (registered asCMAKE_CONFIGURE_DEPENDS, so editing the kernel spec retriggers via a plain rebuild). An sdist ships the artefacts and skips generation;-DAWKWARD_PREPARE=OFFopts out.SKBUILD_STATE=sdist): they aren't needed to build a wheel, and generating them needs numpy, which pyodide's cross-build environment can't provide host-side. Developers get them fromnox -s prepare -- --testsas before.sdist.cmake = trueruns configure before packing, so sdists built from a raw checkout still contain the generated files.pyyamlis a build requirement when not building from an sdist (if.from-sdist = falseoverride), withnumpyadded for the sdist state.AUTO GENERATED ONstamp), and header copies preserve source mtimes, so regeneration does not invalidate incremental builds.sdist.includepatterns: the bare"header-only"pattern also matchedbuild/*/header-onlyand leaked configure outputs into the sdist once a build directory existed.dev/generate-tests.py: on Python < 3.13 it unconditionally usedyaml.CSafeLoader, which doesn't exist when pyyaml lacks libyaml (seen on windows-11-arm).awkwardpackage build (hatchling), docs data (--docs), and test workflows that need the generated kernel tests or cache the awkward-cpp wheel.Verified locally beyond CI: clean-checkout sdist build (contents complete, tests included, no
build/leakage), wheel built from a fresh-clone state without test generation, wheel built from the sdist with generation skipped, and direct-CMake incremental behavior (reconfigure is a no-op; content changes to the spec regenerate;touchdoes not).Note for review:
awkward-cpp/pyproject.tomlchanged, so the "Needs C++ Release" check will flag a version bump for the next release.