Uh oh!
There was an error while loading. Please reload this page.
fix: bundle codeanalyzer-java JAR in published wheels (#284) - #285
Merged
Conversation
Hatchling applied the root .gitignore `*.jar` rule at build time but did not honor the nested `!codeanalyzer-*.jar` negation that keeps the JAR tracked in git, so every wheel/sdist built inside a git repo (CI) silently dropped the JAR. Published wheels since v1.2.0 were jarless, making `CLDK.java(...)` fail with "codeanalyzer jar not found" after a plain `pip install cldk`. Force-include the JAR via `[tool.hatch.build] artifacts`, and add a release guard that fails before publishing if a built artifact is missing the JAR.
This was referenced Jul 22, 2026
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#284.
Problem
Every hatchling-built wheel/sdist since v1.2.0 ships without the bundled
codeanalyzer-javaJAR. After a plainpip install cldk,CLDK.java(...)fails at runtime withCodeanalyzerExecutionException: codeanalyzer jar not found. Verified on PyPI — 1.4.0–1.4.3 and2.0.0rc1 wheels are all ~176 KB (jarless); the setuptools-era wheels (≤ 1.1.3) were 26–56 MB.
Root cause
.gitignorehas*.jar; the nestedcldk/analysis/java/codeanalyzer/jar/.gitignorere-includes the JAR with
!codeanalyzer-*.jar. git honors that negation (the JAR is trackedin every tag); hatchling applies the root
*.jarat build time but does not honor thenested negation, so it drops the JAR.
.gitignoreexclusion when a.gitdir is present — which CI has — so agit archive/source-tarball build keeps the JAR while the CI build drops it. That false negativehid the bug for 5 releases.
release.ymlalready injects the JAR beforeuv build; hatchling discarded it anyway.Fix
pyproject.toml:[tool.hatch.build] artifacts = ["cldk/analysis/java/codeanalyzer/jar/*.jar"]force-includes the VCS-ignored JAR in both wheel and sdist.
release.yml: a "Verify the codeanalyzer JAR is bundled" step fails the release beforepublishing if any built artifact is missing the JAR — so this can never silently regress again.
Verification
Built in the real repo (has
.git→ CI condition):Both wheel and sdist now contain the JAR; the guard grep passes on both.
Follow-up
1.4.3 is already published jarless and cannot be re-uploaded — this needs a 1.4.4 release cut
after merge.