Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/actions/harden-pip/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: Harden pip
description: >-
Install the security-fixed pip (26.2.2) from a hash-pinned wheel so that later
pip invocations do not fall back on the vendored certifi bundle that trusts the
compromised eMudhra/emSign intermediate CAs. The sha256 fragment guarantees the
bootstrap download's integrity even if the bootstrapping pip's trust store is
compromised. See https://github.com/NVIDIA/cuda-python/issues/3195 and
https://discuss.python.org/t/109576.

inputs:
python:
description: Python interpreter whose pip should be hardened (e.g. a venv's python).
default: python

runs:
using: composite
steps:
- name: Install hash-pinned pip 26.2.2
shell: bash --noprofile --norc -xeuo pipefail {0}
env:
HARDEN_PIP_PYTHON: ${{ inputs.python }}
run: |
"${HARDEN_PIP_PYTHON}" -m pip install \
"pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70"
10 changes: 8 additions & 2 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
# see https://github.com/actions/setup-python/issues/871
python-version: "3.12"

- name: Harden pip
uses: ./.github/actions/harden-pip

- name: Set up MSVC
if: ${{ startsWith(inputs.host-platform, 'win') }}
uses: ilammy/msvc-dev-cmd@v1 # TODO: ask admin to allow pinning commits
Expand Down Expand Up @@ -112,7 +115,7 @@ jobs:
if-no-files-found: error

- name: Build cuda.core wheel
uses: pypa/cibuildwheel@b3395e271a35f73dad77f21802abe9b986dfe299 # v4.3.1
uses: pypa/cibuildwheel@b9e566a2b284570af229f6c2a33673410d0389a3 # v4.3.4
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_ARCHS_LINUX: "native"
Expand Down Expand Up @@ -155,7 +158,7 @@ jobs:
cuda-version: ${{ inputs.cuda-version }}

- name: Build cuda.bindings wheel
uses: pypa/cibuildwheel@b3395e271a35f73dad77f21802abe9b986dfe299 # v4.3.1
uses: pypa/cibuildwheel@b9e566a2b284570af229f6c2a33673410d0389a3 # v4.3.4
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_ARCHS_LINUX: "native"
Expand Down Expand Up @@ -231,6 +234,9 @@ jobs:
# TODO: remove allow-prereleases once 3.15 is officially supported
allow-prereleases: ${{ startsWith(matrix.python-version, '3.15') }}

- name: Harden pip
uses: ./.github/actions/harden-pip

- name: verify free-threaded build
if: endsWith(matrix.python-verison, 't')
run: python -c 'import sys; assert not sys._is_gil_enabled()'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ jobs:

- name: Publish package distributions to PyPI
if: ${{ inputs.wheel-dst == 'pypi' }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3

- name: Publish package distributions to TestPyPI
if: ${{ inputs.wheel-dst == 'testpypi' }}
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
with:
repository-url: https://test.pypi.org/legacy/

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ jobs:
# we use self-hosted runners on which setup-python behaves weirdly...
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"

- name: Harden pip
uses: ./.github/actions/harden-pip

- name: Set up mini CTK
if: ${{ matrix.LOCAL_CTK == '1' }}
uses: ./.github/actions/fetch_ctk
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ jobs:
# TODO: remove allow-prereleases once 3.15 is officially supported
allow-prereleases: ${{ startsWith(matrix.PY_VER, '3.15') }}

- name: Harden pip
uses: ./.github/actions/harden-pip

- name: Verify LongPathsEnabled
run: |
$val = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled').LongPathsEnabled
Expand Down
Loading