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

18825 commits

Author SHA1 Message Date
mergify[bot]
132c992ce0
Merge pull request #12319 from NixOS/mergify/bp/2.25-maintenance/pr-12315
tests: Wait for network *online* targets and/or multi-user targets (more) (backport #12315)
2025-01-20 18:28:05 +00:00
Robert Hensing
0284eef493 tests: Wait for network *online* targets
More prevalent than I thought in 15073e86a

See also 3588783032
which is a failed github-flakes test without "Network is Online"

(cherry picked from commit 6f0bdd9ae7)

# Conflicts:
#	tests/nixos/nix-docker.nix
2025-01-20 18:16:43 +00:00
Eelco Dolstra
df5246dd8e
Merge pull request #12310 from NixOS/mergify/bp/2.25-maintenance/pr-12302
tests: Wait for network *online* and multi-user targets (backport #12302)
2025-01-20 18:19:24 +01:00
Robert Hensing
8b205302f3 tests: Wait for network *online* and multi-user targets
This should help prevent some test stalls.

By default, multi-user.target does not imply that the network is fully up.

(cherry picked from commit 15073e86a8)
2025-01-20 16:40:04 +00:00
Eelco Dolstra
8e87c19125
Merge pull request #12308 from NixOS/mergify/bp/2.25-maintenance/pr-12294
processGraph(): Don't throw ThreadPoolShutDown if there is an exception (backport #12294)
2025-01-20 17:19:12 +01:00
Eelco Dolstra
c38234bffb
Merge pull request #12300 from NixOS/mergify/bp/2.25-maintenance/pr-12296
addMultipleToStore(): Move pathsToCopy (backport #12296)
2025-01-20 16:26:35 +01:00
Eelco Dolstra
4d0e2b5ade processGraph(): Don't throw ThreadPoolShutDown if there is an exception
Fixes

  $ nix copy --derivation --to /tmp/nix /nix/store/...
  error: cannot enqueue a work item while the thread pool is shutting down

The ThreadPoolShutDown exception was hiding the reason for the thread
pool shut down, e.g.

  error: cannot add path '/nix/store/03sl46khd8gmjpsad7223m32ma965vy9-fix-static.patch' because it lacks a signature by a trusted key

(cherry picked from commit a8c69cc907)
2025-01-20 15:24:55 +00:00
Eelco Dolstra
aabf6e6c65 Add comment
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
(cherry picked from commit 2669e4ac4f)
2025-01-20 14:18:26 +00:00
Eelco Dolstra
7dd6b980aa addMultipleToStore(): Move pathsToCopy
This allows RemoteStore::addMultipleToStore() to free the Source
objects early (and in particular the associated sinkToSource()
buffers). This should fix #7359. For example, memory consumption of

  nix copy --derivation --to ssh-ng://localhost?remote-store=/tmp/nix --derivation --no-check-sigs \
    /nix/store/4p9xmfgnvclqpii8pxqcwcvl9bxqy2xf-nixos-system-...drv

went from 353 MB to 74 MB.

(cherry picked from commit cc838e8181)
2025-01-20 14:18:25 +00:00
Eelco Dolstra
daf101d487
Merge pull request #12280 from DeterminateSystems/fix-2.25-build
Don't absolutize 'git+file:' in parseURLFlakeRef()
2025-01-17 13:45:37 +01:00
Eelco Dolstra
938f0f4fd9 Don't absolutize 'git+file:' in parseURLFlakeRef()
https://github.com/NixOS/nix/issues/12273#issuecomment-2596069519
2025-01-16 19:17:08 +01:00
Eelco Dolstra
40bb5ec675
Merge pull request #12269 from NixOS/mergify/bp/2.25-maintenance/pr-12254
Fix relative 'path:' flakerefs in the CLI (backport #12254)
2025-01-15 21:54:43 +01:00
mergify[bot]
98506a5ef1
Merge pull request #12266 from NixOS/mergify/bp/2.25-maintenance/pr-12107
fetchers/git: make relative path absolute for local repo (backport #12107)
2025-01-15 20:46:25 +00:00
Eelco Dolstra
639f526405 Use isAbsolute()
(cherry picked from commit ff9d886f3c)
2025-01-15 20:20:46 +00:00
Eelco Dolstra
0b57e7daf5 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.

(cherry picked from commit ff8e2fe84e)
2025-01-15 20:20:45 +00:00
Robert Hensing
dcfd80610b Clarify cd call in tests/functional/flakes/flakes.sh
(cherry picked from commit d9a50c0af2)
2025-01-15 19:56:17 +00:00
Bryan Lai
4fea745fe0 tests/flake-in-submodule: git+file:./* input
(cherry picked from commit 37ac18d1d9)
2025-01-15 19:56:17 +00:00
Bryan Lai
335e0d9508 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.

(cherry picked from commit 9d088fa502)
2025-01-15 19:56:16 +00:00
Bryan Lai
6963fd4027 fetchers/git: make path absolute for local repo
(cherry picked from commit 96bd9bad2f)
2025-01-15 19:56:16 +00:00
mergify[bot]
b8264c4c54
Merge pull request #12260 from NixOS/mergify/bp/2.25-maintenance/pr-11922
gc: resume GC after a pathinuse error (backport #11922)
2025-01-15 16:31:35 +00:00
Picnoir
30ef0a1f4c gc: resume GC after a pathinuse error
First the motivation: I recently faced a bug that I assume is coming
from the topoSortPaths function where the GC was trying to delete a
path having some alive referrers. I resolved this by manually deleting
the faulty path referrers using nix-store --query --referrers. I sadly
did not manage to reproduce this bug.

This bug alone is not a big deal. However, this bug is
triggering a cascading failure: invalidatePathChecked is throwing a
PathInUse exception. This exception is not catched and fails the whole GC
run. From there, the machine (a builder machine) was unable to GC its
Nix store, which led to an almost full disk with no way to
automatically delete the dead Nix paths.

Instead, I think we should log the error for the specific store path
we're trying to delete, specifying we can't delete this path because
it still has referrers. Once we're done with logging that, the GC run
should continue to delete the dead store paths it can delete.

(cherry picked from commit ced8d311a5)
2025-01-15 15:59:26 +00:00
Eelco Dolstra
50a7056b02 Bump version 2025-01-14 14:40:30 +01:00
mergify[bot]
4c35e6ec6e
Merge pull request #12247 from NixOS/mergify/bp/2.25-maintenance/pr-12245
scripts/install-multi-user: fix typo (backport #12245)
2025-01-13 20:15:49 +00:00
Siddarth Kumar
3f96cfd99c scripts/install-multi-user: fix typo
(cherry picked from commit fd053fdcad)
2025-01-13 20:06:13 +00:00
Eelco Dolstra
5b32a021a9 Bump version 2025-01-13 16:55:24 +01:00
Jörg Thalheim
cadd9fbe88
Merge pull request #12243 from NixOS/mergify/bp/2.25-maintenance/pr-12235
libutil: thread-pool: ensure threads finished on error (backport #12235)
2025-01-13 09:42:12 +01:00
Dominique Martinet
0ccd1fa0a4 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
(cherry picked from commit afac093b34)
2025-01-13 08:03:12 +00:00
mergify[bot]
8615df48a1
Merge pull request #12232 from NixOS/mergify/bp/2.25-maintenance/pr-12166
nix upgrade-nix: Give a better error message if the profile is using 'nix profile' (backport #12166)
2025-01-11 21:00:48 +00:00
Eelco Dolstra
6b03f1219e nix upgrade-nix: Give a better error message if the profile is using 'nix profile'
(cherry picked from commit fccfdbea57)
2025-01-11 20:07:00 +00:00
mergify[bot]
08cd0acf65
Merge pull request #12210 from NixOS/mergify/bp/2.25-maintenance/pr-11294
parser-state: fix attribute merging (backport #11294)
2025-01-10 20:39:33 +00:00
mergify[bot]
40e35dc567
Merge pull request #12189 from NixOS/mergify/bp/2.25-maintenance/pr-11853
fix(libmain/common-args): do not exceed maximum allowed verbosity (backport #11853)
2025-01-10 18:55:16 +00:00
mergify[bot]
1521a82077
Merge pull request #12184 from NixOS/mergify/bp/2.25-maintenance/pr-12051
Skip tests on systems with restricted usernamespaces (backport #12051)
2025-01-10 18:55:14 +00:00
mergify[bot]
009de1f7ac
Merge pull request #12179 from NixOS/mergify/bp/2.25-maintenance/pr-12103
fix: ignore symlinks in fsync-store-paths (backport #12103)
2025-01-10 18:55:11 +00:00
mergify[bot]
7a7a3d20d1
Merge pull request #12177 from NixOS/mergify/bp/2.25-maintenance/pr-12114
fix documentation of substring (backport #12114)
2025-01-10 18:55:08 +00:00
mergify[bot]
70ab8bbb28
Merge pull request #12175 from NixOS/mergify/bp/2.25-maintenance/pr-12115
libcmd: update to support lowdown-1.4 API (backport #12115)
2025-01-10 18:55:05 +00:00
Eelco Dolstra
c902a299a8
Merge pull request #12164 from NixOS/mergify/bp/2.25-maintenance/pr-12157
parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment (backport #12157)
2025-01-10 18:11:30 +01:00
Eelco Dolstra
dee91873bc
Merge pull request #12186 from NixOS/mergify/bp/2.25-maintenance/pr-12016
Disable suid and atime on the /nix mount point on Darwin (backport #12016)
2025-01-10 15:19:26 +01:00
Eelco Dolstra
31d6afb476
Merge pull request #12181 from NixOS/mergify/bp/2.25-maintenance/pr-12091
libstore: fixup unformatted uri when S3 getObject fails (backport #12091)
2025-01-10 15:17:50 +01:00
Eelco Dolstra
ef1e704707 Attempt to make the FlakeRef test succeed on macOS
(cherry picked from commit 3ad0f45e79)
2025-01-10 13:37:40 +01:00
Eelco Dolstra
21fe544ed9 Remove unused variable
(cherry picked from commit 1a38e62a09)
2025-01-10 13:37:36 +01:00
Eelco Dolstra
e1178b8a39 parsePathFlakeRefWithFragment(): Add unit tests
(cherry picked from commit 5f7b535b81)
2025-01-10 13:37:32 +01:00
Eelco Dolstra
31fa189123 parsePathFlakeRefWithFragment(): Handle query params in the non-git case
Backported from lazy-trees.

(cherry picked from commit 83ff523865)
2025-01-10 13:37:28 +01:00
Eelco Dolstra
faecb6e306 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.

(cherry picked from commit 28caa35a97)
2025-01-10 13:37:23 +01:00
Eelco Dolstra
200e3be41a ParsedURL: Remove base field
(cherry picked from commit 4077aa43a8)
2025-01-10 13:37:05 +01:00
Eelco Dolstra
8856b5f2ca 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.

(cherry picked from commit f705ce7f9a)
2025-01-10 13:37:00 +01:00
Eelco Dolstra
aa5246bfe3 Drop std::make_pair
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
(cherry picked from commit ebb19cc1cd)
2025-01-10 13:36:43 +01:00
Eelco Dolstra
8b4a89f4bb Clean up flakeref parsing
This factors out some commonality in calling fromURL() and handling
the "dir" parameter into a fromParsedURL() helper function.

(cherry picked from commit 850281908c)
2025-01-10 13:36:37 +01:00
Eelco Dolstra
ab4159ff99
Merge pull request #12174 from NixOS/mergify/bp/2.25-maintenance/pr-12127
toJSON: re-throw serialization exception (backport #12127)
2025-01-10 13:32:53 +01:00
mergify[bot]
b9f89c846d
Merge pull request #12171 from NixOS/mergify/bp/2.25-maintenance/pr-12155
Document `--max-freed` for `nix-collect-garbage` (backport #12155)
2025-01-10 11:00:31 +00:00
Ryan Hendrickson
5575a2f1c3 parser-state: fix attribute merging
(cherry picked from commit 8034589d7e)
2025-01-10 10:40:07 +00:00