1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
Commit graph

2974 commits

Author SHA1 Message Date
Jörg Thalheim
a1fe09d2c8
Merge pull request #13350 from xokdvium/meson-format
flake: Add meson formatter
2025-06-13 11:37:32 +02:00
Pol Dellaiera
5862f38d00 docker: use callPackage, parametrise the image build 2025-06-12 19:50:31 +02:00
Sergei Zimmerman
93a42a5971
flake: Add meson formatter
This adds a meson.format file that mostly mirrors the projects
meson style and a pre-commit hook to enforce this style.
Some low-diff files are formatted.
2025-06-11 22:08:03 +00:00
John Ericson
371fcf91c3
Merge pull request #13294 from obsidiansystems/fix-13293
Fix #13293
2025-06-11 16:55:43 -04:00
John Ericson
f42eaf2c8e Create test for #13293
It currently fails, before the fix.
2025-06-11 16:11:38 -04:00
Eelco Dolstra
9eb46e9cc0 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.
2025-06-11 20:53:28 +02: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
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
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
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
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
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
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
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
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
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
d626348f42 Fix nix-copy-closure VM test
https://hydra.nixos.org/build/297112538
2025-05-15 12:55:08 +02:00
Jörg Thalheim
2dacdd110c
Merge pull request #13195 from NixOS/remove-nix_2_18
Remove otherNixes.nix_2_18
2025-05-15 11:43:12 +02:00
Eelco Dolstra
bc85e20fb9 Remove otherNixes.nix_2_18
Nixpkgs no longer has Nix 2.18, so this fails to evaluate.
2025-05-15 11:10:21 +02:00
John Ericson
99cb85cd37 Revert "If a substitute closure is incomplete, build dependencies, then retry the substituter"
As summarized in
https://github.com/NixOS/nix/issues/77#issuecomment-2843228280 the
motivation is that the complicated retry logic this introduced was
making the cleanup task #12628 harder to accomplish. It was not easy to
ascertain just what policy / semantics the extra control-flow was
implementing, in order to figure out a different way to implementing it
either.

After talking to Eelco about it, he decided we could just....get rid of
the feature entirely! It's a bit scary removing a decade+ old feature,
but I think he is right. See the release notes for more explanation.

This reverts commit 299141ecbd.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-14 20:16:40 -04:00
John Ericson
d972f9e2e2 Split out store-open.hh and store-registration.hh
The existing header is a bit too big. Now the following use-cases are
separated, and get their own headers:

- Using or implementing an arbitrary store: remaining `store-api.hh`

  This is closer to just being about the `Store` (and `StoreConfig`)
  classes, as one would expect.

- Opening a store from a textual description: `store-open.hh`

  Opening an aribtrary store implementation like this requires some sort
  of store registration mechanism to exists, but the caller doesn't need
  to know how it works. This just exposes the functions which use such a
  mechanism, without exposing the mechanism itself

- Registering a store implementation: `store-registration.hh`

  This requires understanding how the mechanism actually works, and the
  mechanism in question involves templated machinery in headers we
  rather not expose to things that don't need it, as it would slow down
  compilation for no reason.
2025-05-14 16:07:57 -04:00
Eelco Dolstra
824e0d51fe Test lock file contents more precisely 2025-05-13 10:40:24 +02:00
Jörg Thalheim
ed521760bc
Merge pull request #13161 from NixOS/remove-final
nix flake prefetch: Remove __final
2025-05-13 08:50:36 +02:00
Jörg Thalheim
6fdb170fb3
Merge pull request #13159 from NixOS/ignore-dir
Avoid unnecessarily updating old lock files with 'dir' parameters
2025-05-12 22:34:50 +02:00
Eelco Dolstra
5a84237209 Improve build failure error messages
They're now laid out in a more readable way, and they shows the output
paths (if known).
2025-05-12 15:06:54 +02:00
Eelco Dolstra
da953d6d39 Add test 2025-05-09 16:55:13 +02:00
Eelco Dolstra
d00682beb2 Backward compatibility hack for dealing with dir in URL-style flakerefs 2025-05-09 10:10:42 +02:00
Jörg Thalheim
5b900120a2
Merge pull request #13117 from NixOS/file-pure-eval
Complain when using --pure-eval with --file
2025-05-01 10:26:41 +02:00
Eelco Dolstra
d46f741cdf Complain when using --pure-eval with --file
This never worked and cannot work because in pure eval mode, the
evaluator doesn't have access to the file.
2025-04-30 22:29:27 +02:00