diff --git a/.github/workflows/test-legacy-python.yml b/.github/workflows/test-legacy-python.yml
new file mode 100644
index 000000000..0cdade670
--- /dev/null
+++ b/.github/workflows/test-legacy-python.yml
@@ -0,0 +1,130 @@
+name: Legacy Python Acceptance
+
+on:
+ pull_request:
+ paths:
+ - "crates/vx-providers/python/**"
+ - "crates/vx-providers/uv/**"
+ - "crates/vx-runtime/**"
+ - "crates/vx-runtime-http/**"
+ - "crates/vx-runtime-archive/**"
+ - "crates/vx-cache/**"
+ - "crates/vx-paths/**"
+ - "crates/vx-cli/**"
+ - "crates/vx-resolver/**"
+ - "crates/vx-starlark/**"
+ - "scripts/test_legacy_python.py"
+ - "scripts/tests/test_legacy_python_harness.py"
+ - "tests/fixtures/legacy-python-build/**"
+ - ".github/workflows/test-legacy-python.yml"
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: Build legacy acceptance VX (${{ matrix.platform }})
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - platform: linux-x64
+ os: ubuntu-24.04
+ binary: vx
+ - platform: windows-x64
+ os: windows-2025
+ binary: vx.exe
+ env:
+ CARGO_TERM_COLOR: always
+ RUSTC_WRAPPER: sccache
+ SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ - uses: ./.github/actions/setup-rust-sccache
+ with:
+ shared-key: legacy-python-build
+ - name: Bootstrap VX for build commands
+ uses: ./
+ with:
+ cache: "false"
+ setup: "false"
+ - name: Build this revision
+ run: vx cargo build --locked --profile dev-fast --bin vx
+ - uses: actions/upload-artifact@v7
+ with:
+ name: legacy-python-vx-${{ matrix.platform }}
+ path: target/dev-fast/${{ matrix.binary }}
+ if-no-files-found: error
+ retention-days: 3
+
+ acceptance:
+ name: Legacy Python 3.7 (${{ matrix.platform }})
+ needs: build
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - platform: linux-x64
+ os: ubuntu-24.04
+ binary: vx
+ - platform: windows-x64
+ os: windows-2025
+ binary: vx.exe
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ - uses: actions/download-artifact@v8
+ with:
+ name: legacy-python-vx-${{ matrix.platform }}
+ path: bin
+ - name: Make VX executable
+ if: runner.os != 'Windows'
+ run: chmod +x bin/vx
+ - name: Bootstrap modern harness interpreter
+ uses: ./
+ with:
+ tools: "python@3.12"
+ cache: "false"
+ setup: "false"
+ - name: Bind existing Windows compiler
+ if: runner.os == 'Windows'
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: x64
+ - name: Check acceptance guards
+ run: vx python@3.12 -m unittest discover -s scripts/tests -p test_legacy_python_harness.py
+ - name: Run isolated legacy acceptance
+ shell: bash
+ env:
+ VX_ACCEPTANCE_BINARY: ${{ github.workspace }}/bin/${{ matrix.binary }}
+ VX_ACCEPTANCE_ROOT: ${{ runner.temp }}/vx-legacy-python
+ VX_ACCEPTANCE_RECEIPT: ${{ github.workspace }}/legacy-python-receipt.json
+ VX_ACCEPTANCE_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
+ run: |
+ vx python@3.12 scripts/test_legacy_python.py \
+ --vx-binary "$VX_ACCEPTANCE_BINARY" \
+ --work-root "$VX_ACCEPTANCE_ROOT" \
+ --receipt "$VX_ACCEPTANCE_RECEIPT" \
+ --source-revision "$VX_ACCEPTANCE_SOURCE_SHA"
+ - name: Upload acceptance evidence
+ if: always()
+ uses: actions/upload-artifact@v7
+ with:
+ name: legacy-python-evidence-${{ matrix.platform }}
+ path: |
+ legacy-python-receipt.json
+ ${{ runner.temp }}/vx-legacy-python/run-*/logs
+ if-no-files-found: warn
+ retention-days: 14
diff --git a/Cargo.lock b/Cargo.lock
index bffb70410..655cdad21 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5218,12 +5218,14 @@ dependencies = [
"bzip2",
"flate2",
"futures-util",
+ "hex",
"indicatif",
"regex",
"reqwest",
"rstest",
"serde_json",
"sevenz-rust",
+ "sha2 0.11.0",
"tar",
"tempfile",
"tokio",
diff --git a/crates/vx-providers/python/provider.star b/crates/vx-providers/python/provider.star
index 4f2e9420f..40bcb7c7c 100644
--- a/crates/vx-providers/python/provider.star
+++ b/crates/vx-providers/python/provider.star
@@ -80,11 +80,35 @@ _PBS_TRIPLES = {
}
_LEGACY_37_ASSETS = {
- # python-build-standalone's 20200822 release predates the modern
- # cpython-{version}+{build_tag}-{triple}-install_only_stripped naming.
- "windows/x64": "cpython-3.7.9-x86_64-pc-windows-msvc-shared-pgo-20200823T0118.tar.zst",
- "macos/x64": "cpython-3.7.9-x86_64-apple-darwin-pgo-20200823T0123.tar.zst",
- "linux/x64": "cpython-3.7.9-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst",
+ # Fixed lifecycle catalog: release metadata must not select a different
+ # artifact after upstream stops publishing this Python line.
+ # Digests are VX intake pins of official HTTPS release assets; these old
+ # releases publish no checksums or signatures. They are not publisher hashes.
+ "windows/x64": {
+ "release": "20200822",
+ "asset": "cpython-3.7.9-x86_64-pc-windows-msvc-shared-pgo-20200823T0118.tar.zst",
+ "sha256": "8769a244cfe54c32c5253b78897a0fe82fe419dfde653b1afc3f5f20594cca89",
+ "asset_id": 24195911,
+ "size": 31429615,
+ "required_paths": ["Lib/site.py", "Lib/venv/__init__.py", "include/Python.h", "libs/python37.lib"],
+ },
+ "macos/x64": {
+ # The 20200822 build has an unwanted libintl.dylib dependency.
+ "release": "20200823",
+ "asset": "cpython-3.7.9-x86_64-apple-darwin-pgo-20200823T2228.tar.zst",
+ "sha256": "53657e7712cc7b24491fb1fc66dcc8f47a577fc77df137178746987ba4c5afb8",
+ "asset_id": 24211674,
+ "size": 26136896,
+ "required_paths": ["lib/python3.7/site.py", "lib/python3.7/venv/__init__.py", "include/python3.7m/Python.h", "lib/libpython3.7m.a", "lib/libpython3.7m.dylib"],
+ },
+ "linux/x64": {
+ "release": "20200822",
+ "asset": "cpython-3.7.9-x86_64-unknown-linux-gnu-pgo-20200823T0036.tar.zst",
+ "sha256": "c6d6256d13e929e77e7ee6e53470fe63ad19d173fee6d56bb1b2dbda67081543",
+ "asset_id": 24195897,
+ "size": 28357634,
+ "required_paths": ["lib/python3.7/site.py", "lib/python3.7/venv/__init__.py", "include/python3.7m/Python.h", "lib/libpython3.7m.a", "lib/libpython3.7m.so.1.0"],
+ },
}
_PYPY27_VERSION = "2.7.18"
@@ -102,12 +126,18 @@ def _pbs_triple(ctx):
def _platform_key(ctx):
return "{}/{}".format(ctx.platform.os, ctx.platform.arch)
-def _is_legacy_37(version, build_tag):
- return version == "3.7.9" and build_tag == "20200822"
-
def _is_pypy27(version):
return version == _PYPY27_VERSION
+def _legacy37_artifact(ctx, version):
+ if version != "3.7.9":
+ fail("Python {} has no pinned portable build; request Python 3.7.9 explicitly".format(version))
+ platform = _platform_key(ctx)
+ artifact = _LEGACY_37_ASSETS.get(platform)
+ if artifact == None:
+ fail("Python 3.7.9 portable build unavailable for {}; supported platforms: Windows x64, Linux x64, macOS x64".format(platform))
+ return artifact
+
# ---------------------------------------------------------------------------
# download_url — python-build-standalone asset
# ---------------------------------------------------------------------------
@@ -119,17 +149,16 @@ def download_url(ctx, version):
return None
return "https://downloads.python.org/pypy/{}".format(asset)
+ if version.startswith("3.7."):
+ artifact = _legacy37_artifact(ctx, version)
+ return github_asset_url("astral-sh", "python-build-standalone", artifact["release"], artifact["asset"])
+
triple = _pbs_triple(ctx)
if not triple:
return None
build_tag = ctx.version_date
if not build_tag:
return None
- if _is_legacy_37(version, build_tag):
- asset = _LEGACY_37_ASSETS.get(_platform_key(ctx))
- if not asset:
- return None
- return github_asset_url("astral-sh", "python-build-standalone", build_tag, asset)
asset = "cpython-{}+{}-{}-install_only_stripped.tar.gz".format(version, build_tag, triple)
return github_asset_url("astral-sh", "python-build-standalone", build_tag, asset)
@@ -157,9 +186,8 @@ def install_layout(ctx, version):
"executable_paths": exe_paths,
}
- if version == "3.7.9":
- if _LEGACY_37_ASSETS.get(_platform_key(ctx)) == None:
- return None
+ if version.startswith("3.7."):
+ artifact = _legacy37_artifact(ctx, version)
if ctx.platform.os == "windows":
exe_paths = ["python.exe"]
else:
@@ -168,6 +196,9 @@ def install_layout(ctx, version):
"type": "archive",
"strip_prefix": "python/install",
"executable_paths": exe_paths,
+ "required_paths": artifact["required_paths"],
+ "sha256": artifact["sha256"],
+ "mirror_urls": [],
}
# The python-build-standalone tarball has a top-level "python/" directory.
diff --git a/crates/vx-runtime-http/Cargo.toml b/crates/vx-runtime-http/Cargo.toml
index bfb07cb72..c275b2ecf 100644
--- a/crates/vx-runtime-http/Cargo.toml
+++ b/crates/vx-runtime-http/Cargo.toml
@@ -11,6 +11,8 @@ repository.workspace = true
async-trait = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
+sha2 = { workspace = true }
+hex = "0.4"
# Async runtime
tokio = { workspace = true, features = ["rt", "fs", "io-util", "process"] }
diff --git a/crates/vx-runtime-http/src/installer.rs b/crates/vx-runtime-http/src/installer.rs
index 5c6d39070..758f6228b 100644
--- a/crates/vx-runtime-http/src/installer.rs
+++ b/crates/vx-runtime-http/src/installer.rs
@@ -72,7 +72,12 @@ impl RealInstaller {
/// the GET response's Content-Disposition header or final redirected URL.
/// For APIs like Adoptium that use redirect chains (307 → 302 → CDN),
/// this saves ~3-5 seconds by eliminating the redundant HEAD round-trip.
- async fn download_and_detect_filename(&self, url: &str, dest: &Path) -> Result