mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 14:51:15 +08:00
7be68c5ebc
The MacOS build job calls actions/setup-python before running Tools/setup/macos.sh, which creates a venv at .venv and installs all of PX4's Python deps (kconfiglib, empy, etc.) there. setup-python exports Python3_ROOT_DIR / Python_ROOT_DIR / pythonLocation pointing at the hostedtoolcache interpreter, and find_package(Python3) honours those hints over PATH search even with FIND_STRATEGY=LOCATION. Adding .venv/bin to GITHUB_PATH was therefore not enough -- cmake kept selecting /Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin/python3.10, which has no kconfiglib, and configure failed at cmake/kconfig.cmake's import probe. Override Python3_ROOT_DIR / Python_ROOT_DIR / pythonLocation to the .venv and export VIRTUAL_ENV so Python3_FIND_VIRTUALENV=FIRST kicks in, making the venv interpreter the one cmake picks up. Signed-off-by: Nuno Marques <n.marques21@hotmail.com>