diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad75552..4259ff7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,6 +65,25 @@ jobs: - name: Build Package run: uv build + - name: Verify the codeanalyzer JAR is bundled + # Guard against the hatchling/.gitignore regression (issue #284): a jarless wheel + # installs fine but fails at runtime with "codeanalyzer jar not found". Fail the + # release here rather than publish a broken artifact to PyPI. + run: | + set -euo pipefail + jar_re='codeanalyzer/jar/codeanalyzer-[0-9][^/]*\.jar$' + ok=1 + for f in dist/*.whl; do + unzip -l "$f" | grep -qE "$jar_re" || { echo "::error::$f is missing the codeanalyzer JAR"; ok=0; } + done + for f in dist/*.tar.gz; do + tar tzf "$f" | grep -qE "$jar_re" || { echo "::error::$f is missing the codeanalyzer JAR"; ok=0; } + done + if [ "$ok" -ne 1 ]; then + echo "Refusing to publish a jarless release."; exit 1 + fi + echo "codeanalyzer JAR present in wheel and sdist ✓" + - name: Read Changelog Entry id: changelog_reader uses: mindsers/changelog-reader-action@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 20787d8..ac161a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- **Published wheels bundle the `codeanalyzer-java` JAR again.** Every hatchling-built wheel/sdist + since v1.2.0 shipped without the JAR, so `pip install cldk` + `CLDK.java(...)` raised + `CodeanalyzerExecutionException: codeanalyzer jar not found`. The root `.gitignore` `*.jar` rule + was applied at build time while the nested `!codeanalyzer-*.jar` negation (which keeps the JAR in + git) was not honored, silently dropping the JAR from any build run inside a git repo — i.e. CI. A + `[tool.hatch.build] artifacts` rule force-includes it, and the release workflow now fails if a + built artifact is missing the JAR. (#284) + ## [v1.4.3] - 2026-07-14 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 86bff92..8f9b381 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,13 @@ test = [ requires = ["hatchling"] build-backend = "hatchling.build" +# The codeanalyzer-java JAR is force-included here: it lives under a `*.jar` .gitignore +# (re-included for git via a nested `!codeanalyzer-*.jar`), but hatchling honors the root +# ignore and not the nested negation, so without this it is silently dropped from every +# wheel/sdist built inside a git repo (i.e. in CI). See issue #284. +[tool.hatch.build] +artifacts = ["cldk/analysis/java/codeanalyzer/jar/*.jar"] + [tool.hatch.build.targets.wheel] packages = ["cldk"]