Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,26 @@ jobs:
sudo apt-get update
sudo apt-get install -y musl-tools

- name: Build init binary
run: |
make

- name: Build sdist and wheel
run: |
poetry build

# The build script makes the wheel interpreter and platform specific
# (cp311-cp311-linux_x86_64), which PyPI rejects. The only native code
# is the static kerf-init, so the wheel runs on any Python 3 and libc.
- name: Retag wheel for PyPI
run: |
file src/kerf/data/kerf-init | grep -q "statically linked"
pip install wheel auditwheel
python -m wheel tags --remove --python-tag py3 --abi-tag none \
--platform-tag manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64 \
dist/*.whl
auditwheel show dist/*.whl

- name: Check the sdist builds a wheel
run: |
pip wheel --no-deps -w /tmp/sdist-wheel dist/*.tar.gz

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ pip install kerf-multikernel
# Or isolated with pipx, avoiding conflicts with other packages
pipx install kerf-multikernel

# From source (recommended for development)
# From source (recommended for development). Installing builds the
# static kerf-init with musl-gcc (e.g. apt install musl-tools), so
# rerunning pip install after a pull also picks up kerf-init changes.
git clone https://github.com/multikernel/kerf.git
cd kerf
# Installs 'kerf' command to ~/.local/bin/kerf
Expand Down
21 changes: 21 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 Multikernel Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Poetry build script: rebuild kerf-init so a wheel never ships a stale one.
"""

import subprocess

subprocess.run(["make", "init"], check=True)
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ authors = ["Cong Wang"]
readme = "README.md"
packages = [{include = "kerf", from = "src"}]
include = [
{ path = "src/kerf/data/kerf-init", format = ["sdist", "wheel"] },
{ path = "src/kerf/data/kerf-init", format = ["wheel"] },
{ path = "Makefile", format = ["sdist"] },
{ path = "src/init/Makefile", format = ["sdist"] },
{ path = "src/init/*.c", format = ["sdist"] },
{ path = "src/init/*.h", format = ["sdist"] },
]

[tool.poetry.build]
script = "build.py"
generate-setup-file = false

[tool.poetry.dependencies]
python = "^3.9"
pylibfdt = "^1.7.0"
Expand Down
Loading