From 2ddffbb94006574c80f8c09fff6f080797721078 Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Fri, 4 Oct 2024 17:47:38 +0900 Subject: [PATCH 1/6] Attempt to workaround venv failure in Actions runner 20240929.1. --- .github/workflows/windows.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4c8bc76254..bec3d749a3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -231,6 +231,12 @@ jobs: with: python-version: '3.11.4' + # Without this, venv stopped working in 20240929.1 runner. + - name: Activate virtualenv + run: | + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + - name: Init CTS submodule if: matrix.options.tools_cts =='ON' run: From e00db284af585789503807b90b132c96f534bb2f Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Fri, 4 Oct 2024 17:50:52 +0900 Subject: [PATCH 2/6] Only run venv setup if Python enabled. --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bec3d749a3..9ba0f125c9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -233,6 +233,7 @@ jobs: # Without this, venv stopped working in 20240929.1 runner. - name: Activate virtualenv + if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' run: | . .venv/bin/activate echo PATH=$PATH >> $GITHUB_ENV From 4cf05283b8f752db69f31bd0a3d7a7fb9815c550 Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Fri, 4 Oct 2024 18:30:48 +0900 Subject: [PATCH 3/6] Try installing virtualenv. --- .github/workflows/windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9ba0f125c9..5ab21f0de6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -232,11 +232,11 @@ jobs: python-version: '3.11.4' # Without this, venv stopped working in 20240929.1 runner. - - name: Activate virtualenv + - name: Install Python virtualenv if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' - run: | - . .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV + run: pipx install virtualenv + # . .venv/bin/activate + # echo PATH=$PATH >> $GITHUB_ENV - name: Init CTS submodule if: matrix.options.tools_cts =='ON' From 83785e047bad58268356b78eb8c1e37159ebe5c5 Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Mon, 7 Oct 2024 17:04:25 +0900 Subject: [PATCH 4/6] Try running venv activate and passing PATH in GITHUB_ENV. --- .github/workflows/windows.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5ab21f0de6..d66bd071e3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -234,9 +234,13 @@ jobs: # Without this, venv stopped working in 20240929.1 runner. - name: Install Python virtualenv if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' - run: pipx install virtualenv - # . .venv/bin/activate - # echo PATH=$PATH >> $GITHUB_ENV + run: | + echo $env:PATH + pipx install virtualenv + echo $env:PATH + . .venv/bin/activate + echo $env:PATH + echo $env:PATH >> $GITHUB_ENV - name: Init CTS submodule if: matrix.options.tools_cts =='ON' From cce2b1b6b77b5a5d3471c5d19294339631e1b0b9 Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Tue, 8 Oct 2024 15:52:58 +0900 Subject: [PATCH 5/6] Try pip instead of pipx. --- .github/workflows/windows.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d66bd071e3..1c83d43dbf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -234,13 +234,7 @@ jobs: # Without this, venv stopped working in 20240929.1 runner. - name: Install Python virtualenv if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' - run: | - echo $env:PATH - pipx install virtualenv - echo $env:PATH - . .venv/bin/activate - echo $env:PATH - echo $env:PATH >> $GITHUB_ENV + run: pip install virtualenv - name: Init CTS submodule if: matrix.options.tools_cts =='ON' From 06461270fb70678f44dee0ea6e29b04410325d88 Mon Sep 17 00:00:00 2001 From: Mark Callow Date: Wed, 9 Oct 2024 14:52:33 +0900 Subject: [PATCH 6/6] Add explanatory comments. --- .github/workflows/windows.yml | 7 ++++++- interface/python_binding/CMakeLists.txt | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1c83d43dbf..a30337e12d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -231,7 +231,12 @@ jobs: with: python-version: '3.11.4' - # Without this, venv stopped working in 20240929.1 runner. + # virtualenv is no longer included as of 20240929.1 runner so + # install it ourselves. See + # https://github.com/actions/runner-images/issues/10749. + # + # Note that it is the builds of sdist and wheel that require virtualenv + # not the explicit dependencies of pyktx. - name: Install Python virtualenv if: matrix.options.py == 'ON' && matrix.check_mkvk != 'ONLY' run: pip install virtualenv diff --git a/interface/python_binding/CMakeLists.txt b/interface/python_binding/CMakeLists.txt index b2c4051434..1f26c8a198 100644 --- a/interface/python_binding/CMakeLists.txt +++ b/interface/python_binding/CMakeLists.txt @@ -88,6 +88,8 @@ add_custom_command( LIBKTX_INCLUDE_DIR=${CMAKE_SOURCE_DIR}/include LIBKTX_LIB_DIR=${LIBKTX_LIB_DIR} LIBKTX_VERSION=${KTX_VERSION_NORMALIZED} + # Bulding sdist requires a virtual env. I have not found a + # a way via find_package to ensure venv support is installed. ${PYTHON_EXECUTABLE} -m build --sdist --outdir ${DIST_DIR} WORKING_DIRECTORY ${SOURCE_DIR} @@ -103,6 +105,7 @@ add_custom_command( LIBKTX_INCLUDE_DIR=${CMAKE_SOURCE_DIR}/include LIBKTX_LIB_DIR=${LIBKTX_LIB_DIR} LIBKTX_VERSION=${KTX_VERSION_NORMALIZED} + # Ditto with sdist venv comment. ${PYTHON_EXECUTABLE} -m build --wheel --outdir ${DIST_DIR} WORKING_DIRECTORY ${SOURCE_DIR}