Commit Graph

558 Commits

Author SHA1 Message Date
Jonas Rembser
fa6a2e8f1f 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<ver>` wheel ABI tag in
`pythonABITags`) when `enableDebug` is true.

Reproducer for the problem as a bash script:

```bash
set -euo pipefail

nixpkgs="${1:-<nixpkgs>}" # Either custom path if provided, or just <nixpkgs>

read -r -d '' expr <<EOF || true
let
  pkgs = import ${nixpkgs} { };
  py = pkgs.python313FreeThreading.override {
    enableDebug = true;
    self = py;
    pythonAttr = "python313FreeThreading";
  };
in py
EOF

executable=$(nix-instantiate --eval --json --expr "($expr).executable" | tr -d '"')
echo "passthru.executable = ${executable}"

out=$(nix-build --no-out-link --expr "$expr")
echo "store path:           ${out}"

if [[ -e "${out}/bin/${executable}" ]]; then
  echo "result:               OK (binary exists)"
  exit 0
fi

echo "result:               FAIL (${out}/bin/${executable} not found)"
echo "actually installed:"
ls "${out}/bin/" | grep '^python3\.' | sed 's/^/  /'
exit 1
```
2026-06-03 13:22:42 +02:00
Nicolas Benes
cb40bc2538 pythonDocs: drop 3.10 2026-06-03 00:44:06 +02:00
Nicolas Benes
2f031afd37 pythonDocs: init at 3.14, add panicgh as maintainer 2026-06-03 00:40:09 +02:00
Aliaksandr
e6871d9800 python2: move cpython, mkPythonDerivation into resholve 2026-05-31 15:14:59 +03:00
Ethan Carter Edwards
0f11b5770b python3: set meta.donationPage
Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
2026-05-27 15:40:31 -07:00
Martin Weinelt
de92bac908 python315: 3.15.0a7 -> 3.15.0b1
https://docs.python.org/3.15/whatsnew/changelog.html#python-3-15-0-beta-1
2026-05-07 23:13:33 +02:00
Ihar Hrachyshka
b624ca79ab python: apply hacl patch unconditionally 2026-03-22 14:16:04 -04:00
Martin Weinelt
bbfd20b61d pkgsStatic.python314: fix build (#502058) 2026-03-22 13:11:33 +00:00
Ihar Hrachyshka
5e45722b67 pkgsStatic.python314: fix build 2026-03-21 19:12:33 -04:00
Lisanna Dettwyler
3887e60583 pythonDocs.html.python27: use https for sources
Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
2026-03-21 12:31:04 -04:00
Doron Behar
20a0e1b210 python3: propagate overrides of spliced pythons
This is a more accurate resurrection of what was meant to be done in
6421482683
2026-03-13 12:56:21 +02:00
Doron Behar
825a7f002c python3: avoid a small rec near passthruFun 2026-03-09 16:04:41 +02:00
Martin Weinelt
b79da2786f Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/bundlewrap/default.nix
	pkgs/development/python-modules/coverage/default.nix
	pkgs/development/python-modules/h5netcdf/default.nix
	pkgs/development/python-modules/hypothesis/default.nix
	pkgs/development/python-modules/numba/default.nix
	pkgs/development/python-modules/optype/default.nix
	pkgs/development/python-modules/setuptools-git-versioning/default.nix
	pkgs/development/python-modules/sphinx/default.nix
2026-02-15 16:17:41 +01:00
Martin Weinelt
8ea6bde88d treewide: prune pythonOlder 3.10/3.11
This is a post 3.10 removal cleanup.
2026-02-15 04:33:54 +01:00
Martin Weinelt
77ca080475 python310: drop
Reaches end of life before NixOS 26.05 and therefore has to leave early.
2026-02-15 03:17:23 +01:00
Doron Behar
6421482683 python3: let lib.mkScopeWithSplicing do its job
Fixes #476822 and #480467 . By itself this change doesn't trigger many
rebuilds, but it is easier to justify it in conjunction with the
previous commit.

Co-Authored-By: Colin <colin@uninsane.org>
2026-02-09 12:38:08 +02:00
quantenzitrone
55280fa564 various: rename references from libX11 to libx11
this shouldn't create any rebuilds
2026-02-06 00:24:34 +01:00
nixpkgs-ci[bot]
7d328d38a6 Merge staging-next into staging 2025-12-17 00:18:04 +00:00
Philip Taron
5658916132 python2: fix paths for structuredAttrs (#470566) 2025-12-16 21:41:53 +00:00
nixpkgs-ci[bot]
98b2b03bb4 Merge staging-next into staging 2025-12-15 12:10:12 +00:00
Ihar Hrachyshka
a269d900c4 treewide: remove remaining meta = with lib; 2025-12-14 15:16:00 -05:00
Stefan Frijters
b9195a7fb6 python2: fix paths for structuredAttrs
Without this, things like zlib are not found.
2025-12-14 00:53:58 +01:00
Wolfgang Walther
46c0c0eae7 Merge branch 'staging-next' into staging 2025-12-10 18:42:31 +01:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
nixpkgs-ci[bot]
06f61d8b32 Merge staging-next into staging 2025-12-07 00:20:08 +00:00
Audrey Dutcher
5f12790a4c python3: Fix cross compilation to FreeBSD
- autoreconf needs to be run if we patch configure.ac
- the patch lines need to be adjusted otherwise it applies wrong
2025-12-06 15:51:49 -07:00
Martin Weinelt
7b9787935a Revert "cpython: fix gh-142214 on 3.14.1"
This reverts commit 27dcfd3e04.

This was fixed in 3.14.2 and as such this patch application has become
obsolete.
2025-12-06 01:20:01 +01:00
Martin Weinelt
d7040cdaee Revert "cpython: fix gh-142218 on 3.13.10 and 3.14.1"
This reverts commit ae4f7fd1e9.

Fixed in 3.13.11 and 3.14.2 and as such obsoleted.
2025-12-06 01:20:00 +01:00
Martin Weinelt
27dcfd3e04 cpython: fix gh-142214 on 3.14.1
Fixes two regressions in dataclasses.
2025-12-05 16:24:33 +01:00
Martin Weinelt
ae4f7fd1e9 cpython: fix gh-142218 on 3.13.10 and 3.14.1
Fixes split table dictionary crash regression.
2025-12-05 02:40:35 +01:00
nixpkgs-ci[bot]
c522ea5070 Merge staging-next into staging 2025-10-28 18:06:54 +00:00
Aliaksandr
80f12557f5 treewide: replace "yes" else "no" usages to lib.boolToYesNo 2025-10-21 16:04:34 +03:00
nixpkgs-ci[bot]
a6b2560cff Merge staging-next into staging 2025-10-15 18:06:33 +00:00
nixpkgs-ci[bot]
003c57b969 Merge master into staging-next 2025-10-15 18:05:52 +00:00
Martin Weinelt
6785773052 python315: init add 3.15.0a1
https://docs.python.org/3.15/whatsnew/changelog.html#python-3-15-0-alpha-1
2025-10-15 18:01:30 +02:00
Luna Nova
e7fbed853b treewide: remove usages of obsolete pie hardening flag 2025-10-09 10:13:03 -07:00
nixpkgs-ci[bot]
a9361cb4df Merge staging-next into staging 2025-10-05 09:12:50 +00:00
Martin Weinelt
dd8ce7bda9 pythonInterpreters: Add passthru.pythonABITags (#445140) 2025-10-05 01:17:18 +00:00
nixpkgs-ci[bot]
e23d356469 Merge staging-next into staging 2025-10-05 00:18:23 +00:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
ghpzin
b95b6d641e python27: fix build with gcc15
- add " -std=gnu17" to `env.NIX_CFLAGS_COMPILE`

Fixes build failure with gcc15:
```
In file included from Include/Python-ast.h:3,
                 from Python/bltinmodule.c:4:
Include/asdl.h:9:15: error: cannot use keyword 'false' as enumeration constant
    9 | typedef enum {false, true} bool;
      |               ^~~~~
Include/asdl.h:9:15: note: 'false' is a keyword with '-std=c23' onwards
Include/asdl.h:9:28: error: expected ';', identifier or '(' before 'bool'
    9 | typedef enum {false, true} bool;
      |                            ^~~~
Include/asdl.h:9:28: warning: useless type name in empty declaration
In file included from Include/Python-ast.h:3,
                 from Python/compile.c:26:
Include/asdl.h:9:15: error: cannot use keyword 'false' as enumeration constant
    9 | typedef enum {false, true} bool;
      |               ^~~~~
Include/asdl.h:9:15: note: 'false' is a keyword with '-std=c23' onwards
Include/asdl.h:9:28: error: expected ';', identifier or '(' before 'bool'
    9 | typedef enum {false, true} bool;
      |                            ^~~~
```
2025-09-25 18:03:25 +03:00
adisbladis
3e6a5988c7 pythonInterpreters: Add passthru.pythonABITags
As documented in https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#abi-tag.

This is useful to check whether a wheel is compatible with a certain interpreter. [Pyproject.nix](https://github.com/pyproject-nix/pyproject.nix) has [functions to perform wheel compatibility checking](https://pyproject-nix.github.io/pyproject.nix/lib/pypa.html#function-library-lib.pypa.isWheelFileCompatible) against a Python interpreter, and has computed interpreter ABI tags itself.
The recent addition of free threading (`python313FreeThreading`) complicates this by not being introspectable:
A GIL Python (non free-threaded) has an ABI tag `cp313` while the free-threaded Python has `cp313t`, but the package doesn't communicate whether `enableGIL` is true or false, leaving no way to compute the tag.
The same goes for if debugging support was added to the derivation: A `d` suffix would need to be added.

Additionally ABI tags has no defined format and can really only be accurately computed by having insight into how the ABI tags are used by a specific interpreter, meaning that the only correct place to compute ABI tags is within the context of a particular Python derivation.

While this has no immediate use within nixpkgs it could be used as a basis to provide compatibility assertions regarding wheel compat at eval time.
2025-09-22 16:36:36 +12:00
Martin Weinelt
251d713d0c cpython: build with bluetooth support in default build
Closes: #341001
2025-08-30 14:48:04 +02:00
Martin Weinelt
bba34e2f19 cpython: remove x11support
This is required for tkinter, which we now build standalone as tkinter
in the python package set.
2025-08-30 14:28:10 +02:00
Martin Weinelt
168959b55b cpython: disable pie on aarch64-linux minimal
The intermediate pythonMinimal build that uses the glibc from bootstrap
files cannot currently be built with PIE, because the Scrt.o startup
script is missing in there.
2025-08-29 15:38:31 +02:00
Martin Weinelt
996d406da0 cpython: enable pie (#437366) 2025-08-28 23:55:16 +02:00
Martin Weinelt
38ba6fb329 cpython: enable pie 2025-08-24 00:02:49 +02:00
Martin Weinelt
4345a37636 python313: 3.13.6 -> 3.13.7
https://docs.python.org/release/3.13.7/whatsnew/changelog.html
2025-08-14 23:14:35 +02:00
Martin Weinelt
8dbf0b3423 cpython: remove libxcrypt on 3.13 and newer
The 3.13 release dropped support for the crypt module, so this dependency
could have been dropped much earlier.

Drops the `withLibxcrypt` argument, because manging the default has
become quite a bit more complicated.
2025-08-13 22:16:01 +02:00
Martin Weinelt
5f974fa39f python313: revert commit that locks ssl sockets
This breaks among other things the websockets package and is due to be
reverted in 3.13.7.
2025-08-10 00:06:16 +02:00