Skip to content

build: Rebuild kerf-init with the package and publish a wheel PyPI accepts - #19

Merged
congwang-mk merged 2 commits into
mainfrom
kerf-init-build
Sep 27, 2026
Merged

congwang-mk merged 2 commits into
mainfrom
kerf-init-build

Conversation

@congwang-mk

@congwang-mk congwang-mk commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

pip install . packaged whatever src/kerf/data/kerf-init was already on disk, since poetry only collects files and nothing ran make. The binary is gitignored, so after a git pull it stayed stale. On a test box this shipped a January kerf-init without the exec server, and kerf exec was refused with "not running kerf-init".

Changes

  • Build hook: build.py runs make init as the poetry build script, so every wheel and editable install carries a kerf-init built from the current sources. The sdist now ships the C sources and Makefiles instead of a prebuilt binary.
  • PyPI-acceptable wheel: with a build script, poetry tags the wheel cp311-cp311-linux_x86_64, which PyPI rejects and which would pin it to one Python. kerf-init is static and is the only native code, so the release job retags the wheel py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64, after checking the binary is static and letting auditwheel show confirm it links no system libraries. It also builds a wheel from the sdist to prove the sdist is complete.

Only an x86_64 wheel is built for now. kerf on main does not run on arm64 yet, so an arm64 wheel will come with the arm64 support.

Testing

  • From a clean clone with poetry 1.8.5: poetry build, retag, auditwheel show (consistent with manylinux_2_5_x86_64, no external symbols), twine check, and pip wheel from the sdist all pass. pip installs the retagged wheel.
  • pip wheel . rebuilds kerf-init when the binary is missing and when a source file is newer than it.
  • Reinstalling with the rebuilt kerf-init fixed kerf exec on the test box.
  • release.yml passes actionlint.
  • python3 -m pytest -q: 403 passed, 1 skipped.

🤖 Generated with Claude Code

pip install . packaged whatever kerf-init was already in src/kerf/data,
since poetry only collects files and nothing ran make. A tree updated by
git pull kept its old gitignored binary, and a spawn booted with it came
up without the exec server, so kerf exec was refused.

Run make init as the poetry build script so every wheel and editable
install carries a kerf-init built from the current sources. The sdist
now ships the C sources instead of a prebuilt binary.

Signed-off-by: Cong Wang <cwang@multikernel.io>
With kerf-init built by the poetry build script, poetry tags the wheel
cp311-cp311-linux_x86_64, which PyPI rejects and which would also limit
it to one Python version. kerf-init is static and is the only native
code, so retag the wheel py3-none for manylinux2014 and musllinux, after
checking the binary is static and letting auditwheel confirm it links no
system libraries.

Also build a wheel from the sdist, which now ships the C sources in
place of the binary, and drop the separate make step the build script
replaces.

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk congwang-mk changed the title build: Rebuild kerf-init with the package and publish per-arch wheels build: Rebuild kerf-init with the package and publish a wheel PyPI accepts Sep 27, 2026
@congwang-mk
congwang-mk merged commit 449f281 into main Sep 27, 2026
4 checks passed
@congwang-mk
congwang-mk deleted the kerf-init-build branch September 27, 2026 00:27
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