Skip to content

Fix wheel build: include vendored binaries via artifacts, not force-include#5

Merged
Moge800 merged 1 commit into
mainfrom
claude/wizardly-allen-lnrqxf
Jul 6, 2026
Merged

Fix wheel build: include vendored binaries via artifacts, not force-include#5
Moge800 merged 1 commit into
mainfrom
claude/wizardly-allen-lnrqxf

Conversation

@Moge800

@Moge800 Moge800 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a latent packaging bug that would have failed every wheel build on the first release.

[tool.hatch.build.targets.wheel.force-include] re-added the entire binaries/ directory on top of hatchling's normal package scan, so building a wheel aborted with:

ValueError: A second file is being added to the wheel archive at the same path: `gomc_rest/binaries/.gitignore`.

This never surfaced in CI because release.yml (the only workflow that builds wheels) runs on tags only — it was found by building locally for testing.

Fix

Replace force-include with artifacts:

[tool.hatch.build.targets.wheel]
packages = ["src/gomc_rest"]
artifacts = ["src/gomc_rest/binaries/gomc-rest*"]

The vendored binaries are gitignored, so artifacts is the correct mechanism to ship them; the tracked files in that directory (README, .gitignore) are picked up once by the normal package scan.

Verified locally

  • Wheel builds with a vendored binary → binary included once, no duplicates (gomc_rest/binaries/gomc-rest.exe / gomc-rest-linux-amd64).
  • Wheel builds without any binary (sdist-fallback state) → succeeds, no binary.
  • Built win_amd64 and manylinux_2_34_x86_64 wheels; installed the Linux wheel into a fresh venv and confirmed launch() starts the bundled v1.4.0 server (health OK, token auth on) and connect() works.
  • Full test suite: 5 passed (including the real-launch smoke tests with a checksum-verified binary).

🤖 Generated with Claude Code


Generated by Claude Code

…nclude

force-include re-added the whole binaries/ directory on top of the normal
package scan, so hatchling aborted with 'a second file is being added ...
binaries/.gitignore'. This only surfaces when actually building a wheel, which
CI never did (release.yml runs on tags only), so the first release would have
failed. List the gitignored binaries as wheel artifacts instead — they are
included without duplicating the tracked README/.gitignore in that directory.

Verified locally: wheel builds, bundles gomc-rest-linux-amd64, installs, and
launch()/connect() work from the installed package.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy
Copilot AI review requested due to automatic review settings July 6, 2026 11:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a wheel-packaging failure caused by Hatchling adding the same files twice when [tool.hatch.build.targets.wheel.force-include] re-included the already-scanned src/gomc_rest/binaries/ directory. It switches to using Hatch’s artifacts mechanism so only the vendored, gitignored platform binary is conditionally included in the wheel without duplicating tracked files (e.g., README.md, .gitignore).

Changes:

  • Replace [tool.hatch.build.targets.wheel.force-include] with artifacts = ["src/gomc_rest/binaries/gomc-rest*"] to avoid duplicate wheel paths.
  • Update the inline comment to document why artifacts are used for gitignored, build-time-vendored binaries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Moge800 Moge800 merged commit 260bf4f into main Jul 6, 2026
3 checks passed
@Moge800 Moge800 deleted the claude/wizardly-allen-lnrqxf branch July 6, 2026 11:23
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.

3 participants