1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 12:36:01 +01:00
Commit graph

3150 commits

Author SHA1 Message Date
Luc Perkins
27755169f9
Merge pull request #92 from DeterminateSystems/lucperkins/fh-864-fix-error-messages-to-avoid-fake-future-tense
Fix some instances of 'will'
2025-06-11 17:27:24 +00:00
Eelco Dolstra
87fb81a624 Make the repl test more robust
Seen in https://github.com/DeterminateSystems/nix-src/actions/runs/15590867877/job/43909540271:

  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.
2025-06-11 19:14:31 +02:00
Eelco Dolstra
de793b7324 Make the S3 test more robust
Waiting for the minio unit is apparently not reliable enough, so let's
also wait for the port.
2025-06-11 10:48:57 -04:00
Robert Hensing
c5b1be46b4
Merge pull request #11406 from kstrafe/master
nix repl: Print which variables are just loaded
2025-06-07 13:53:13 +02:00
Graham Christensen
62029df300 Fixup checks around the error message 'Will not write lock file of flake' 2025-06-06 17:29:11 -04:00
Graham Christensen
cbb635159c Fixup checks around the error message 'will not fetch unlocked input' 2025-06-06 17:28:17 -04:00
Eelco Dolstra
d8b067b549 repl: Don't wait on incomplete parses from imported file
Fixes #13332.
2025-06-06 14:14:57 +02:00
Kevin Robert Stravers
13e3704329
nix repl: Add :ll to show all recently loaded variables
Invoking `:ll` will start a pager with all variables which have just
been loaded by `:lf`, `:l`, or by a flake provided to `nix repl` as an
argument.

https://github.com/NixOS/nix/issues/11404
2025-06-05 17:33:04 -04:00
Kevin Robert Stravers
3c9b9b13af
nix repl: Print which variables are just loaded
When we run `nix repl nixpkgs` we get "Added 6 variables". This is not
useful as it doesn't tell us which variables the flake has exported to
our global repl scope.

This patch prints the name of each variable that was just loaded. We
currently cap printing to 20 variables in order to avoid excessive
prints.

https://github.com/NixOS/nix/issues/11404
2025-06-05 17:32:57 -04:00
Cole Helbling
dfa7b2a288
libstore/unix/derivation-builder: error earlier when sandbox path is inaccessible 2025-06-04 12:16:34 -07:00
Jörg Thalheim
4b8f74b3a3
Merge pull request #13320 from DeterminateSystems/keep-failed-remote-builders-warning
Clarify that `--keep-failed` with remote builders will keep the failed build directory on that builder
2025-06-03 19:28:20 +02:00
Sergei Zimmerman
a2567f6d7a Clear displayPrefix in makeEmptySourceAccessor
Judging by the comment for `makeEmptySourceAccessor` the prefix has
to be empty:

> Return a source accessor that contains only an empty root directory.

Fixes #13295.

(cherry picked from commit fba1bb0c13)
2025-06-03 19:27:15 +02:00
Cole Helbling
0712339912
--keep-failed with remote builders will keep the failed build directory on that builder 2025-06-03 07:50:29 -07:00
Jörg Thalheim
6a761c1a60
Merge pull request #13296 from xokdvium/empty-accessor-prefix
Clear `displayPrefix` in `makeEmptySourceAccessor`
2025-06-03 01:32:46 +02:00
Cole Helbling
242719cffb
--keep-failed with remote builders will keep the failed build directory on that builder 2025-06-02 14:41:29 -07:00
Graham Christensen
1500e541f2 diff-closures: use removed / added words 2025-06-02 11:21:26 -04:00
Graham Christensen
724d552b64 Use words like added / removed 2025-06-02 09:30:18 -04:00
Graham Christensen
7d2dbbd3aa Rename ε to "(no version)" 2025-06-02 09:22:55 -04:00
Sergei Zimmerman
fba1bb0c13
Clear displayPrefix in makeEmptySourceAccessor
Judging by the comment for `makeEmptySourceAccessor` the prefix has
to be empty:

> Return a source accessor that contains only an empty root directory.

Fixes #13295.
2025-05-29 19:35:12 +00:00
John Ericson
69603a1348
Merge pull request #13282 from xokdvium/prim-match-tests
tests/functional: Add more language tests for `builtins.match`
2025-05-28 17:11:44 -04:00
John Ericson
7577d2d3ae Deprecate hacky way of making structured attrs
The method tested for in the previous commit is now deprecated.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-28 12:59:04 -04:00
John Ericson
a353b2f4b2 Test hacky way of making structured attrs 2025-05-28 11:52:17 -04:00
Sergei Zimmerman
d555d6b404
tests/functional: Add more language tests for builtins.match
These tests have been collected from nixpkgs f870c6ccc8951fc48aeb293cf3e98ade6ac42668
usage of builtins.match for x86_64-linux eval system. At most 2 matching and
non-matching cases are included for each encountered regex. This should
hopefully add more confidence when possibly trying to switch the regex implementation
in the future.
2025-05-27 22:28:13 +00:00
gustavderdrache
d80f0fb15a Add test for output warning to ensure stability
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-27 09:18:51 -04:00
Eelco Dolstra
170f6021cf
Merge pull request #13265 from Mic92/fix-shallow-clone-subset
Improve errors when we are trying to access a git repository with partial history (+ fix fetchGit on these repos)
2025-05-26 14:53:08 +02:00
Eelco Dolstra
5f13d13f78 Fix trace-ifd test failure in dev shell
Fixes

  error: cannot create symlink '/home/eelco/Dev/nix/tests/functional/flakes/result'; already exists

running the test multiple times in a dev shell.
2025-05-26 13:56:38 +02:00
Jörg Thalheim
5419d82547 tests/fetchGit: work around something that looks a bash parsing quirk.
Before we got something like this but only inside the VM test:

 vm-test-run-functional-tests-on-nixos_user> machine # fetchGit.sh: line 286: unexpected EOF while looking for matching `)'

We now try to do not too much in a single line, so that the bash parser does not get confused.
This also seems more readable and better quoted.
2025-05-26 12:44:31 +02:00
Jörg Thalheim
b1ccfaa080 git/revCount: improve error message when we have incomplete git history 2025-05-26 12:44:31 +02:00
Sergei Zimmerman
9e97ecabb6
libexpr: Include derivation names in the call stack profile
This makes the profiler much more useful by actually distiguishing
different derivations being evaluated. This does make the implementation
a bit more convoluted, but I think it's worth it.
2025-05-25 15:53:01 +00:00
Eelco Dolstra
d068b82c2f Add test
(cherry picked from commit c66eb9cef7)
2025-05-25 05:55:28 +00:00
Jörg Thalheim
087f268615
Merge pull request #13256 from NixOS/fix-substitution-crash
Fix nlohmann error in fromStructuredAttrs()
2025-05-25 07:54:28 +02:00
Eelco Dolstra
ca9696748a Make the S3 test more robust
Waiting for the minio unit is apparently not reliable enough, so let's
also wait for the port.
2025-05-24 01:30:51 +02:00
Eelco Dolstra
4bc1043ae4 Add test 2025-05-24 00:46:37 +02:00
Eelco Dolstra
c66eb9cef7 Add test 2025-05-24 00:40:06 +02:00
Jörg Thalheim
4cc312a6e1
Merge pull request #13251 from Mic92/json-log-path
Add `json-log-path` setting (revisted)
2025-05-23 11:25:40 +02:00
Eelco Dolstra
7240fb198f Add json-log-path setting
This setting specifies a path (which can be a regular file or Unix
domain socket) that receives a copy of all Nix log messages (in JSON
format).
2025-05-23 10:45:12 +02:00
Jörg Thalheim
906cc88f4e
Merge pull request #13220 from xokdvium/flamegraph
Stack sampling flamegraph profiler
2025-05-23 10:42:49 +02:00
gustavderdrache
4355b7cbd5 Add test for output warning to ensure stability 2025-05-22 17:30:14 -04:00
Jeremy Fleischman
17eb2e8400 Expose flake directory to nix fmt as PRJ_ROOT env var
This was discussed in https://github.com/NixOS/nix/issues/8034. I
personally like `PRJ_ROOT`, which hopefully avoids some ambiguity
around with subflakes.

I only implemented this for `nix fmt` because it doesn't let you point
at a flake not on your filesystem.

macOS compilation fixes
2025-05-22 19:18:53 +02:00
John Ericson
57348b677b Restore dynamic derivations!
This method does *not* create a new type of goal. We instead just make
`DerivationGoal` more sophisticated, which is much easier to do now that
`DerivationBuildingGoal` has been split from it (and so many fields are
gone, or or local variables instead).

This avoids the need for a secondarily trampoline goal that interacted
poorly with `addWantedOutputs`. That, I hope, will mean the bugs from
before do not reappear.

There may in fact be a reason to introduce such a trampoline in the
future, but it would only happen in conjunction with getting rid of
`addWantedOutputs`.

Restores the functionality (and tests) that was reverted in
f4f28cdd0e.
2025-05-21 17:31:41 -04:00
Sergei Zimmerman
33141cd133
tests/functional: Add tests for flamegraph profiler
The tests are mostly based on existing `function-trace.sh`
with some tests for corner cases.
2025-05-21 20:15:22 +00:00
Eelco Dolstra
e22142e11a
Merge pull request #13224 from NixOS/nix-profile-add
Rename `nix profile install` to `nix profile add`
2025-05-20 20:15:31 +02:00
Robert Hensing
f18af849fe
Merge pull request #13170 from MattSturgeon/fix/call-flake/rel-path
Use correct parent `outPath` for relative path inputs
2025-05-19 14:13:54 +02:00
Eelco Dolstra
f50117ba4c Revert storeFS to use makeFSSourceAccessor()
Need to investigate why store->getFSAccessor() breaks a test.
2025-05-18 10:01:57 +02:00
Matt Sturgeon
72232bc28a
tests/functional/flakes/non-flake-inputs: Test non-flake inputs having sourceInfo 2025-05-18 00:40:09 +01:00
Robert Hensing
eaee0b4740
tests/function/flakes/relative-paths: Test #13164 2025-05-18 00:40:08 +01:00
Graham Christensen
b37d1cdd8e Rename nix profile install to nix profile add. 2025-05-17 21:07:24 +02:00
Eelco Dolstra
9088d5b525 Merge remote-tracking branch 'origin/2.29-maintenance' into sync-2.29 2025-05-16 12:53:24 +02:00
Eelco Dolstra
c20642ac7b Merge remote-tracking branch 'origin/2.29-maintenance' into detsys-main 2025-05-16 12:48:44 +02:00
Eelco Dolstra
dc238ba102 Fix nix-copy-closure VM test
https://hydra.nixos.org/build/297112538
(cherry picked from commit d626348f42)
2025-05-15 15:51:43 +00:00