build(cmake): fail fast with clear diagnostic when .venv has no pip - #14784
Conversation
A hand-rolled 'uv venv' (without --seed) creates a pip-less venv. QGC reuses it and configure later dies inside the mavlink CPM build with an opaque 'Python pip not found' error. Detect the missing pip up front and fail with instructions instead. Replaces mavlink#14767, which auto-bootstrapped pip via ensurepip; a read-only diagnostic avoids CMake silently mutating a user-managed venv.
ac2f223 to
b33e157
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
cmake/modules/PythonVenv.cmake:27
- The recreation fallback is not portable:
rm -rfdoes not work in Windowscmd(or as written in Windows PowerShell), and both relative paths refer to the caller's working directory rather thanCMAKE_SOURCE_DIRin an out-of-tree configure. Since this diagnostic runs on every platform, use platform-neutral deletion wording and print the source-qualified setup command.
" rm -rf .venv && python tools/setup/install_python.py scripts")
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14784 +/- ##
==========================================
+ Coverage 25.47% 32.72% +7.25%
==========================================
Files 769 784 +15
Lines 65912 67602 +1690
Branches 30495 31311 +816
==========================================
+ Hits 16788 22121 +5333
+ Misses 37285 30595 -6690
- Partials 11839 14886 +3047
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 37 passed, 0 skipped Code CoverageCoverage: 69.5% No baseline available for comparison Artifact Sizes
Updated: 2026-08-08 18:39:51 UTC • Commit: b33e157 • Triggered by: Android |
Description
A hand-rolled
uv venv(the default, without--seed) creates a pip-less.venv. QGC reuses an existing.venvas-is, so configure later fails deep inside the mavlink CPM build with an opaquePython pip not found, pip is requirederror that gives no hint the problem is the local venv.This adds a read-only check in
PythonVenv.cmakeat both venv-use sites: if the venv interpreter has no pip, configure fails immediately with an actionable message (python -m ensurepip --upgrade, or delete.venvand reconfigure so QGC recreates it with pip seeded viauv venv --seed).Replaces #14767, which bootstrapped pip automatically via
ensurepip. A diagnostic was preferred over auto-mutation: CMake shouldn't silently install packages into a venv the user manages by hand, andensurepipitself can be unavailable (e.g. Debian withoutpython3-venv), which would turn the auto-fix into a different opaque failure. Credit to @bytesByHarsh for identifying the problem.Testing
Verified with
cmake -Pagainst both shapes:.venv→ check passes silentlyType of Change
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).