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 6 commits into
Conversation
|
🤖 AI text below 🤖 What changed
CI — removed the Docs — README, CONTRIBUTING.md, and AGENTS.md updated (dev setup is now just What still uses
|
|
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. |
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
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
scikit-build-core >= 1.0 (now required on main) evaluates requires overrides with the real state, so collapse the two-override workaround into one that requires pyyaml and numpy for any repository build. Gate kernel test generation on numpy being importable instead of on the sdist state; only pyodide's cross-build lacks a host-importable numpy, so drop the pre-cibuildwheel 'nox -s prepare -- --tests' CI steps everywhere except the pyodide jobs. Assisted-by: ClaudeCode:claude-fable-5
8435904 to
4965c35
Compare
🤖 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,generate-tests.py) when the repository sources are present, registered asCMAKE_CONFIGURE_DEPENDSso editing the kernel spec retriggers via a plain rebuild. An sdist ships the artefacts and skips generation;-DAWKWARD_PREPARE=OFFopts out.sdist.cmake = trueruns configure before packing, so sdists built from a raw checkout still contain the generated files.pyyamlandnumpyare build requirements when not building from an sdist (a singleif.from-sdist = falseoverride; requires scikit-build-core >= 1.0, already on main, for correct per-state override evaluation).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 cache the awkward-cpp wheel.messages.after-failurehint added on main; its advice (runnox -s preparefirst) is obsolete now that the build generates the artefacts itself.Verified locally beyond CI: clean-checkout sdist build (contents complete, tests included, no
build/leakage), configure with numpy (tests generated) and without (skipped with a message), 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.