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

21542 commits

Author SHA1 Message Date
Jörg Thalheim
fad975b58f
Merge pull request #13231 from gwennlbh/docs-attrset-functor
docs: clarify attrset __functor
2025-05-20 09:03:13 +02:00
Jörg Thalheim
7616d290a0
Merge pull request #13232 from gwennlbh/clarify-implication-operator
docs: add another equivalence for the implication operator
2025-05-20 09:01:29 +02:00
Jörg Thalheim
6867a4688a
Merge pull request #13233 from xokdvium/function-args-opt
libexpr: Use `attrs.alreadySorted()` in primop_functionArgs
2025-05-20 08:29:42 +02:00
John Ericson
fe41bdefd7
Merge pull request #13234 from xokdvium/transparent-comparator-map
Use C++14 N3657 transparent comparator for `StringMap` and `StringPairs` (NFC)
2025-05-19 17:55:23 -04:00
Sergei Zimmerman
49d026083b
Use transparent comparators for StringMap and StringPairs 2025-05-19 20:38:19 +00:00
Sergei Zimmerman
8ee513379a
Use StringMap instead of std::map<std::string, std::string> throughout the codebase 2025-05-19 20:33:28 +00:00
Sergei Zimmerman
a4bfd559f1
libexpr: Use attrs.alreadySorted() in primop_functionArgs
Formals are already sorted as it's an invariant of `Formals`.
2025-05-19 19:53:20 +00:00
Gwenn Le Bihan
51151c2c28 docs: add another equivalence for the implication operator
the second equivalence, using a if-else expression, aligns much closer to how most humans think about implication, adding it might help some people :)
2025-05-19 17:37:29 +02:00
Luc Perkins
607be58a80
Update CI badge URLs 2025-05-19 11:20:40 -04:00
Gwenn Le Bihan
5c512a4ee1
docs: clarify attrset __functor 2025-05-19 16:58:16 +02:00
Eelco Dolstra
0cd1fce3c3
Merge pull request #13230 from NixOS/mergify/bp/2.29-maintenance/pr-13228
libutil-tests/json-utils: fix -Werror=sign-compare error (backport #13228)
2025-05-19 16:46:37 +02:00
Jörg Thalheim
90eb2f759c libutil-tests/json-utils: fix -Werror=sign-compare error
I am on a newer different nixpkgs branch, so I am getting this error

(cherry picked from commit 1290b7e53d)
2025-05-19 14:16:43 +00:00
Eelco Dolstra
8c10104e9e
Merge pull request #13228 from Mic92/json-utils
libutil-tests/json-utils: fix -Werror=sign-compare error
2025-05-19 16:15:09 +02:00
Eelco Dolstra
5d7ebaed24 Merge remote-tracking branch 'origin/2.29-maintenance' into sync-2.29 2025-05-19 16:12:55 +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
Jörg Thalheim
1290b7e53d libutil-tests/json-utils: fix -Werror=sign-compare error
I am on a newer different nixpkgs branch, so I am getting this error
2025-05-19 09:26:24 +02:00
Jörg Thalheim
d1e4be6fb4
Merge pull request #13227 from NixOS/mergify/bp/2.29-maintenance/pr-13142
libstore: Use `boost::regex` for GC root discovery (backport #13142)
2025-05-18 22:26:54 +02:00
Sergei Zimmerman
29d98da636 libstore: Depend on boost_regex explicitly
(cherry picked from commit 18a5589f9a)
2025-05-18 19:46:17 +00:00
Sergei Zimmerman
91dc6e7fa0 packaging/dependencies: Use boost without enableIcu
This reduces the closure size on master by 40MiB.

```
$ nix build github:nixos/nix/1e822bd4149a8bce1da81ee2ad9404986b07914c#nix-store --out-link closure-on-master
$ nix build .#nix-store -L --out-link closure-without-icu
$ nix path-info --closure-size -h ./closure-on-master
/nix/store/8gwr38m5h6p7245ji9jv28a2a11w1isx-nix-store-2.29.0pre  124.4 MiB
$ nix path-info --closure-size -h ./closure-without-icu
/nix/store/k0gwfykjqpnmaqbwh23nk55lhanc9g24-nix-store-2.29.0pre   86.6 MiB
```

(cherry picked from commit f3090ef703)
2025-05-18 19:46:17 +00:00
Sergei Zimmerman
b33fd1e4fb libstore: Use boost::regex for GC root discovery
As it turns out using `std::regex` is actually the bottleneck
for root discovery. Just substituting `std::` -> `boost::`
makes root discovery twice as fast (3x if counting only userspace time).

Some rather ad-hoc measurements to motivate the switch:

(On master)

```
nix build github:nixos/nix/1e822bd4149a8bce1da81ee2ad9404986b07914c#nix-cli --out-link result-1e822bd4149a8bce1da81ee2ad9404986b07914c
taskset -c 2,3 hyperfine "result-1e822bd4149a8bce1da81ee2ad9404986b07914c/bin/nix store gc --dry-run --max 0"
Benchmark 1: result-1e822bd4149a8bce1da81ee2ad9404986b07914c/bin/nix store gc --dry-run --max 0
  Time (mean ± σ):     481.6 ms ±   3.9 ms    [User: 336.2 ms, System: 142.0 ms]
  Range (min … max):   474.6 ms … 487.7 ms    10 runs
```

(After this patch)

```
taskset -c 2,3 hyperfine "result/bin/nix store gc --dry-run --max 0"
Benchmark 1: result/bin/nix store gc --dry-run --max 0
  Time (mean ± σ):     254.7 ms ±   9.7 ms    [User: 111.1 ms, System: 141.3 ms]
  Range (min … max):   246.5 ms … 281.3 ms    10 runs
```

`boost::regex` is a drop-in replacement for `std::regex`, but much faster.
Doing a simple before/after comparison doesn't surface any change in behavior:

```
result/bin/nix store gc --dry-run -vvvvv --max 0 |& grep "got additional" | wc -l
result-1e822bd4149a8bce1da81ee2ad9404986b07914c/bin/nix store gc --dry-run -vvvvv --max 0 |& grep "got additional" | wc -l
```

(cherry picked from commit 3a1301cd6d)
2025-05-18 19:46:16 +00:00
Jörg Thalheim
e7078d4de1
Merge pull request #13142 from xokdvium/gc-root-boost-regex
libstore: Use `boost::regex` for GC root discovery
2025-05-18 21:44:41 +02:00
Jörg Thalheim
638b7ec6c5
Merge pull request #13219 from xokdvium/eval-profiler
libexpr: Add `EvalProfiler` and use it for `FunctionCallTrace`
2025-05-18 21:35:43 +02:00
Jörg Thalheim
f2671886f5
Merge pull request #13223 from NixOS/remove-global-fetcher-cache
Remove global fetcher cache
2025-05-18 15:58:53 +02:00
Sergei Zimmerman
fa6f69f9c5
libexpr: Use EvalProfiler for FunctionCallTrace
This wires up the {pre,post}FunctionCallHook machinery
in EvalState::callFunction and migrates FunctionCallTrace
to use the new EvalProfiler mechanisms for tracing.

Note that branches when the hook gets called are marked with [[unlikely]]
as a hint to the compiler that this is not a hot path. For non-tracing
evaluation this should be a 100% predictable branch, so the performance
cost is nonexistent.

Some measurements to prove support this point:

```
nix build .#nix-cli
nix build github:nixos/nix/d692729759e4e370361cc5105fbeb0e33137ca9e#nix-cli --out-link before
```

(Before)

```
$ taskset -c 2,3 hyperfine "GC_INITIAL_HEAP_SIZE=16g before/bin/nix eval nixpkgs#gnome --no-eval-cache" --warmup 4
Benchmark 1: GC_INITIAL_HEAP_SIZE=16g before/bin/nix eval nixpkgs#gnome --no-eval-cache
  Time (mean ± σ):      2.517 s ±  0.032 s    [User: 1.464 s, System: 0.476 s]
  Range (min … max):    2.464 s …  2.557 s    10 runs
```

(After)

```
$ taskset -c 2,3 hyperfine "GC_INITIAL_HEAP_SIZE=16g result/bin/nix eval nixpkgs#gnome --no-eval-cache" --warmup 4
Benchmark 1: GC_INITIAL_HEAP_SIZE=16g result/bin/nix eval nixpkgs#gnome --no-eval-cache
  Time (mean ± σ):      2.499 s ±  0.022 s    [User: 1.448 s, System: 0.478 s]
  Range (min … max):    2.472 s …  2.537 s    10 runs
```
2025-05-18 11:55:39 +00:00
Sergei Zimmerman
6b4a86a9e3
libexpr: Add EvalProfiler
This patch adds an EvalProfiler and MultiEvalProfiler that can be used
to insert hooks into the evaluation for the purposes of function tracing
(what function-trace currently does) or for flamegraph/tracy profilers.

See the following commits for how this is supposed to be integrated into
the evaluator and performance considerations.
2025-05-18 11:55:37 +00:00
Eelco Dolstra
8f7ac96bbc Merge remote-tracking branch 'origin/2.29-maintenance' into sync-2.29 2025-05-18 13:11:12 +02:00
Eelco Dolstra
136cc106e7 Restore the hash mismatch activity 2025-05-18 13:10:08 +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
2922e3082e
Add release note for non-flake inputs having sourceInfo 2025-05-18 00:45:33 +01: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
Matt Sturgeon
46beb9af76
Use correct parent outPath for relative path inputs
Ensure relative path inputs are relative to the parent node's _actual_
`outPath`, instead of the subtly different `sourceInfo.outPath`.

Additionally, non-flake inputs now also have a `sourceInfo` attribute.

This fixes the relationship between `self.outPath` and
`self.sourceInfo.outPath` in some edge cases.

Fixes #13164
2025-05-18 00:38:17 +01:00
Eelco Dolstra
1d5cce6c5c
Merge pull request #69 from DeterminateSystems/nix-profile-add-manpage
Install 'nix profile add' manpage
2025-05-17 21:43:44 +00:00
Eelco Dolstra
83fa99844b Install 'nix profile add' manpage 2025-05-17 21:19:49 +02:00
Eelco Dolstra
5f75738fd6 Install 'nix profile add' manpage 2025-05-17 21:18:04 +02:00
Eelco Dolstra
fd407141e1 Make nix profile install an alias of nix profile add 2025-05-17 21:07:24 +02:00
Graham Christensen
b37d1cdd8e Rename nix profile install to nix profile add. 2025-05-17 21:07:24 +02:00
mergify[bot]
1c618a9d87
Merge pull request #13222 from NixOS/mergify/bp/2.29-maintenance/pr-13221
doc: Render verbatim `@docroot@` on contributing page (backport #13221)
2025-05-17 18:00:31 +00:00
Eelco Dolstra
efcb9e36a9 Remove global fetcher cache
The cache is now part of fetchers::Settings.
2025-05-17 19:54:32 +02:00
Eelco Dolstra
7d89e46f65 Sync: Support moving out of another Sync 2025-05-17 19:38:36 +02:00
Robert Hensing
ab2abebfc3 doc: Render verbatim @docroot@ on contributing page
In rendered form:

```diff
-Add references to the manual using ..
+Add references to the manual using [links like this](@docroot@/example.md)
```

(cherry picked from commit 147a34c573)
2025-05-17 17:19:51 +00:00
Eelco Dolstra
e5e5c819dd
Merge pull request #13221 from roberth/doc-rl-docroot
doc: Render verbatim `@docroot@` on contributing page
2025-05-17 19:18:59 +02:00
Robert Hensing
147a34c573 doc: Render verbatim @docroot@ on contributing page
In rendered form:

```diff
-Add references to the manual using ..
+Add references to the manual using [links like this](@docroot@/example.md)
```
2025-05-17 17:50:49 +02:00
Eelco Dolstra
39f9f5d1b6
Merge pull request #13206 from obsidiansystems/goal-init-dedup
Deduplicate the goal creation functions
2025-05-17 09:07:51 +02:00
Luc Perkins
162e21820d
Merge pull request #68 from DeterminateSystems/determinate-nix-action
Switch to determinate-nix-action
2025-05-16 21:14:34 +00:00
Luc Perkins
aa2404abd8
Switch to determinate-nix-action 2025-05-16 15:13:55 -04:00
John Ericson
0f132fc129
Merge pull request #13218 from NixOS/mergify/bp/2.29-maintenance/pr-13212
docs: remove repeated "allowedReferences" and other lexical illusion (backport #13212)
2025-05-16 12:36:46 -04:00
Eelco Dolstra
2bc6c3395b Disable cross builds
Mostly because they're causing an evaluation error in `nix flake
check` on macOS, and we don't need them right now for Determinate Nix.
2025-05-16 18:20:16 +02:00
Peder Bergebakken Sundt
6fc6db3496 docs: remove lexical illusions detected with write-good
I made this this non-markdown aware tool somewhat behave with some cursed fd+pandoc invocations

(cherry picked from commit ea5302c4a2)
2025-05-16 15:56:26 +00:00
Peder Bergebakken Sundt
ca0bde3578 docs: remove repeated "allowedReferences"
This is what write-good lints as a "lexical illusion"

(cherry picked from commit cb16cd707c)
2025-05-16 15:56:26 +00:00