Skip to content

lefthook: Add version 2.1.11 - #2277

Open
luhenry wants to merge 2 commits into
mainfrom
lefthook
Open

luhenry wants to merge 2 commits into
mainfrom
lefthook

Conversation

@luhenry

@luhenry luhenry commented Sep 24, 2026

Copy link
Copy Markdown
Member

Repackages a prebuilt, statically-linked Go CLI binary as a py3-none platform wheel. Upstream publishes no riscv64 wheel.

Mirrors upstream's release.yml publish-pypi job and its packaging/scripts/lib/Registries/PyPI.rakumod.

Differs from upstream

  • Cross-compiles the Go binary from source - upstream's goreleaser build has no riscv64 GOARCH entry to fetch a prebuilt one from.

Testing

  • Installs a real pre-commit hook and runs git commit, proving the bundled riscv64 binary executes end to end.

License: OK

Patches

  • 0001-add-riscv64-to-the-PyPI-wheel-platform-tag-table.patch - To upstream (no riscv64 CI to exercise it yet). Without it the build falls back to a universal py3-none-any tag that would misrepresent a riscv64-only binary as portable.

Smoke-tested across cp312/cp313/cp314/cp314t: hook installs and fires on every interpreter.

lefthook's PyPI wheels are hatchling builds that repackage a prebuilt,
statically-linked Go binary per platform (see
packaging/registries/pypi/hatch_build.py upstream); there is no sdist to
build from, only 6 platform wheels. Go's own riscv64 cross-compilation
(CGO_ENABLED=0, no assembly, no purego/cgo_import_dynamic in the
dependency graph) produces a static riscv64 binary with no ELF
interpreter, so gotcha 124's ld-linux fix does not even apply here.

The build mirrors upstream's own publish-pypi job: cross-compile the
same "no_self_update" build id upstream's release.yml/goreleaser
produces, stage it under lefthook/bin/lefthook-linux-riscv64/, and run
`uv build --wheel` with the same LEFTHOOK_TARGET_PLATFORM/ARCH env vars
publish.raku sets per platform. hatch_build.py's PEP425_TAGS table has
no riscv64 entry, so patches/lefthook/2.1.11/ adds one
(py3-none-manylinux_2_39_riscv64, matching this repo's riscv64 image).

Tested by installing a real pre-commit hook and running `git commit` on
riscv64 hardware, proving the bundled binary executes end to end.
luhenry added a commit that referenced this pull request Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2277/

Built to branch gh-pages at 2026-09-24 07:32 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
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