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

20253 commits

Author SHA1 Message Date
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
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
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
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
Jörg Thalheim
d692729759
Merge pull request #13212 from pbsds/lexical-illusions
docs: remove repeated "allowedReferences" and other lexical illusion
2025-05-16 16:59:23 +02:00
Jörg Thalheim
041d2374dd
Merge pull request #13213 from pbsds/deriving-path-encoding-anchor
docs: fix duplicate anchor
2025-05-16 11:28:31 +02:00
Peder Bergebakken Sundt
4c50cf798e docs: fix duplicate anchor
`#deriving-path-encoding` is defined in two places, I _think_ this is the correct one to change.
2025-05-16 10:27:29 +02:00
Peder Bergebakken Sundt
ea5302c4a2 docs: remove lexical illusions detected with write-good
I made this this non-markdown aware tool somewhat behave with some cursed fd+pandoc invocations
2025-05-16 09:52:19 +02:00
Peder Bergebakken Sundt
cb16cd707c docs: remove repeated "allowedReferences"
This is what write-good lints as a "lexical illusion"
2025-05-16 09:20:55 +02:00
John Ericson
b21fc05047
Merge pull request #13211 from xokdvium/pos-table
libexpr: Actually cache line information in PosTable
2025-05-16 00:37:57 -04:00
Sergei Zimmerman
5ea81f5b8f
libexpr: Actually cache line information in PosTable
Previous code had a sneaky bug due to which no caching
actually happened:

```cpp
auto linesForInput = (*lines)[origin->offset];
```

That should have been:
```cpp
auto & linesForInput = (*lines)[origin->offset];
```

See [1].

Now that it also makes sense to make the cache bound in side
in order not to memoize all the sources without freeing any memory.
The default cache size has been chosen somewhat arbitrarily to be ~64k
origins. For reference, 25.05 nixpkgs has ~50k .nix files.

Simple benchmark:

```nix
let
  pkgs = import <nixpkgs> { };
in
builtins.foldl' (acc: el: acc + el.line) 0 (
  builtins.genList (x: builtins.unsafeGetAttrPos "gcc" pkgs) 10000
)
```

(After)

```
$ hyperfine "result/bin/nix eval -f ./test.nix"
Benchmark 1: result/bin/nix eval -f ./test.nix
  Time (mean ± σ):     292.7 ms ±   3.9 ms    [User: 131.0 ms, System: 120.5 ms]
  Range (min … max):   288.1 ms … 300.5 ms    10 runs
```

(Before)

```
hyperfine "nix eval -f ./test.nix"
Benchmark 1: nix eval -f ./test.nix
  Time (mean ± σ):     666.7 ms ±   6.4 ms    [User: 428.3 ms, System: 191.2 ms]
  Range (min … max):   659.7 ms … 681.3 ms    10 runs
```

If the origin happens to be a `all-packages.nix` or similar in size then the
difference is much more dramatic.

[1]: 22e3f0e987
2025-05-15 23:07:25 +00:00
Sergei Zimmerman
4711720efe
libutil: Add LRUCache::getOrNullptr
For heavier objects it doesn't make sense to return
a std::optional with the copy of the data, when it
can be used by const reference.
2025-05-15 22:28:41 +00:00
John Ericson
dc1a5135ee
Merge pull request #13207 from xokdvium/drop-bear
dev-shell: Drop bear dependency
2025-05-15 17:48:08 -04:00
Sergei Zimmerman
67535263a5
dev-shell: Drop bear dependency
Since the autotools-based build system has been removed
and meson already generates compile database there's no
need to have it in the devshell.
2025-05-15 21:13:13 +00:00
John Ericson
7bd9eef772 Deduplicate the goal creation functions
The weak reference logic is the same in both these cases, and if/when I
get rid `addWantedOutputs`, also in the `DerivationGoal` case.
2025-05-15 16:59:48 -04:00
John Ericson
01207fd101 Remove useDerivation
Try to make `DerivationGoal` care less whether we're working from an
in-memory derivation or not.

It's a clean-up in its own right, but it will also help with other
cleanups under the umbrella of #12628.
2025-05-15 13:40:26 -04:00
John Ericson
c1085ce849 Get rid of virtual Goal::init()
Now, each class provides the initial coroutine by value. This avoids
some sketchy virtual function stuff, and will also be further put to
good use in the next commit.
2025-05-15 13:40:26 -04:00
Jörg Thalheim
0d3750e902
Merge pull request #13202 from NixOS/fix-nix-copy-closure-test
Fix nix-copy-closure VM test
2025-05-15 17:50:12 +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
ea09198f93
Merge pull request #13197 from NixOS/bump-nixpkgs
Update Nixpkgs to fix static builds
2025-05-15 12:20:06 +02:00
Eelco Dolstra
0b46025f7a
Merge pull request #13196 from Mic92/store-config-base
rename StoreDirConfigItself to StoreDirConfigBase
2025-05-15 12:03:11 +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
3ba49d7ec2 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/f02fddb8acef29a8b32f10a335d44828d7825b78?narHash=sha256-IgBWhX7A2oJmZFIrpRuMnw5RAufVnfvOgHWgIdds%2Bhc%3D' (2025-05-01)
  → 'github:NixOS/nixpkgs/adaa24fbf46737f3f1b5497bf64bae750f82942e?narHash=sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY%3D' (2025-05-13)
2025-05-15 11:31:34 +02:00
Jörg Thalheim
2dd2142754 rename StoreDirConfigItself to StoreDirConfigBase
context: https://github.com/NixOS/nix/pull/13154#discussion_r2081904653
2025-05-15 11:24:42 +02:00
Eelco Dolstra
3285b68044
Merge pull request #13176 from obsidiansystems/revert-incomplete-closure-feature
Revert #77
2025-05-15 11:13:31 +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
c3e7e88889
Merge pull request #13194 from NixOS/bump-2.30.0
Bump 2.30.0
2025-05-14 20:40:24 -04: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
95e1f463c8 .mergify.yml: Add backport 2.29-maintenance entry 2025-05-14 19:59:22 -04:00
John Ericson
6591a4119c Bump version 2025-05-14 19:59:22 -04:00
John Ericson
45726dcc55
Merge pull request #13189 from NixOS/rl-next
Add release notes
2025-05-14 19:58:59 -04:00
John Ericson
f70796309d
Merge pull request #13193 from xokdvium/lru-cache
libutil: Less unnecessary copying in `LRUCache`
2025-05-14 19:29:53 -04:00
John Ericson
1b22f0252d
Merge pull request #13192 from NixOS/store-open-reg-header
Factor out `resolveStoreConfig`
2025-05-14 19:20:05 -04:00
John Ericson
6e9350d53f Add little blurb at the top of 2.29 release notes 2025-05-14 19:05:27 -04:00
John Ericson
29e78faa59 Slightly sort 2.29 release notes 2025-05-14 18:46:35 -04:00
John Ericson
646f3064a3 Cache more contributors 2025-05-14 18:44:39 -04:00
John Ericson
d5e7359155 release notes: 2.29.0 2025-05-14 18:43:53 -04:00
John Ericson
d7481b4b63 Factor out resolveStoreConfig
Leverage #10766 to show how we can now resolve a store configuration
without actually opening the store for that resolved configuration.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-05-14 18:30:25 -04:00
Robert Hensing
12b7132209
Merge pull request #13188 from NixOS/store-open-reg-header
Split out `store-open.hh` and `store-registration.hh`
2025-05-15 00:21:32 +02:00
John Ericson
18894c934f Merge remote-tracking branch 'upstream/master' into rl-next 2025-05-14 18:14:55 -04:00
Sergei Zimmerman
d955b401a7
libutil: Sprinkle some noexcept on LRUCache::{size,clear}
The underlying containers are already noexcept to destroy and dtors are
noexcept in general.
2025-05-14 22:14:46 +00:00
John Ericson
8557f08327
Merge pull request #13190 from roberth/render-upcoming-notes
Render upcoming notes
2025-05-14 18:14:23 -04:00