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

19163 commits

Author SHA1 Message Date
Travis A. Everett
6a874c2865 sequoia-nixbld-user-migration: nail down PATH
Fixes a user report of trouble with toybox grep and avoids
potential of same basic issue with other utils.
2025-01-15 08:59:14 -06:00
Eelco Dolstra
ff9d886f3c Use isAbsolute() 2025-01-14 17:42:26 +01:00
Eelco Dolstra
ff8e2fe84e Fix relative 'path:' flakerefs in the CLI
And handle relative 'git+file:' flakerefs while we're at it (these
crashed with an assertion failure).

Fixes #12248.
2025-01-14 17:30:13 +01:00
Eelco Dolstra
6cc5b48a29 Add release note 2025-01-14 14:51:49 +01:00
Eelco Dolstra
8aafc05885
Merge pull request #12253 from nix-windows/windows-create-writable-files
windows: create files if they don't exist, and with write permission
2025-01-14 13:52:08 +01:00
Brian McKenna
0be55f869b windows: create files if they don't exist, and with write permission 2025-01-14 16:46:31 +11:00
Jörg Thalheim
2cb0ddfe4e
Merge pull request #12245 from siddarthkay/fix-typo-in-error-message
scripts/install-multi-user: fix typo
2025-01-13 21:05:28 +01:00
Eelco Dolstra
cd0127f957 Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-13 14:13:56 +01:00
Eelco Dolstra
a78f998cc7
Merge pull request #12238 from apoelstra/2025-01--unsorted-gc
gc: replace ordered sets with unordered sets for in-memory caches
2025-01-13 13:33:12 +01:00
Siddarth Kumar
fd053fdcad
scripts/install-multi-user: fix typo 2025-01-13 14:12:41 +05:30
Jörg Thalheim
140aee33a3
Merge pull request #12235 from martinetd/add_multi_uaf
libutil: thread-pool: ensure threads finished on error
2025-01-13 09:01:43 +01:00
Robert Hensing
01f5cf2c02
Merge pull request #12237 from NixOS/reject-conflicts
Reject merge conflicts
2025-01-12 22:21:10 +01:00
Andrew Poelstra
4fac767b52
gc: replace ordered sets with unordered sets for in-memory caches
During garbage collection we cache several things -- a set of known-dead
paths, a set of known-alive paths, and a map of paths to their derivers.
Currently they use STL maps and sets, which are ordered structures that
typically are backed by binary trees. Since we are putting pseudorandom
paths into these and looking them up by exact key, we don't need the
ordering, and we're paying a nontrivial cost per insertion.

The existing maps require O(n log n) memory and have O(log n) insertion
and lookup time.

We could instead use unordered maps, which are typically backed by
hashmaps. These require O(n) memory and have O(1) insertion and lookup
time.

On my system this appears to result in a dramatic speedup -- prior to
this patch I was able to delete 400k paths out of 9.5 million over the
course of 34.5 hours. After this patch the same result took 89 minutes.

This result should NOT be taken at face value because the two runs
aren't really comparable; in particular the first started when I had 9.5
million store paths and the seconcd started with 7.8 million, so we are
deleting a different set of paths starting from a much cleaner
filesystem. But I do think it's indicative.

Related: https://github.com/NixOS/nix/issues/9581
2025-01-12 20:23:36 +00:00
Robert Hensing
29a1a21ce4 Reject merge conflicts
They're usually found by other checks, but docs would remain
susceptible.
2025-01-12 13:53:21 +01:00
Dominique Martinet
afac093b34 libutil: thread-pool: ensure threads finished on error
This fixes segfaults with nix copy when there was an error processing
addMultipleToStore.

Running with ASAN/TSAN pointed at an use-after-free with threads from
the pool accessing the graph declared in processGraph after the function
was exiting and destructing the variables.

It turns out that if there is an error before pool.process() is called,
for example while we are still enqueuing tasks, then pool.process()
isn't called and threads are still left to run.

By creating the pool last we ensure that it is stopped first before
running other destructors even if an exception happens early.

[ lix porting note: nix does not name threads so the patch has been
adapted to not pass thread name ]

Link: https://git.lix.systems/lix-project/lix/issues/618
Link: https://gerrit.lix.systems/c/lix/+/2355
2025-01-12 15:11:13 +09:00
mergify[bot]
a44ae8b5a9
Merge pull request #12152 from Mic92/dscl
scripts/install-darwin-multi-user: workaround dscl failing sometimes
2025-01-11 21:11:13 +00:00
mergify[bot]
84f116e3cf
Merge pull request #12167 from RossComputerGuy/fix/unsupported-type-docker
nix flake: clarify error message when file is an unknown type
2025-01-11 20:44:06 +00:00
mergify[bot]
d155e349fc
Merge pull request #12166 from DeterminateSystems/upgrade-nix-error-msg
nix upgrade-nix: Give a better error message if the profile is using 'nix profile'
2025-01-11 20:03:17 +00:00
Tristan Ross
47cf93ba80
Add LLVM to Flake 2025-01-10 18:08:27 -08:00
Eelco Dolstra
e161393299 Add setting 'allow-dirty-locks'
This allows writing lock files with dirty inputs, so long as they have
a NAR hash. (Currently they always have a NAR hash, but with lazy
trees that may not always be the case.)

Generally dirty locks are bad for reproducibility (we can detect if
the dirty input has changed, but we have no way to fetch it except
substitution). Hence we don't allow them by default.

Fixes #11181.
2025-01-10 17:55:30 +01:00
Tristan Ross
22adffec34
nix flake: clarify error message when file is an unknown type 2025-01-10 08:07:51 -08:00
Robert Hensing
d9a50c0af2
Clarify cd call in tests/functional/flakes/flakes.sh 2025-01-10 09:57:54 +01:00
Bryan Lai
37ac18d1d9 tests/flake-in-submodule: git+file:./* input 2025-01-10 11:44:55 +08:00
Bryan Lai
9d088fa502 tests/flakes: check git+file:./${submodule} protocol
Relative, local git repo used to work (for submodules), but it
fails after 3e0129ce3b.

This commit adds a test to prevent such failure in the future.
2025-01-10 11:37:29 +08:00
Bryan Lai
96bd9bad2f fetchers/git: make path absolute for local repo 2025-01-10 11:37:29 +08:00
Eelco Dolstra
fccfdbea57 nix upgrade-nix: Give a better error message if the profile is using 'nix profile' 2025-01-09 20:44:25 +01:00
Jörg Thalheim
2d9b213cc2
Merge pull request #12157 from DeterminateSystems/fix-path-flakeref-query-without-fragment
parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
2025-01-09 17:40:04 +01:00
Eelco Dolstra
9b9e416836
Merge pull request #12160 from Mic92/deadlock
derivation-goal: unlock output lock to avoid deadlock
2025-01-09 16:54:23 +01:00
Eelco Dolstra
3ad0f45e79 Attempt to make the FlakeRef test succeed on macOS 2025-01-09 16:42:37 +01:00
Eelco Dolstra
1a38e62a09 Remove unused variable 2025-01-09 16:38:33 +01:00
Eelco Dolstra
5f7b535b81 parsePathFlakeRefWithFragment(): Add unit tests 2025-01-09 12:18:16 +01:00
Eelco Dolstra
83ff523865 parsePathFlakeRefWithFragment(): Handle query params in the non-git case
Backported from lazy-trees.
2025-01-09 12:17:09 +01:00
Jörg Thalheim
3d877ecae4 derivation-goal: unlock output lock to avoid deadlock
guix discovered in their code base. Maybe we should do the same.
2025-01-08 22:15:51 +01:00
Eelco Dolstra
28caa35a97 parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
Commands like `nix flake metadata '.?submodules=1'` ignored the query
part of the URL, while `nix build '.?submodules=1#foo'` did work
correctly because of the presence of the fragment part.
2025-01-08 18:38:53 +01:00
Jörg Thalheim
ed4f2c3204 scripts/install-darwin-multi-user: workaround dscl failing sometimes 2025-01-08 18:03:50 +01:00
Domagoj Mišković
5230d3ecc4
Document --max-freed for nix-collect-garbage (#12155)
* Update nix-collect-garbage.md

Referencing issue at: https://github.com/NixOS/nix/issues/12132

Copied the description of `--max-freed` option from 442a2623e4/doc/manual/source/command-ref/nix-store/gc.md (L39-L44)
2025-01-08 14:20:44 +01:00
Valentin Gagarin
8bec777c9d
Merge pull request #12154 from allrealmsoflife/patch-1 2025-01-08 10:55:23 +01:00
Domagoj Mišković
3a5fccc418
outdated building instructions, update documentation.md
The current instructions for building the Nix manual include a command that doesn't work as described. Specifically:

```
nix build .#nix^doc
```

Running this command results in the error:

```
error: derivation '/nix/store/hddqxzfqgx2fhj8q66ss3idym7pk7aj1-nix-2.26.0pre20250107_383ab87.drv' does not have wanted outputs 'doc'
```

However, this command works if you specify the Nix version explicitly, such as:

```
nix build nix/2.24.11#nix^doc
```

Additionally, these commands are run within the Nix root directory. 

However, the nix build .#nix^doc command does work when run from the nixpkgs directory and generates the NixOS manual.

I'm not sure if I'm missing something. Is the `nix^doc` supposed to be added somehow to flake outputs?

The incremental build section does not work since as make has been decommissioned in favor of Meson. Should this be simply deleted?
2025-01-08 09:42:26 +01:00
mergify[bot]
2f3bc6c015
Merge pull request #12149 from DeterminateSystems/remove-url-field
ParsedURL: Remove 'url' and 'base' fields
2025-01-07 19:16:07 +00:00
Eelco Dolstra
d329b2632a Fix manual 2025-01-07 17:04:06 +01:00
Eelco Dolstra
4077aa43a8 ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
Eelco Dolstra
f705ce7f9a ParsedURL: Remove url field
This prevents a 'url' field that is out of sync with the other
fields. You can use to_string() to get the full URL.
2025-01-07 14:46:03 +01:00
Eelco Dolstra
ef2739b7c9 Example of referencing parent directories 2025-01-07 14:01:49 +01:00
Eelco Dolstra
0792152627 Rename Override -> OverrideTarget 2025-01-07 13:54:19 +01:00
Eelco Dolstra
e8c7dd9971 Rename allowRelative -> preserveRelativePaths 2025-01-07 13:44:08 +01:00
Eelco Dolstra
75cda2da7f
Document path values in inputs
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-01-07 13:40:18 +01:00
Eelco Dolstra
a0901e5588
Merge pull request #12143 from Mic92/installer-test-name
mergify: fix installer test name
2025-01-07 11:54:37 +01:00
Jörg Thalheim
383ab87da3
Merge pull request #12046 from roberth/cli-symlink-fixes
CLI symlink fixes
2025-01-07 07:01:59 +01:00
Robert Hensing
4c74d679b6 test: Avoid regressing accidental use of weakly_canonical instead of makeParentCanonical
I'd messed up a rebase in my previous iteration, causing `weakly_canonical` to reappear,
but not trigger a test failure.

These two functions behave similarly when the argument is a path that points to a broken
symlink. `weakly_canonical` would not resolve it because the target doesn't exist, and
`makeParentCanonical` would not resolve it, because it never resolves the final path
element.
This new test case now also tests a valid symlink, "differentiating" the two.
2025-01-07 05:42:04 +00:00
Jörg Thalheim
5a5a86949a makeParentCanonical: test case where parent is empty 2025-01-07 05:42:04 +00:00