1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00
Commit graph

18850 commits

Author SHA1 Message Date
mergify[bot]
d99bcd62eb
Merge pull request #12529 from NixOS/mergify/bp/2.25-maintenance/pr-12439
Set FD_CLOEXEC on sockets created by curl (backport #12439)
2025-02-19 20:21:40 +00:00
MaxHearnden
a5fa357fdf Set FD_CLOEXEC on sockets created by curl
Curl creates sockets without setting FD_CLOEXEC/SOCK_CLOEXEC, this can
cause connections to remain open forever when using commands like `nix
shell`

This change sets the FD_CLOEXEC flag using a CURLOPT_SOCKOPTFUNCTION
callback.

(cherry picked from commit 12d2527276)
2025-02-19 19:47:45 +00:00
mergify[bot]
9e7663fe38
Merge pull request #12522 from NixOS/mergify/bp/2.25-maintenance/pr-12518
packaging: Restore libgit2 USE_SSH=exec (backport #12518)
2025-02-19 09:18:52 +00:00
Robert Hensing
e2558b8c26 packaging: Restore libgit2 USE_SSH=exec
... when nixpkgs is nixos-unstable or the overlay is used.

(cherry picked from commit 5488e29d2f)
2025-02-19 10:10:45 +01:00
mergify[bot]
9442b9bd7b
Merge pull request #12516 from NixOS/mergify/bp/2.25-maintenance/pr-12484
Support libgit2 1.9.0 (backport #12484)
2025-02-18 23:32:16 +00:00
Robert Hensing
c03bde0133 Support libgit2 1.9.0
For when the overlay is used with nixos-unstable.
1.9.0 has our patches.

(cherry picked from commit b0bbb1252a)
2025-02-19 00:26:46 +01:00
mergify[bot]
d652513e45
Merge pull request #12452 from NixOS/mergify/bp/2.25-maintenance/pr-12448
copyPathToStore(): Preserve symlinks (backport #12448)
2025-02-12 20:00:54 +00:00
Eelco Dolstra
4aba8ad022
Delete unused test 2025-02-12 20:05:02 +01:00
Eelco Dolstra
d856328ab5
Fix build 2025-02-12 20:04:48 +01:00
Eelco Dolstra
9e83b1aa19
Merge pull request #12456 from NixOS/mergify/bp/2.25-maintenance/pr-12450
packaging/components.nix: Don't import a symlink (backport #12450)
2025-02-12 12:48:48 +01:00
Eelco Dolstra
a0fb43e229 Don't import a symlink
This is a workaround to avoid differing evaluation results between Nix
2.19 and >= 2.20 (#12449).

(cherry picked from commit 2e20a5f822)
2025-02-12 11:41:45 +00:00
Eelco Dolstra
7bfd71e10d copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.

(cherry picked from commit 26b87e78b5)
2025-02-11 21:51:38 +00:00
mergify[bot]
37393f0c69
Merge pull request #12366 from NixOS/mergify/bp/2.25-maintenance/pr-12362
refactor: Extract EvalState::realiseString (backport #12362)
2025-01-27 16:19:54 +00:00
Robert Hensing
7d3021f59f refactor: Extract EvalState::realiseString
(cherry picked from commit 7465fbe926)
2025-01-27 15:51:13 +00:00
mergify[bot]
95253b1f7c
Merge pull request #12358 from NixOS/mergify/bp/2.25-maintenance/pr-12356
Improve "illegal path references in fixed output derivation" error (backport #12356)
2025-01-26 20:12:55 +00:00
Ben Millwood
3fd1316438 Improve "illegal path references in fixed output derivation" error
The main improvement is that the new message gives an example of a path
that is referenced, which should make it easier to track down. While
there, I also clarified the wording, saying exactly why the paths in
question were illegal.

(cherry picked from commit 4e5d1b281e)
2025-01-26 19:38:50 +00:00
Robert Hensing
79a2993e23
Merge pull request #12353 from NixOS/nixfmt-on-2.25
Apply nixfmt (backport 2.25)
2025-01-24 22:41:36 +01:00
Robert Hensing
c69579114b test: Fix shifted source positions after formatting 2025-01-24 22:09:21 +01:00
Robert Hensing
24c78e06cf Format .nix files
This does not include any automation for the release branch, but
is based on the configuration of https://github.com/NixOS/nix/pull/12349

    pre-commit run -a nixfmt-rfc-style
2025-01-24 20:37:38 +01:00
mergify[bot]
566b33b0bd
Merge pull request #12345 from NixOS/mergify/bp/2.25-maintenance/pr-12336
libstore: Fix progress bars (backport #12336)
2025-01-24 11:47:01 +00:00
Philipp Otterbein
6224d87564 libstore: fix progress bars
(cherry picked from commit be97dc1efc)
2025-01-24 11:10:36 +00:00
Eelco Dolstra
636c9cfdf0
Merge pull request #12333 from NixOS/mergify/bp/2.25-maintenance/pr-12331
GitRepo::fetch(): Ignore $GIT_DIR (backport #12331)
2025-01-22 22:04:19 +01:00
Eelco Dolstra
e64fcf62f9 GitRepo::fetch(): Ignore $GIT_DIR
Fixes #12325.

(cherry picked from commit 41983dba8f)
2025-01-22 20:30:25 +00:00
Eelco Dolstra
08d4e67e84 GitRepo::fetch(): Cleanup
(cherry picked from commit bd10b859f7)
2025-01-22 20:30:25 +00:00
Eelco Dolstra
5d2f26e3f6 Bump version 2025-01-22 10:29:21 +01:00
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 https://github.com/NixOS/nix/actions/runs/12872412321/job/35887830320?pr=12310
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