From 21f3c364997bb6498d7da8fec07e0611a0eacba9 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Wed, 3 Jun 2026 13:22:42 +0200 Subject: [PATCH] python3: include ABI debug suffix `d` in `executable` (fixes FT+debug) When instantiating an environment with the Python interpreter built with both free threading (aka. without GIL) and `pydebug`, the value of `passthru.executable` doesn't match any installed file. This was noticed when building CI pipelines that require the Python interpreter built with both debug features and free threading. The cause is that `executable` was built from `libPrefix`, which only tracks the `t` suffix from `--without-gil` and not the `d` suffix from `--with-pydebug`. `libPrefix` doubles as the stdlib install directory, and cpython deliberately shares that directory between debug and non-debug builds of a given version, so the `d` is intentionally absent there. This slipped through because cpython only ever installs a `python$VERSION -> python$LDVERSION` symlink (e.g. `python3.13 -> python3.13d`). For debug-only builds the old code happened to ask for `python3.13`, which is that symlink, so it worked by accident. For FT+debug, `libPrefix` is `python3.13t`, but cpython installs no such file; only `python3.13` (symlink) and `python3.13td` (binary). Fix: append `d` to `executable` (and to the `cp` wheel ABI tag in `pythonABITags`) when `enableDebug` is true. Reproducer for the problem as a bash script: ```bash set -euo pipefail nixpkgs="${1:-}" # Either custom path if provided, or just read -r -d '' expr <