Skip to content

Fix Python packaging dependency detection - #132

Merged
ip332 merged 1 commit into
mainfrom
fix/88-python-packaging-detection
Nov 22, 2026
Merged

ip332 merged 1 commit into
mainfrom
fix/88-python-packaging-detection

Conversation

@ip332

@ip332 ip332 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #88

CMake's import build, setuptools accepted the repository's empty build/ namespace directory as the Python build frontend. Both optional integration tests were consequently registered even though python -m build could not execute.

The probe now imports build.__main__ and setuptools using the selected QUARRY_PYTHON3_EXECUTABLE, from the tests' fixed binary directory. This checks the entry point the tests actually need and rejects an empty namespace regardless of configure invocation directory. Isolated mode was evaluated and intentionally avoided: on the native host it hides genuine installed user-site dependencies. A directory change alone is insufficient, so the regression also places an empty build namespace in the fixed probe directory.

The Python packaging test's two build invocations now run from its clean temporary root. The public-example build invocation already uses a clean temporary root and needs no change. Existing interpreter selection, presets and optional-dependency skip diagnostics remain intact. Linux CI explicitly checks that the dependency regression, packaging test and public-example test are registered before running CTest, so its installed release-validation dependencies cannot silently lose coverage.

Regression and validation

  • Verified baseline: PR Fix record-index misuse in generic runtime conformance #131 squash merge 33b033e14c1396b2e528f766773ee1ab1929cc76, generic_runtime_conformance_test ValidFixture fails with Clang 18 on Linux #85 closed, and all five jobs in post-merge CI passed before implementation.
  • Controlled disposable venvs have genuine copied setuptools but no build frontend; neither primary interpreter nor its installed packages is modified. From a directory containing empty build/, the old probe exits 0 while python -m build --version exits 1.
  • The maintained regression configures the real project and inspects CTest JSON for absent/installed dependencies from both the repository root and an out-of-source directory. It reuses the existing googletest source in CI and needs no network or extra package installation.
  • Before the correction, that regression fails at the intended registration assertion: both integration tests are registered for the dependency-missing interpreter. Afterward, all four cases pass. Genuine dependencies register both tests using the explicitly selected interpreter.
  • macOS Python 3.14.7, build 1.6.1, setuptools 84.0.0: dependency regression, packaging and public-example execution pass. Focused CTest: regression 18.69 s, packaging 25.25 s, examples 57.38 s.
  • macOS Python 3.9.6 in a disposable venv, build 1.4.4, setuptools 82.0.1: both registration locations, packaging and public-example execution pass, including all five truck variants.

Exact committed head: 945730e89a290994438d91d381c9d8d87d604d38.

scripts/quarry-validate validate HEAD passed 74/74 native CTests on this exact head (CTest 746.42 s; total validation 773.7 s, two build/test slots). The dependency regression passed in 15.28 s in that run, with no packaging or public-example skip. The receipt matches HEAD, result pass, fingerprint b7f585657bf5daa66bdab10be82e525d12d64a6102147de836fa5292a6dbbd39. Configured pre-commit YAML/whitespace hooks and git diff --check passed. Delivery uses scripts/quarry-validate push with hooks enabled. Exact-head Linux CI passed all applicable jobs: Linux GCC Build and test, clang-tidy, Coverage baseline, and Cortex-M Cross Build. Benchmarks retained its existing PR-policy skip.

  • Ubuntu 24.04 / Python 3.12.3: 74/74 full GCC CTests (330.67 s), including dependency regression 3.82 s, packaging 7.39 s and public examples 14.52 s. The explicit CI registration guard passed before execution.
  • Coverage: 69/69 CTests (235.41 s), including the dependency regression and packaging test; baseline guard passed.
  • The five-language interoperability matrix passed under GCC and Clang 18. Clang 18 generic conformance passed 2/2 Debug CTests and 2/2 ASan/UBSan CTests with checked libstdc++; GCC LTO validation passed.
  • Cortex-M build and footprint/machine-code comparisons passed.

The exact-head receipt remains valid after the hooked push. PR is ready for independent review; auto-merge remains disabled.

Existing optional extended G4 cases are skipped because no second/older generator build is supplied; two Python/Go include-path cases are inapplicable to those languages. Their regular import and five-language interoperability tests execute. No packaging coverage is skipped in the installed-dependency environments.

Only test registration, test invocation isolation, regression coverage and CI coverage checks change. No compiler/runtime serialization, BRF/QBS/IR, record allocation, schema_id, generated-code identity/naming, APIs or epochs change. #90, #119, #129, #130 and Stage B remain untouched; unrelated artifacts and the experimental branch are preserved. No release publication/tag or #105 work. Auto-merge stays disabled; do not merge automatically.

@ip332 ip332 added this to the v0.1.31-rc.1 milestone Nov 22, 2026 — with ChatGPT Codex Connector
@ip332 ip332 added bug Something isn't working area: build CMake, CI, hooks and developer workflow area: tests Test suites, fixtures and conformance matrices labels Nov 22, 2026 — with ChatGPT Codex Connector
@ip332
ip332 marked this pull request as ready for review November 22, 2026 15:52

@ip332 ip332 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Independent technical review: GO / approved for squash merge at exact head 945730e89a290994438d91d381c9d8d87d604d38.

Reviewed the full four-file patch. The CMake probe now checks build.__main__ with the configured interpreter from a fixed binary directory instead of treating an empty local build/ namespace as the installed packaging frontend. The Python packaging runner builds from temporary working directories; the existing public-example runner already does so. The new regression exercises the actual CMake/CTest registration for missing and installed dependencies, with shadow build/ directories in both caller and probe locations; Linux CI explicitly guards that packaging, dependency regression and public examples remain registered.

Verified exact-head workflow 45036263480 completed successfully: Linux Build and test 74/74, coverage baseline 69/69, clang-tidy and Cortex-M passed; benchmarks skipped by normal PR policy. Reported Python 3.9.6, 3.12.3 and 3.14.7 coverage, Clang 18 Debug/sanitizer conformance and five-language interop are consistent with the submitted evidence. No merge-blocking finding. This change is limited to test infrastructure, with no production wire/API/identity behavior changes.

Recommend squash merge at the reviewed SHA, then verify #88 closes and post-merge CI is green before release-gate #105. Follow-ups #129/#130 still need explicit release dispositions; do not infer a public release authorization from this review. Recorded as a positive technical-review COMMENT because the connected account is the PR author. No merge performed.

@ip332
ip332 merged commit 7e38073 into main Nov 22, 2026
5 checks passed
@ip332
ip332 deleted the fix/88-python-packaging-detection branch November 22, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build CMake, CI, hooks and developer workflow area: tests Test suites, fixtures and conformance matrices bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python packaging detection in tests/CMakeLists.txt can report a false positive

1 participant