From f5a4fee20bd9fec380f872c450b1f8dd9b5dca57 Mon Sep 17 00:00:00 2001 From: konsti Date: Mon, 2 Feb 2026 16:13:11 +0100 Subject: [PATCH] Fix wheel rejections on freethreading+debug builds (#17812) This is the minimal fix for https://github.com/astral-sh/uv/issues/17635. We still display the wheel without debug, but it unbreaks freethreading+debug in general. --- crates/uv-distribution-filename/src/wheel.rs | 9 +++++++++ crates/uv-platform-tags/src/abi_tag.rs | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/uv-distribution-filename/src/wheel.rs b/crates/uv-distribution-filename/src/wheel.rs index 19a11d3f4..7f7bcf465 100644 --- a/crates/uv-distribution-filename/src/wheel.rs +++ b/crates/uv-distribution-filename/src/wheel.rs @@ -470,4 +470,13 @@ mod tests { ).unwrap(); insta::assert_snapshot!(filename.cache_key(), @"1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9.0.1.2.1.2-80bf8598e9647cf7"); } + + /// Don't drop the freethreading tag when there is a debug tag. + #[test] + fn freethreading_debug() { + let filename = "correctionlib-2.8.0-cp314-cp314td-macosx_26_0_arm64.whl"; + let parsed = WheelFilename::from_str(filename).unwrap(); + // TODO(konsti): We should preserve the debug tag too, but that requires cache changes. + insta::assert_snapshot!(parsed.to_string(), @"correctionlib-2.8.0-cp314-cp314t-macosx_26_0_arm64.whl"); + } } diff --git a/crates/uv-platform-tags/src/abi_tag.rs b/crates/uv-platform-tags/src/abi_tag.rs index 816cac75b..e7e7e01aa 100644 --- a/crates/uv-platform-tags/src/abi_tag.rs +++ b/crates/uv-platform-tags/src/abi_tag.rs @@ -208,8 +208,10 @@ impl FromStr for AbiTag { // Ex) `cp39m`, `cp310t` let version_end = cp.find(|c: char| !c.is_ascii_digit()).unwrap_or(cp.len()); let version_str = &cp[..version_end]; + let abi_suffixes = &cp[version_end..]; let (major, minor) = parse_python_version(version_str, "CPython", s)?; - let gil_disabled = cp.ends_with('t'); + // TODO(konsti): Handle all ABI tags + let gil_disabled = abi_suffixes.contains('t'); Ok(Self::CPython { gil_disabled, python_version: (major, minor),