Skip to content

Commit a03f275

Browse files
committed
staging-next 2025-05-30 (#412425)
2 parents 2e32e68 + d98bfd6 commit a03f275

File tree

1,040 files changed

+14877
-9053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,040 files changed

+14877
-9053
lines changed

doc/hooks/versionCheckHook.section.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ The variables that this phase control are:
3333
- `dontVersionCheck`: Disable adding this hook to the [`preInstallCheckHooks`](#ssec-installCheck-phase). Useful if you do want to load the bash functions of the hook, but run them differently.
3434
- `versionCheckProgram`: The full path to the program that should print the `${version}` string. Defaults roughly to `${placeholder "out"}/bin/${pname}`. Using `$out` in the value of this variable won't work, as environment variables from this variable are not expanded by the hook. Hence using `placeholder` is unavoidable.
3535
- `versionCheckProgramArg`: The argument that needs to be passed to `versionCheckProgram`. If undefined the hook tries first `--help` and then `--version`. Examples: `version`, `-V`, `-v`.
36+
- `versionCheckKeepEnvironment`: A list of environment variables to keep and pass to the command. Only those variables should be added to this list that are actually required for the version command to work. If it is not feasible to explicitly list all these environment variables you can set this parameter to the special value `"*"` to disable the `--ignore-environment` flag and thus keep all environment variables.
3637
- `preVersionCheck`: A hook to run before the check is done.
3738
- `postVersionCheck`: A hook to run after the check is done.
3839

doc/languages-frameworks/python.section.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ sets are
6161
and the aliases
6262

6363
* `pkgs.python2Packages` pointing to `pkgs.python27Packages`
64-
* `pkgs.python3Packages` pointing to `pkgs.python312Packages`
64+
* `pkgs.python3Packages` pointing to `pkgs.python313Packages`
6565
* `pkgs.pythonPackages` pointing to `pkgs.python2Packages`
6666
* `pkgs.pypy2Packages` pointing to `pkgs.pypy27Packages`
6767
* `pkgs.pypy3Packages` pointing to `pkgs.pypy310Packages`
@@ -582,9 +582,9 @@ are used in [`buildPythonPackage`](#buildpythonpackage-function).
582582

583583
Several versions of the Python interpreter are available on Nix, as well as a
584584
high amount of packages. The attribute `python3` refers to the default
585-
interpreter, which is currently CPython 3.12. The attribute `python` refers to
585+
interpreter, which is currently CPython 3.13. The attribute `python` refers to
586586
CPython 2.7 for backwards-compatibility. It is also possible to refer to
587-
specific versions, e.g. `python312` refers to CPython 3.12, and `pypy` refers to
587+
specific versions, e.g. `python313` refers to CPython 3.13, and `pypy` refers to
588588
the default PyPy interpreter.
589589

590590
Python is used a lot, and in different ways. This affects also how it is
@@ -600,10 +600,10 @@ however, are in separate sets, with one set per interpreter version.
600600
The interpreters have several common attributes. One of these attributes is
601601
`pkgs`, which is a package set of Python libraries for this specific
602602
interpreter. E.g., the `toolz` package corresponding to the default interpreter
603-
is `python3.pkgs.toolz`, and the CPython 3.12 version is `python312.pkgs.toolz`.
603+
is `python3.pkgs.toolz`, and the CPython 3.13 version is `python313.pkgs.toolz`.
604604
The main package set contains aliases to these package sets, e.g.
605-
`pythonPackages` refers to `python.pkgs` and `python312Packages` to
606-
`python312.pkgs`.
605+
`pythonPackages` refers to `python.pkgs` and `python313Packages` to
606+
`python313.pkgs`.
607607

608608
#### Installing Python and packages {#installing-python-and-packages}
609609

@@ -628,7 +628,7 @@ with [`python.buildEnv`](#python.buildenv-function) or [`python.withPackages`](#
628628
executables are wrapped to be able to find each other and all of the modules.
629629

630630
In the following examples we will start by creating a simple, ad-hoc environment
631-
with a nix-shell that has `numpy` and `toolz` in Python 3.12; then we will create
631+
with a nix-shell that has `numpy` and `toolz` in Python 3.13; then we will create
632632
a re-usable environment in a single-file Python script; then we will create a
633633
full Python environment for development with this same environment.
634634

@@ -644,18 +644,18 @@ temporary shell session with a Python and a *precise* list of packages (plus
644644
their runtime dependencies), with no other Python packages in the Python
645645
interpreter's scope.
646646

647-
To create a Python 3.12 session with `numpy` and `toolz` available, run:
647+
To create a Python 3.13 session with `numpy` and `toolz` available, run:
648648

649649
```sh
650-
$ nix-shell -p 'python312.withPackages(ps: with ps; [ numpy toolz ])'
650+
$ nix-shell -p 'python313.withPackages(ps: with ps; [ numpy toolz ])'
651651
```
652652

653653
By default `nix-shell` will start a `bash` session with this interpreter in our
654654
`PATH`, so if we then run:
655655

656656
```Python console
657657
[nix-shell:~/src/nixpkgs]$ python3
658-
Python 3.12.4 (main, Jun 6 2024, 18:26:44) [GCC 13.3.0] on linux
658+
Python 3.13.3 (main, Apr 8 2025, 13:54:08) [GCC 14.2.1 20250322] on linux
659659
Type "help", "copyright", "credits" or "license" for more information.
660660
>>> import numpy; import toolz
661661
```
@@ -675,8 +675,8 @@ will still get 1 wrapped Python interpreter. We can start the interpreter
675675
directly like so:
676676

677677
```sh
678-
$ nix-shell -p "python312.withPackages (ps: with ps; [ numpy toolz requests ])" --run python3
679-
Python 3.12.4 (main, Jun 6 2024, 18:26:44) [GCC 13.3.0] on linux
678+
$ nix-shell -p "python313.withPackages (ps: with ps; [ numpy toolz requests ])" --run python3
679+
Python 3.13.3 (main, Apr 8 2025, 13:54:08) [GCC 14.2.1 20250322] on linux
680680
Type "help", "copyright", "credits" or "license" for more information.
681681
>>> import requests
682682
>>>
@@ -716,7 +716,7 @@ Executing this script requires a `python3` that has `numpy`. Using what we learn
716716
in the previous section, we could startup a shell and just run it like so:
717717

718718
```ShellSession
719-
$ nix-shell -p 'python312.withPackages (ps: with ps; [ numpy ])' --run 'python3 foo.py'
719+
$ nix-shell -p 'python313.withPackages (ps: with ps; [ numpy ])' --run 'python3 foo.py'
720720
The dot product of [1 2] and [3 4] is: 11
721721
```
722722

@@ -779,12 +779,12 @@ create a single script with Python dependencies, but in the course of normal
779779
development we're usually working in an entire package repository.
780780

781781
As explained [in the `nix-shell` section](https://nixos.org/manual/nix/stable/command-ref/nix-shell) of the Nix manual, `nix-shell` can also load an expression from a `.nix` file.
782-
Say we want to have Python 3.12, `numpy` and `toolz`, like before,
782+
Say we want to have Python 3.13, `numpy` and `toolz`, like before,
783783
in an environment. We can add a `shell.nix` file describing our dependencies:
784784

785785
```nix
786786
with import <nixpkgs> { };
787-
(python312.withPackages (
787+
(python313.withPackages (
788788
ps: with ps; [
789789
numpy
790790
toolz
@@ -803,7 +803,7 @@ What's happening here?
803803
imports the `<nixpkgs>` function, `{}` calls it and the `with` statement
804804
brings all attributes of `nixpkgs` in the local scope. These attributes form
805805
the main package set.
806-
2. Then we create a Python 3.12 environment with the [`withPackages`](#python.withpackages-function) function, as before.
806+
2. Then we create a Python 3.13 environment with the [`withPackages`](#python.withpackages-function) function, as before.
807807
3. The [`withPackages`](#python.withpackages-function) function expects us to provide a function as an argument
808808
that takes the set of all Python packages and returns a list of packages to
809809
include in the environment. Here, we select the packages `numpy` and `toolz`
@@ -814,7 +814,7 @@ To combine this with `mkShell` you can:
814814
```nix
815815
with import <nixpkgs> { };
816816
let
817-
pythonEnv = python312.withPackages (ps: [
817+
pythonEnv = python313.withPackages (ps: [
818818
ps.numpy
819819
ps.toolz
820820
]);
@@ -976,8 +976,8 @@ information. The output of the function is a derivation.
976976

977977
An expression for `toolz` can be found in the Nixpkgs repository. As explained
978978
in the introduction of this Python section, a derivation of `toolz` is available
979-
for each interpreter version, e.g. `python312.pkgs.toolz` refers to the `toolz`
980-
derivation corresponding to the CPython 3.12 interpreter.
979+
for each interpreter version, e.g. `python313.pkgs.toolz` refers to the `toolz`
980+
derivation corresponding to the CPython 3.13 interpreter.
981981

982982
The above example works when you're directly working on
983983
`pkgs/top-level/python-packages.nix` in the Nixpkgs repository. Often though,
@@ -991,7 +991,7 @@ with import <nixpkgs> { };
991991
992992
(
993993
let
994-
my_toolz = python312.pkgs.buildPythonPackage rec {
994+
my_toolz = python313.pkgs.buildPythonPackage rec {
995995
pname = "toolz";
996996
version = "0.10.0";
997997
pyproject = true;
@@ -1002,7 +1002,7 @@ with import <nixpkgs> { };
10021002
};
10031003
10041004
build-system = [
1005-
python312.pkgs.setuptools
1005+
python313.pkgs.setuptools
10061006
];
10071007
10081008
# has no tests
@@ -1016,7 +1016,7 @@ with import <nixpkgs> { };
10161016
};
10171017
10181018
in
1019-
python312.withPackages (
1019+
python313.withPackages (
10201020
ps: with ps; [
10211021
numpy
10221022
my_toolz
@@ -1026,7 +1026,7 @@ with import <nixpkgs> { };
10261026
```
10271027

10281028
Executing `nix-shell` will result in an environment in which you can use
1029-
Python 3.12 and the `toolz` package. As you can see we had to explicitly mention
1029+
Python 3.13 and the `toolz` package. As you can see we had to explicitly mention
10301030
for which Python version we want to build a package.
10311031

10321032
So, what did we do here? Well, we took the Nix expression that we used earlier
@@ -2136,7 +2136,7 @@ has security implications and is relevant for those using Python in a
21362136

21372137
When the environment variable `DETERMINISTIC_BUILD` is set, all bytecode will
21382138
have timestamp 1. The [`buildPythonPackage`](#buildpythonpackage-function) function sets `DETERMINISTIC_BUILD=1`
2139-
and [PYTHONHASHSEED=0](https://docs.python.org/3.12/using/cmdline.html#envvar-PYTHONHASHSEED).
2139+
and [PYTHONHASHSEED=0](https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHONHASHSEED).
21402140
Both are also exported in `nix-shell`.
21412141

21422142
### How to provide automatic tests to Python packages? {#automatic-tests}
@@ -2186,10 +2186,10 @@ The following rules are desired to be respected:
21862186
It does not need to be set explicitly unless the package requires a specific platform.
21872187
* The file is formatted with `nixfmt-rfc-style`.
21882188
* Commit names of Python libraries must reflect that they are Python
2189-
libraries (e.g. `python312Packages.numpy: 1.11 -> 1.12` rather than `numpy: 1.11 -> 1.12`).
2189+
libraries (e.g. `python313Packages.numpy: 1.11 -> 1.12` rather than `numpy: 1.11 -> 1.12`).
21902190
* The current default version of python should be included
21912191
in commit messages to enable automatic builds by ofborg.
2192-
For example `python312Packages.numpy: 1.11 -> 1.12` should be used rather
2192+
For example `python313Packages.numpy: 1.11 -> 1.12` should be used rather
21932193
than `python3Packages.numpy: 1.11 -> 1.12`.
21942194
Note that `pythonPackages` is an alias for `python27Packages`.
21952195
* Attribute names in `python-packages.nix` as well as `pname`s should match the

doc/redirects.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@
478478
"footnote-stdenv-find-inputs-location.__back.0": [
479479
"index.html#footnote-stdenv-find-inputs-location.__back.0"
480480
],
481+
"strictflexarrays1": [
482+
"index.html#strictflexarrays1"
483+
],
484+
"strictflexarrays3": [
485+
"index.html#strictflexarrays3"
486+
],
481487
"tester-shfmt": [
482488
"index.html#tester-shfmt"
483489
],

doc/release-notes/rl-2511.section.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
- Added `rewriteURL` attribute to the nixpkgs `config`, to allow for rewriting the URLs downloaded by `fetchurl`.
3232

33-
- `vmalert` now supports multiple instances with the option `services.vmalert.instances."".enable`
34-
et al..
33+
- New hardening flags, `strictflexarrays1` and `strictflexarrays3` were made available, corresponding to the gcc/clang options `-fstrict-flex-arrays=1` and `-fstrict-flex-arrays=3` respectively.
34+
3535
- `gramps` has been updated to 6.0.0
3636
Upstream recommends [backing up your Family Trees](https://gramps-project.org/wiki/index.php/Gramps_6.0_Wiki_Manual_-_Manage_Family_Trees#Backing_up_a_Family_Tree) before upgrading.
3737

doc/stdenv/stdenv.chapter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,22 @@ Adds the `-fPIE` compiler and `-pie` linker options. Position Independent Execut
16221622
Static libraries need to be compiled with `-fPIE` so that executables can link them in with the `-pie` linker option.
16231623
If the libraries lack `-fPIE`, you will get the error `recompile with -fPIE`.
16241624

1625+
#### `strictflexarrays1` {#strictflexarrays1}
1626+
1627+
This flag adds the `-fstrict-flex-arrays=1` compiler option, which reduces the cases the compiler treats as "flexible arrays" to those declared with length `[1]`, `[0]` or (the correct) `[]`. This increases the coverage of fortify checks, because such arrays declared as the trailing element of a structure can normally not have their intended length determined by the compiler.
1628+
1629+
Enabling this flag on packages that still use length declarations of flexible arrays >1 may cause the package to fail to compile citing accesses beyond the bounds of an array or even crash at runtime by detecting an array access as an "overrun". Few projects still use length declarations of flexible arrays >1.
1630+
1631+
Disabling `strictflexarrays1` implies disablement of `strictflexarrays3`.
1632+
1633+
#### `strictflexarrays3` {#strictflexarrays3}
1634+
1635+
This flag adds the `-fstrict-flex-arrays=3` compiler option, which reduces the cases the compiler treats as "flexible arrays" to only those declared with length as (the correct) `[]`. This increases the coverage of fortify checks, because such arrays declared as the trailing element of a structure can normally not have their intended length determined by the compiler.
1636+
1637+
Enabling this flag on packages that still use non-empty length declarations for flexible arrays may cause the package to fail to compile citing accesses beyond the bounds of an array or even crash at runtime by detecting an array access as an "overrun". Many projects still use such non-empty length declarations for flexible arrays.
1638+
1639+
Enabling this flag implies enablement of `strictflexarrays1`. Disabling this flag does not imply disablement of `strictflexarrays1`.
1640+
16251641
#### `shadowstack` {#shadowstack}
16261642

16271643
Adds the `-fcf-protection=return` compiler option. This enables the Shadow Stack feature supported by some newer processors, which maintains a user-inaccessible copy of the program's stack containing only return-addresses. When returning from a function, the processor compares the return-address value on the two stacks and throws an error if they do not match, considering it a sign of corruption and possible tampering. This should significantly increase the difficulty of ROP attacks.

lib/licenses.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ lib.mapAttrs mkLicense (
232232
fullName = "Lawrence Berkeley National Labs BSD variant license";
233233
};
234234

235+
bsd3TheodoreTso = {
236+
fullName = "BSD 3 Clause Theodore Tso Variant";
237+
# TODO: if the license gets accepted to spdx then
238+
# add spdxId
239+
# else
240+
# remove license
241+
# && replace all references with bsd3
242+
# https://tools.spdx.org/app/license_requests/442/
243+
# https://github.com/spdx/license-list-XML/issues/2702
244+
};
245+
235246
bsdAxisNoDisclaimerUnmodified = {
236247
fullName = "BSD-Axis without Warranty Disclaimer with Unmodified requirement";
237248
url = "https://scancode-licensedb.aboutcode.org/bsd-no-disclaimer-unmodified.html";
@@ -691,6 +702,18 @@ lib.mapAttrs mkLicense (
691702
fullName = "Historic Permission Notice and Disclaimer";
692703
};
693704

705+
hpndDifferentDisclaimer = {
706+
fullName = "HPND with different disclaimer";
707+
url = "https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/1914233e662d23ffb3812b80fadd0bbd064ad91c/COPYING-x11proto#L69-88";
708+
# TODO: if the license gets accepted to spdx then
709+
# add spdxId
710+
# else
711+
# remove license
712+
# && replace reference with whatever this license is supposed to be then
713+
# https://tools.spdx.org/app/license_requests/456
714+
# https://github.com/spdx/license-list-xml/issues/2753
715+
};
716+
694717
hpndSellVariant = {
695718
fullName = "Historical Permission Notice and Disclaimer - sell variant";
696719
spdxId = "HPND-sell-variant";

maintainers/scripts/haskell/mark-broken.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ trap "rm ${tmpfile}" 0
3535

3636
echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script."
3737
echo "Generating a list of broken builds and displaying for manual confirmation ..."
38-
maintainers/scripts/haskell/hydra-report.hs mark-broken-list $mark_broken_list_flags | sort -i > "$tmpfile"
38+
maintainers/scripts/haskell/hydra-report.hs mark-broken-list $mark_broken_list_flags | LC_ALL=C.UTF-8 sort --ignore-case > "$tmpfile"
3939

4040
$EDITOR "$tmpfile"
4141

4242
tail -n +3 "$broken_config" >> "$tmpfile"
4343

4444
cat > "$broken_config" << EOF
45+
# These packages don't compile.
4546
broken-packages:
46-
# These packages don't compile.
4747
EOF
4848

4949
# clear environment here to avoid things like allowing broken builds in
50-
sort -iu "$tmpfile" >> "$broken_config"
50+
LC_ALL=C.UTF-8 sort --ignore-case --unique "$tmpfile" >> "$broken_config"
5151
clear="env -u HOME -u NIXPKGS_CONFIG"
5252
$clear maintainers/scripts/haskell/regenerate-hackage-packages.sh
5353
evalline=$(maintainers/scripts/haskell/hydra-report.hs eval-info)

maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ cat > $tmpfile << EOF
2020
dont-distribute-packages:
2121
EOF
2222

23-
nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort -i >> $tmpfile
23+
nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort --ignore-case >> $tmpfile
2424

2525
mv $tmpfile $config_file

maintainers/scripts/haskell/update-stackage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sed -r \
4646
-e '/^with-compiler:/d' \
4747
-e '/installed$/d' \
4848
-e '/^$/d' \
49-
< "${tmpfile}" | sort --ignore-case >"${tmpfile_new}"
49+
< "${tmpfile}" | LC_ALL=C.UTF-8 sort --ignore-case >"${tmpfile_new}"
5050

5151
cat > $stackage_config << EOF
5252
# Stackage $version

maintainers/scripts/kde/collect-missing-deps.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
"krfb": {
6363
"Qt6XkbCommonSupport", # not real
6464
},
65+
"ksystemstats": {
66+
"Libcap", # used to call setcap at build time and nothing else
67+
},
6568
"kuserfeedback": {
6669
"Qt6Svg", # all used for backend console stuff we don't ship
6770
"QmlLint",
@@ -75,6 +78,9 @@
7578
"display-info", # newer versions identify as libdisplay-info
7679
"Libcap", # used to call setcap at build time and nothing else
7780
},
81+
"kwin-x11": {
82+
"Libcap", # used to call setcap at build time and nothing else
83+
},
7884
"libksysguard": {
7985
"Libcap", # used to call setcap at build time and nothing else
8086
},
@@ -84,6 +90,12 @@
8490
},
8591
"plasma-desktop": {
8692
"scim", # upstream is dead, not packaged in Nixpkgs
93+
"KAccounts6", # dead upstream
94+
"AccountsQt6", # dead upstream
95+
"signon-oauth2plugin", # dead upstream
96+
},
97+
"plasma-dialer": {
98+
"KTactileFeedback", # dead?
8799
},
88100
"poppler-qt6": {
89101
"gobject-introspection-1.0", # we don't actually want to build the GTK variant

0 commit comments

Comments
 (0)