Author: ivan
Date: Thu Jun 25 16:24:09 2026
New Revision: 1935637

Log:
GHA: Provide Python3_ROOT_DIR in CMake configure to explicitly specify which
Python version to use.

Sugggested by: brane

* .github/workflows/cmake.yml
  (Set platform-specific values): New. Capture Python's sys.executable to
   step output `python_root`.
  (Configure CMake): Set Python3_ROOT_DIR to
   steps.platform.outputs.python_root. Also set Python3_FIND_UNVERSIONED_NAMES
   to FIRST to prefer searching 'python' instead 'python3': we use 'python'
   in this GHA workflow.

Modified:
   subversion/trunk/.github/workflows/cmake.yml

Modified: subversion/trunk/.github/workflows/cmake.yml
==============================================================================
--- subversion/trunk/.github/workflows/cmake.yml        Thu Jun 25 15:40:23 
2026        (r1935636)
+++ subversion/trunk/.github/workflows/cmake.yml        Thu Jun 25 16:24:09 
2026        (r1935637)
@@ -186,6 +186,12 @@ jobs:
         if: runner.os == 'macOS'
         run: python -m pip -v --disable-pip-version-check install lxml==6.1.0 
rnc2rng==2.7.0
 
+      - name: Set platform-specific values
+        id: platform
+        run: |
+          $PYTHON_ROOT=$(python -c 'import pathlib, sys; 
print(str(pathlib.Path(sys.executable).resolve().parent.parent))')
+          "python_root=$PYTHON_ROOT" >> "$env:GITHUB_OUTPUT"
+
       - name: Use LF for Git checkout
         run: |
           git config --global core.autocrlf false
@@ -208,8 +214,10 @@ jobs:
           -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/installdir
           -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }}
           -DSVN_TEST_CONFIGURE_FOR_PARALLEL=ON
+          -DPython3_ROOT_DIR="${{ steps.platform.outputs.python_root }}"
           -DPython3_FIND_REGISTRY=NEVER
           -DPython3_FIND_STRATEGY=LOCATION
+          -DPython3_FIND_UNVERSIONED_NAMES=FIRST
           ${{ matrix.extra_config_opts }}
 
       - name: Build CMake

Reply via email to