1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00
Commit graph

2991 commits

Author SHA1 Message Date
Graham Christensen
290368169e
Merge pull request #58 from DeterminateSystems/improve-build-failure-error
Improve build failure error messages
2025-05-09 14:03:35 +00:00
Eelco Dolstra
8014671210 Improve build failure error messages 2025-05-09 00:32:41 +02:00
Eelco Dolstra
bf1c0072f6 Backward compatibility hack for dealing with dir in URL-style flakerefs 2025-05-08 19:12:43 +02:00
Eelco Dolstra
f6ad6291ab nix flake metadata: Show store path if available 2025-05-07 15:56:35 +02:00
Eelco Dolstra
91cde8c79d EvalState::mountInput(): Throw an error if there is a NAR hash mismatch 2025-05-07 14:07:29 +02:00
Eelco Dolstra
630bdff7e9 Re-enable _NIX_TEST_FAIL_ON_LARGE_PATH tests 2025-05-07 12:49:11 +02:00
Eelco Dolstra
577b331464 Merge remote-tracking branch 'detsys/detsys-main' into lazy-trees-v2 2025-05-06 19:09:09 +02:00
Eelco Dolstra
c92cb4c130 Tagging release 2.28.3
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmgRLc8THGVkb2xzdHJh
 QGdtYWlsLmNvbQAKCRCBcLRybXGY3itzB/0ehHDYPXycvwpdL4MuAcroY5GgQJLz
 dGkrmv9tMQXERqjnqd86LW6BgKwG3UY12xFMeFgYQyV/TzC6iwZUgI+Kr+baFMhH
 JoEXgLTXRwnyC54mXUGPrX6P9MwPBoUpAClaG5iH9SCV70Z/PLuXsd4/HoDmLxsi
 tVCTxoq9kn7o/YAMOQGY3KTfM26LqEPOv2vTco2ETEnNqSXCjUJ/MniMdTGCsTxy
 rdWqel95EuIb0qsMSRPrVV6xmx/KjamTSzdCcXWQbpAu4xjUyacnjL3XpGWkMUKV
 HKtbNdXboHwJgtwe66HMCgtfWPB6JCamMRm+h/b6BrTTz46eJWiaG/KW
 =Exmm
 -----END PGP SIGNATURE-----

Merge tag '2.28.3' into sync-2.28.3

Tagging release 2.28.3
2025-04-30 17:45:27 +02:00
Jörg Thalheim
709f05989d tests/flakes: add regression test for resolving user flakes
(cherry picked from commit 6405d6822d)
2025-04-25 13:32:13 +02:00
Eelco Dolstra
dfbb52e6bd lockFlake(): Allow registry lookups for the top-level flake
Fixes #13050.

(cherry picked from commit 68de26d38a)
2025-04-25 13:31:24 +02:00
Eelco Dolstra
9d87ab1dc8 Add a setting to enable lazy trees 2025-04-24 16:16:28 +02:00
Jörg Thalheim
04fcc879e6 Revert "Actually ignore system/user registries during locking"
This reverts commit 77d4316353.

(cherry picked from commit 3b5f0d9fb3)
2025-04-24 11:34:57 +00:00
Robert Hensing
ba22a85a35 Fix pkgs.nixVersions and installTests
... by moving our stuff out of the way from upstream's
`nixComponents` and `nixDependencies` attrsets.

(I prefer not to use overlays, but let's make it work this way
first)

(cherry picked from commit b257ea94e3)
2025-04-23 16:42:02 +02:00
Eelco Dolstra
182edb4dee Move mountInput into EvalState 2025-04-23 13:53:29 +02:00
Eelco Dolstra
a6faa69fc8 Merge remote-tracking branch 'detsys/detsys-main' into lazy-trees-tmp 2025-04-23 12:25:28 +02:00
Eelco Dolstra
9574d3938f Tagging release 2.28.2
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmgA7TQTHGVkb2xzdHJh
 QGdtYWlsLmNvbQAKCRCBcLRybXGY3l0rB/0c5l5EhZUAMvjnUhug8+6/g6fLLisS
 ehrP9FxrjV5D2lO3EQcsBgW3bYzOwbcubuPBq8yPMlSLpf+uiAV1qxSKFGD3pnpZ
 6o7K3P3kaohFl6JL5oEn9yTGgm1EubYpW3c9zO8yaL32Jknjm44bD4mKr5Rz18jI
 YUfe1xDeYCwRY7YMrBKGwU2v/tlsjMX9XQlHuKPSx8uVA/UgxJk/41dIdzb0rhw5
 ueuKO2GEEMd/iV5lCEVFnk1WJoHru1fqTDAqRhDZJjFVbguYAIl7OQFQuBbtG3hv
 6SFC0iy/IoSrj9tRwSV+4wQU5fk6Gw2IYQlIw6VSx6xIydf46AjomPjX
 =xUfr
 -----END PGP SIGNATURE-----

Merge tag '2.28.2' into detsys-main

Tagging release 2.28.2
2025-04-17 16:58:05 +02:00
John Ericson
30d900b313 Derivation "advanced attrs" test: Ensure fields are set to distinct values
We had fields set to the same values before in our test data. This is
not a problem per-se, but does mean we wouldn't catch certain mixups.
Now, the fields are set to distinct values (where possible), which makes
the test more robust.

(cherry picked from commit a0b2b75f59)
2025-04-15 14:25:13 -04:00
John Ericson
f19184191e Test derivation options with content-addressing too
Now, both the unit and functional tests relating to derivation options
are tested both ways -- with input addressing and content-addressing
derivations.

(cherry picked from commit 307dbe9914)
2025-04-15 11:25:07 -04:00
John Ericson
37bcd29e5f Use the same variable for content addressing in functional tests
`CONTENT_ADDRESSED` -> `NIX_TESTS_CA_BY_DEFAULT`

(cherry picked from commit 7acc229c8f)
2025-04-15 11:19:45 -04:00
Robert Hensing
818fc68db6 fix: Evaluate flake parent source without evaluating its outputs
This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.

(cherry picked from commit 2109a5a206)
2025-04-15 11:52:46 +00:00
Eelco Dolstra
f45db85887 Actually ignore system/user registries during locking
Something went wrong in #12068 so this didn't work. Also added a test.
2025-04-09 21:04:42 +02:00
Rodney Lorrimar
080950b0fe tests/functional/flakes: Add test case for subflake locking
This adds a test case where the lockfile of a relative path flake
dependency is updated.

It was reported by a user here: https://discourse.nixos.org/t/updating-local-subflakes-inputs-when-building-root-flake/61682

I think this test case relates to issue #7730.

Because the issue is not resolved, this test case would fail without
the `|| true` clause.

(cherry picked from commit 1bc82d1c86)
2025-04-09 17:20:31 +00:00
Eelco Dolstra
a08477975d Actually ignore system/user registries during locking
Something went wrong in #12068 so this didn't work. Also added a test.

(cherry picked from commit 77d4316353)
2025-04-09 16:33:47 +00:00
Eelco Dolstra
fa5cb62604 Revert unneeded test change 2025-04-08 23:41:59 +02:00
Eelco Dolstra
febd28db87 Lazily copy trees to the store
We now mount lazy accessors on top of /nix/store without materializing
them, and only materialize them to the real store if needed (e.g. in
the `derivation` primop).
2025-04-08 23:41:59 +02:00
Eelco Dolstra
c891554999 Merge branch 'lazy-flake-commands' into lazy-trees-v2 2025-04-08 22:16:20 +02:00
Graham Christensen
8443f01536 Rename nix profile install to nix profile add. 2025-04-07 09:22:57 -04:00
Jörg Thalheim
288fee2d14 tests/functional/repl: fix race condition
the sleep 1 is not enough in some circumstances. Switching to a fifo
helps.

(cherry picked from commit 1de951d31d)
2025-04-07 12:20:05 +00:00
Eelco Dolstra
852075ec9d Tagging release 2.28.0
-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmfv9fITHGVkb2xzdHJh
 QGdtYWlsLmNvbQAKCRCBcLRybXGY3ohrCAC1Uw/JJr3yEPlJ/jLc9t9HqEKMY08W
 W6SEjpYJHYixMXmoonexkqojncNWBaiytRa+vBY7JQq0xTOOBwj42TM2ZzMF4GXi
 vO4Ox0hEsRa/v7tSmK6GFz1sNEKEUOHDNbilg4kzkkBHPEGPUGMwdWkT0akO576Q
 SQ6ERwPPLsHDI2YtAeAD8R4p07CraiyA34ljDPz3rChTAXRPVKWxJUt1enwEWYTr
 cKk45RcR4S8rP1BVwf3wsNsrHjqjbaY45kPAo8GD79hFH0zkyJarS3Kgv8qsWLra
 9ph0DVVG0wiArlET7Y3uchqtAC0Z5LOnutAmOFYFw6DKfWp9yGfl/SVW
 =XRda
 -----END PGP SIGNATURE-----

Merge tag '2.28.0' into sync-2.28.0

Tagging release 2.28.0
2025-04-04 17:49:15 +02:00
mergify[bot]
4edd560269
Merge pull request #12907 from NixOS/revert-nixpkgs-unstable
Revert to Nixpkgs 24.11 [2.28]
2025-04-03 09:29:26 +00:00
Eelco Dolstra
f48a72afc5 Revert "Merge pull request #12862 from NixOS/mergify/bp/2.28-maintenance/pr-12853"
This reverts commit aff0058b82, reversing
changes made to cb50eb0370.
2025-04-03 10:05:58 +02:00
Eelco Dolstra
5f74cf9b7a Apply makeNotAllowedError to empty repos
(cherry picked from commit 67e957b636)
2025-04-02 18:33:03 +00:00
John Ericson
0c67777396 Expose the nix component in header include paths
For example, instead of doing

    #include "nix/store-config.hh"
    #include "nix/derived-path.hh"

Now do

    #include "nix/store/config.hh"
    #include "nix/store/derived-path.hh"

This was originally planned in the issue, and also recent requested by
Eelco.

Most of the change is purely mechanical. There is just one small
additional issue. See how, in the example above, we took this
opportunity to also turn `<comp>-config.hh` into `<comp>/config.hh`.
Well, there was already a `nix/util/config.{cc,hh}`. Even though there
is not a public configuration header for libutil (which also would be
called `nix/util/config.{cc,hh}`) that's still confusing, To avoid any
such confusion, we renamed that to `nix/util/configuration.{cc,hh}`.

Finally, note that the libflake headers already did this, so we didn't
need to do anything to them. We wouldn't want to mistakenly get
`nix/flake/flake/flake.hh`!

Progress on #7876

(cherry picked from commit cc24766fa6)
2025-04-02 11:37:17 -04:00
Eelco Dolstra
fb7bcdd554 Make Git error messages more consistent 2025-04-01 22:56:14 +02:00
Eelco Dolstra
2526293171 shellcheck 2025-04-01 20:52:27 +02:00
Eelco Dolstra
4e0346dcc1 Restore 'forbidden in restricted mode' errors 2025-04-01 20:46:26 +02:00
Robert Hensing
f5731aa9a2 tests/nixos: Work around network-online.target inactivity
(cherry picked from commit 58b657b976)
2025-04-01 16:50:37 +00:00
Eelco Dolstra
1564c8f9d9 Fix missing file error messages from 'import' 2025-04-01 18:37:21 +02:00
Eelco Dolstra
73b1754816 Mount flake input source accessors on top of storeFS
This way, we don't need the PathDisplaySourceAccessor source accessor
hack, since error messages are produced directly by the original
source accessor.

In fact, we don't even need to copy the inputs to the store at all, so
this gets us very close to lazy trees. We just need to know the store
path so that requires hashing the entire input, which isn't lazy. But
the next step will be to use a virtual store path that gets rewritten
to the actual store path only when needed.
2025-04-01 17:49:28 +02:00
mergify[bot]
b38fee24d7
Merge pull request #12857 from NixOS/mergify/bp/2.28-maintenance/pr-12765
Add various clang tidy fixes (backport #12765)
2025-04-01 15:31:30 +00:00
Jörg Thalheim
11e6a1e6c8 test/ca-fd-leak: fix clang-tidy lints
(cherry picked from commit b050db951b)
2025-04-01 13:38:43 +00:00
Eelco Dolstra
fcddf4afe3 Apply makeNotAllowedError to empty repos 2025-04-01 15:35:01 +02:00
John Ericson
6a1a3fa1cb Cleanup config headers
There are two big changes:

1. Public and private config is now separated. Configuration variables
   that are only used internally do not go in a header which is
   installed.

   (Additionally, libutil has a unix-specific private config header,
   which should only be used in unix-specific code. This keeps things a
   bit more organized, in a purely private implementation-internal way.)

2. Secondly, there is no more `-include`. There are very few config
   items that need to be publically exposed, so now it is feasible to
   just make the headers that need them just including the (public)
   configuration header.

And there are also a few more small cleanups on top of those:

- The configuration files have better names.

- The few CPP variables that remain exposed in the public headers are
  now also renamed to always start with `NIX_`. This ensures they should
  not conflict with variables defined elsewhere.

- We now always use `#if` and not `#ifdef`/`#ifndef` for our
  configuration variables, which helps avoid bugs by requiring that
  variables must be defined in all cases.

(cherry picked from commit c204e307ac)
2025-04-01 15:07:49 +02:00
Eelco Dolstra
b2038f120c Add test for source path display 2025-04-01 14:03:16 +02:00
John Ericson
15658b259f Separate headers from source files
The short answer for why we need to do this is so we can consistently do
`#include "nix/..."`. Without this change, there are ways to still make
that work, but they are hacky, and they have downsides such as making it
harder to make sure headers from the wrong Nix library (e..g.
`libnixexpr` headers in `libnixutil`) aren't being used.

The C API alraedy used `nix_api_*`, so its headers are *not* put in
subdirectories accordingly.

Progress on #7876

We resisted doing this for a while because it would be annoying to not
have the header source file pairs close by / easy to change file
path/name from one to the other. But I am ameliorating that with
symlinks in the next commit.

(cherry picked from commit f3e1c47f47)
2025-03-31 18:04:04 -04:00
mergify[bot]
f7ebe64b47
Merge pull request #12829 from NixOS/mergify/bp/2.28-maintenance/pr-12730
libcmd/repl: Fix missing runNix in repl (backport #12730)
2025-03-31 20:23:01 +00:00
Sergei Zimmerman
20ce98f87b tests/functional: Add regression test for broken :sh in repl
Can't really test `:u` because it needs <nixpkgs>.

(cherry picked from commit d371aadb2b)
2025-03-31 18:40:22 +00:00
Robert Hensing
569631b1d5 Unexpose config headers (low hanging fruit only)
- Some headers were completely redundant and have been removed.
- Other headers have been turned private.
- Unnecessary meson.build code has been removed.
- libutil-tests now has a private config header, where previously
  it had none. This removes the need to expose a package version
  macro publicly.

(cherry picked from commit b86a76044e)
2025-03-31 18:18:08 +00:00
Sergei Trofimovich
cadfed692c tests/functional/check-refs.nix: format newly added test
(cherry picked from commit 4d72e0f73b)
2025-03-25 15:49:31 +00:00
Sergei Trofimovich
c2cffe6249 tests/functional/check-refs.sh: guard test12 against too old nix daemon
Otherwise without the change the test fails on nix-2.26 as:

    error: derivation contains an illegal reference specifier 'dev'

Note: the error message does not match intended change.
(cherry picked from commit 1e7c7244cf)
2025-03-25 15:49:31 +00:00