Skip to content

Commit d4f1f53

Browse files
committed
Fix Python and Conan versions for sigstore signing on CentOS 7
The sigstore action requires Python 3.9+ and looks for 'python' (not 'python3'). On CentOS 7 (vfx2021 and vfx2022), the system Python is 3.7.9 and Conan is 1.47.0, both too old. Solution: 1. Add ~/.local/bin to PATH early (before all setup steps) 2. Install Python 3.11 using uv with --default flag to create python, python3, and python3.11 symlinks in ~/.local/bin 3. Install Conan manually for CentOS 7 using python3.11 -m pip install --user to place it in ~/.local/bin 4. Keep get-conan action for other platforms With ~/.local/bin first in PATH, all tools (uv, python 3.11, conan 2.x) are found before old system versions, ensuring: - Sigstore finds Python 3.11 as 'python' - Builds use Conan 2.10.3 instead of system Conan 1.47.0 Signed-off-by: Gary Oberbrunner <[email protected]>
1 parent 2dfdaee commit d4f1f53

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ jobs:
189189
fi
190190
echo "RELEASE_NAME=${RELEASE_PREFIX}-${REF_SUFFIX}${OPENGL_BUILD}" >> $GITHUB_ENV
191191
192+
# Ensure ~/.local/bin is first in PATH for all local tools (uv, python, pip, conan)
193+
# This is especially important for old CentOS 7 containers with old system versions
194+
- name: Fix PATH for local tools
195+
run: |
196+
echo "$HOME/.local/bin" >> $GITHUB_PATH
197+
192198
- name: Set up python 3.11
193199
uses: actions/setup-python@v5
194200
if: matrix.ostype == 'mac'
@@ -199,35 +205,34 @@ jobs:
199205
# Unfortunately astral-sh/setup-uv action doesn't work on CentOS 7, its GLIBC is too old.
200206

201207
- name: Set up uv manually
202-
if: matrix.release_prefix == 'linux-vfx2021'
208+
if: matrix.vfx-cy == 2021 || matrix.vfx-cy == 2022
203209
run: |
204210
curl -LsSf https://astral.sh/uv/install.sh | sh
205-
source ~/.local/bin/env
206-
echo After sourcing uv env: "$PATH"
207-
uv python install --preview 3.11
208-
209-
# Python is in $(uv python dir)/cpython-*/bin
210-
# uv also installs a symlink in $HOME/.local/bin but because
211-
# that is only a symlink, it causes problems with pip and venv.
212-
# As a workaround, prepend the actual bin dir to $PATH.
213-
uv_python_dir="$(uv python dir)"
214-
uv_cpython_name="$(/bin/ls -1 $uv_python_dir)"
215-
uv_python_path="$uv_python_dir/$uv_cpython_name/bin"
216-
PATH="$uv_python_path":$PATH
217-
# Prepend to path for future steps (note: don't use $GITHUB_ENV here)
218-
echo "$uv_python_path" >> $GITHUB_PATH
211+
# No need to source env - we already added ~/.local/bin to PATH above
212+
213+
# Use --default to create python/python3 symlinks in ~/.local/bin
214+
# This ensures the sigstore action can find 'python' (not just 'python3')
215+
~/.local/bin/uv python install --default 3.11
219216
220217
- name: Check python, uv paths
221218
run: |
222-
echo $PATH
223-
echo -n 'which python: ' && which python
224-
echo -n 'which python3: ' && which python3
225-
echo -n 'python version: ' && python --version
226-
echo -n 'python3 version: ' && python3 --version
227-
echo -n 'which uv: ' && (which uv || echo "No python uv; continuing")
219+
echo "PATH=$PATH"
220+
echo -n 'which python: ' && which python && python --version
221+
echo -n 'which python3: ' && which python3 && python3 --version
222+
echo -n 'python symlink target: ' && (readlink -f $(which python) || echo "not a symlink")
223+
echo -n 'which uv: ' && (which uv || echo "No uv; continuing")
224+
225+
# Install Conan manually for old CentOS 7 using uv-installed Python
226+
# The get-conan action doesn't know about uv Python and would use system Python
227+
- name: Install Conan manually (CentOS 7)
228+
if: matrix.vfx-cy == 2021 || matrix.vfx-cy == 2022
229+
run: |
230+
python3.11 -m pip install --user conan==${{ matrix.conan_version }}
228231
232+
# Use get-conan action for other platforms
229233
- name: Install Conan
230234
id: conan
235+
if: matrix.vfx-cy != 2021 && matrix.vfx-cy != 2022
231236
uses: turtlebrowser/get-conan@main
232237
with:
233238
version: ${{ matrix.conan_version }}

0 commit comments

Comments
 (0)