1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00
Commit graph

2911 commits

Author SHA1 Message Date
Eelco Dolstra
37fe2584c1 Make the repl test more robust
Seen in 4390954027:

  nix-functional-tests> grep: repl_output: No such file or directory
  nix-functional-tests> +(repl.sh:174) cat repl_output

This is because there is a small possibility that the `nix repl` child
process hasn't created `repl_output` yet. So make sure it exists.

(cherry picked from commit 9eb46e9cc0)
2025-06-22 19:08:35 +00:00
Eelco Dolstra
79eed1d9c4 Backward compatibility hack for dealing with dir in URL-style flakerefs
(cherry picked from commit d00682beb2)
2025-05-12 20:35:46 +00: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
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
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
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
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
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
Robert Hensing
f5731aa9a2 tests/nixos: Work around network-online.target inactivity
(cherry picked from commit 58b657b976)
2025-04-01 16:50:37 +00: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
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
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
Robert Hensing
6f54b90f36 test illegal reference specifier error message
(cherry picked from commit f4def47c89)
2025-03-25 15:49:31 +00:00
Shahar "Dawn" Or
3f56dd9927 stack overflow is EvalBaseError
(cherry picked from commit 23c7a45a05)
2025-03-21 14:13:40 +00:00
John Ericson
f636ced7d2 Revert "Revert "Revert "Adapt scheduler to work with dynamic derivations"""
The bug reappeared after all, and the fix introduced a different bug. We
want to release 2.27 imminently so there is no time to do a proper fix,
which appears to require a larger reworking. Hopefully we will have it
for 2.28, however.

This reverts commit c98525235f.
2025-02-27 13:42:57 -05:00
Eelco Dolstra
1293388039
Merge pull request #12544 from xokdvium/debugger-use-after-free
libexpr: Fix use-after-free of StaticEnv::up
2025-02-27 16:55:49 +01:00
Eelco Dolstra
14c9755462 nix flake archive: Recurse into relative path inputs
We can't ignore them entirely, since we do want to archive their
transitive inputs.

Fixes #12438.
2025-02-24 22:10:02 +01:00
Eelco Dolstra
b4dfeafed5 nix flake archive: Skip relative path inputs
Fixes #12438.
2025-02-24 15:30:30 +01:00
Sergei Zimmerman
0d5004508f tests/functional: Add flake-based regression for debugger use-after-free
This is the simplest reproducer I have. It would be great to find
a repro without flakes, but I guess this should be ok for now.
2025-02-21 14:36:39 +00:00
Eelco Dolstra
641733fd26 Add test 2025-02-19 12:47:28 +01:00
John Ericson
5facd492ad
Merge pull request #12499 from DeterminateSystems/detect-daemon-crash
startDaemon(): Detect if the daemon crashes before creating the socket
2025-02-18 11:38:16 -05:00
Robert Hensing
2b5365bcf7 tests: Fix installTests 2025-02-18 15:55:19 +01:00
Eelco Dolstra
11c42cb2e1 startDaemon(): Detect if the daemon crashes before creating the socket
This avoids timeouts like those seen in
3735812034.
2025-02-18 11:57:45 +01:00
Robert Hensing
3556f6bf4c Write just ./.version on all components
This way it's easier to get right. See previous commit.
2025-02-18 11:41:35 +01:00
Robert Hensing
c5fcb1bd50 Fix a few warnings 2025-02-17 19:29:01 +01:00
Eelco Dolstra
54388893bc dep-built-drv-2.sh: Don't fail with "cannot create symlink" 2025-02-17 11:57:21 +01:00
John Ericson
222a57c9ca More interesting dynamic derivations example
Co-authored-by: Samuel Ainsworth <skainsworth@gmail.com>
2025-02-16 18:00:34 -05:00
Robert Hensing
07f853b295
Merge pull request #9415 from NixOS/fix-dynamic-derivations
Revert "Revert "Adapt scheduler to work with dynamic derivations
2025-02-16 23:59:39 +01:00
Leandro Reina
b2d352e6a3 Add inputs.self.lfs 2025-02-13 17:59:27 +01:00
Robert Hensing
693a38ae2e
Merge pull request #10153 from b-camacho/lfs
git-lfs support
2025-02-13 14:25:30 +01:00
Robert Hensing
eb91014928
Merge pull request #12443 from DeterminateSystems/prefetch-out-link
nix flake prefetch: Add --out-link option
2025-02-12 22:22:04 +01:00
Eelco Dolstra
17d46041b8 Add test 2025-02-12 22:05:38 +01:00
Eelco Dolstra
26b87e78b5 copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.
2025-02-11 20:58:48 +01:00
Eelco Dolstra
b813a764e0 Merge remote-tracking branch 'origin/master' into self-input-attrs 2025-02-10 17:01:19 +01:00
Eelco Dolstra
1cb9a354fb Merge remote-tracking branch 'origin/master' into lfs 2025-02-10 14:46:01 +01:00