Commit Graph

1214 Commits

Author SHA1 Message Date
jopejoe1
d0f58c54f2 tests: migrate home-assistant-component-tests from all-packages 2026-01-16 20:31:57 +01:00
nixpkgs-ci[bot]
dd86763902 Merge master into staging-next 2026-01-12 00:19:46 +00:00
Wolfgang Walther
9de6bb676b release.nix: move lib-tests into regular nixpkgs tests attrs set (#471130) 2026-01-11 21:22:10 +00:00
K900
f54c9f15f8 Merge remote-tracking branch 'origin/staging-next' into staging 2026-01-11 21:58:16 +03:00
Robert Hensing
7ab1c2b1e3 haskellPackages.buildFromCabalSdist: respect patches (#474754) 2026-01-11 15:49:40 +00:00
nixpkgs-ci[bot]
3fa7bb6ca1 Merge staging-next into staging 2026-01-06 00:19:30 +00:00
Colin
a27b6de09b vmTools: add in 9 RHEL-adjacent distros, upgrade Debian/Ubuntu (#471901) 2026-01-05 22:41:47 +00:00
Matt Sturgeon
f52e77de34 treewide: use overlays to pass a custom stdenv to buildPythonPackage / bulidPythonApplication (#476401) 2026-01-05 19:33:00 +00:00
nixpkgs-ci[bot]
574ec5369e Merge staging-next into staging 2026-01-05 18:07:32 +00:00
Philip Taron
db467c36ec vmTools: use callPackage and fix rotted tests 2026-01-05 09:57:09 -08:00
Philip Taron
a1d2a411b2 prefer-remote-fetch: Fix evaluation for all fetchers and export additional attributes (#475142) 2026-01-05 15:04:59 +00:00
Leona Maroni
9667e939fa test/overriding: remove python deprecated stdenv override tests
These tests now throw a warning which is prohibited inside Nixpkgs:
  Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
    buildPythonPackage.override { stdenv = customStdenv; } { }
2026-01-05 15:44:40 +01:00
Dustin Frisch
96ed29f4b7 prefer-remote-fetch: Fix evaluation for all fetchers and export additional attributes 2025-12-29 21:11:02 +01:00
Robert Hensing
b6a3b8846e haskell.lib.buildFromSdist: add test, fix double-patch
Same issue as buildFromCabalSdist: sdistTarball applies patches via
overrideDerivation, but the patches attribute remained, causing
patchPhase to apply them again.
2025-12-28 15:31:09 +01:00
Robert Hensing
5a38e15e6d haskellPackages.buildFromCabalSdist: add test, fix double-patch
srcOnly applies patches, but the resulting derivation still had the
patches attribute, causing patchPhase to apply them again. Clear
patches after srcOnly to prevent double-application.
2025-12-28 15:26:33 +01:00
Florian Klink
4f0b794d15 tests.auto-patchelf-hook-preserve-origin: init
This adds a test for the autoPatchelfHook --preserve-origin feature.
2025-12-17 15:21:30 +02:00
jopejoe1
a58d4838e7 release.nix: move lib-tests into regular nixpkgs tests attrs set
this makes it get tested on all of our supported platforms
2025-12-15 20:46:21 +01:00
nixpkgs-ci[bot]
6b5a50c011 Merge staging-next into staging 2025-12-13 06:06:37 +00:00
John Ericson
e3a74fdac2 fix inputDerivation in case of __structuredAttrs (#469652) 2025-12-13 04:46:57 +00:00
Taeer Bar-Yam
97c3645990 stdenv: add tests for inputDerivation with allowedReferences, etc.
Co-authored-by: infinisil <github@infinisil.com>

!fixup every test needs a meta field?

!fixup refactor inputDerivation tests

!fixup fix tests
2025-12-12 20:23:22 +01:00
nixpkgs-ci[bot]
9d911c99bc Merge staging-next into staging 2025-12-12 12:08:28 +00:00
Matt Sturgeon
553a6c3d3a buildPython*: preserve overrideStdenvCompat on subsequent overrides
This is needed to support the deprecated method of overriding `stdenv`
via `overridePythonAttrs`.
2025-12-11 01:15:17 +00:00
nixpkgs-ci[bot]
795ce4c7c1 Merge staging-next into staging 2025-12-11 00:19:41 +00:00
Yueh-Shun Li
06711e45a0 tests.overriding: add overridePythonAttrs-stdenv-deprecated
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-11 03:54:59 +08:00
Yueh-Shun Li
dacf4930a9 tests.overriding: test buildPythonPackage.override
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-11 03:41:43 +08:00
Yueh-Shun Li
db3a787f4d tests.overriding: rename local variable python-package-stub -> package-stub 2025-12-11 03:16:53 +08:00
Yueh-Shun Li
ff13d8ce45 makeOverridablePythonPackage: simplify implementation and make compatible with <pkg>.overrideAttrs (#267296) 2025-12-10 19:06:55 +00: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
Yueh-Shun Li
ca6c090082 makeOverridablePythonPackage: take care of overrideAttrs
Make it possible to mix overridePythonAttrs and overrideAttrs, i.e.
((<pkg>.overrideAttrs (_: { foo = "a"; })).overridePythonAttrs (_: { })).foo now works

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-10 19:22:04 +08:00
Yueh-Shun Li
1653d671aa tests.overriding: modularize Python tests
Test with a pseudopackage python-package-stub.

Modularize the transforming function and testing function.
2025-12-10 19:19:06 +08:00
nixpkgs-ci[bot]
f383ecc781 Merge staging-next into staging 2025-12-09 18:06:41 +00:00
Yueh-Shun Li
4e37d03ba2 fetchgit: reference hash from finalAttrs.hash 2025-12-10 01:07:13 +08:00
Yueh-Shun Li
ae800ea500 fetchurl: reference outputHash from finalAttrs.hash 2025-12-10 01:02:47 +08:00
nixpkgs-ci[bot]
cda25e78e9 Merge staging-next into staging 2025-12-08 18:06:58 +00:00
jopejoe1
6a11d4a70b tests.pkgs-lib: expose the tests included in it 2025-12-08 12:01:06 +01:00
K900
8b56bf20bb Merge remote-tracking branch 'origin/staging-next' into staging 2025-12-07 23:38:37 +03:00
David McFarland
d613d20a13 treewide: fix nix-env eval in cross 2025-12-04 19:44:19 -04:00
DavHau
c66b12ff90 make-symlinks-relative.sh: optimize - use multiple cores
This optimizes the performance of the hook on machines with multiple cores.

The previous implementation was slow, as it was launching two extra processes per symlink (readlink and ln) while not making use of multiprocessing.

The following improvements were made:
- don't even execute the hook if dontRewriteSymlinks is set
- replace multiple find calls with single find call over all outputs
- use xargs -P to process symlinks in parallel
- add test to check that the hook operates as expected
2025-12-03 11:39:52 +07:00
Tom Hunze
c92df6ba1d tests.checkpointBuildTools: fix hello patches 2025-11-20 21:49:38 +01:00
Vladimír Čunát
1d8d3da257 Merge branch 'master' into staging-next 2025-11-12 08:29:34 +01:00
Rebecca Turner
dc4cf16993 lib.debug.throwTestFailures: init
`lib.debug.runTests` provides a unit test evaluator for Nix, but its
results are returned in a raw and difficult-to-read form.

Currently, different callers output the results in various ways:
`builtins.throw (builtins.toJSON failures)` and `builtins.throw ("Tests
failed: " + lib.generators.toPretty { } failures)` are both used.

This change adds a new `lib.debug.throwTestFailures` function which
displays the results nicely before throwing an exception (or returns
`null` if no failures are given), unifying these disparate call-sites.

First, each failing test is pretty-printed in a `trace` message:

```
trace: FAIL testDerivation:
  Expected: <derivation a>
    Result: <derivation b>
```

Then, an exception is thrown containing the number of tests that failed
(and their names), followed by the raw JSON of the results (for parity
with previous usage, and because `lib.generators.toPretty` sometimes
omits information that `builins.toJSON` includes):

```
error:
       … while evaluating the file '...':

       … caused by explicit throw
         at /nix/store/.../lib/debug.nix:528:7:
          527|       in
          528|       throw (
             |       ^
          529|         builtins.seq traceFailures (

       error: 1 tests failed:
       - testDerivation

       [{"expected":"/nix/store/xh7kyqp69mxkwspmi81a94m9xx74r8dr-a","name":"testDerivation","result":"/nix/store/503l84nir4zw57d1shfhai25bxxn16c6-b"}]
```
2025-11-10 10:41:31 -08:00
nixpkgs-ci[bot]
0c0d9a591c Merge master into staging-next 2025-11-06 06:06:47 +00:00
Matt Sturgeon
fbafefcf3d tests.overriding: refactor and allow non-bool expected value (#456848) 2025-11-06 00:52:26 +00:00
Yueh-Shun Li
ffca1c4197 tests.overriding: restructure test cases utilizing non-boolean support 2025-11-06 00:13:49 +00:00
Yueh-Shun Li
5351568405 tests.overriding: refactor and allow non-bool expected value
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-11-06 00:13:31 +00:00
nixpkgs-ci[bot]
9c7c6cc7ff Merge staging-next into staging 2025-10-31 00:17:58 +00:00
Aliaksandr
03bb7d8195 all-packages: do not export lib functions from pkgs 2025-10-30 22:38:49 +02:00
nixpkgs-ci[bot]
b4f640afe7 Merge staging-next into staging 2025-10-29 00:18:17 +00:00
Artturin
99d63d01cb tests.top-level.platformEquality: Fix use of alias 2025-10-28 20:09:45 +02:00