1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
Commit graph

21424 commits

Author SHA1 Message Date
Eelco Dolstra
aa657c1679 Revert "Merge pull request #14382 from NixOS/backport-14364-to-2.32-maintenance"
This reverts commit 5c9481de19,
reversing changes made to
291e8ab6bd. This is a behaviour change
that should be avoided on maintenance branches.
2025-11-06 22:10:42 +01:00
internal-nix-ci[bot]
a4fb83a239
Merge pull request #14498 from NixOS/backport-14491-to-2.32-maintenance
[Backport 2.32-maintenance] Don't crash on flakerefs containing newlines
2025-11-06 19:38:36 +00:00
Eelco Dolstra
47ba375285 Don't crash on flakerefs containing newlines
Fixes #14311.

(cherry picked from commit c1317017e9)
2025-11-06 19:18:16 +00:00
internal-nix-ci[bot]
5c9e22d75a
Merge pull request #14485 from NixOS/backport-14482-to-2.32-maintenance
[Backport 2.32-maintenance] nix flake check: Remove incorrect assertion
2025-11-05 20:23:17 +00:00
Eelco Dolstra
e6d823e46d nix flake check: Remove incorrect assertion
The assumption that no unknown paths can be returned is incorrect. It
can happen if a derivation has outputs that are substitutable, but
that have references that cannot be substituted (i.e. an incomplete
closure in the binary cache). This can easily happen with
magic-nix-cache.

(cherry picked from commit a828cf777a)
2025-11-05 19:51:29 +00:00
internal-nix-ci[bot]
038cc7913b
Merge pull request #14461 from NixOS/backport-14450-to-2.32-maintenance
[Backport 2.32-maintenance] flake: Update, nixos-25.05-small -> nixos-25.05
2025-11-03 17:43:37 +00:00
Robert Hensing
828bf74cd0 Apply updated nixfmt
(cherry picked from commit 81a2809a52)
2025-11-03 17:08:34 +00:00
Robert Hensing
ec122cbfda flake: Update, nixos-25.05-small -> nixos-25.05
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/d98ce345cdab58477ca61855540999c86577d19d?narHash=sha256-O2CIn7HjZwEGqBrwu9EU76zlmA5dbmna7jL1XUmAId8%3D' (2025-08-26)
  → 'github:NixOS/nixpkgs/daf6dc47aa4b44791372d6139ab7b25269184d55?narHash=sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8%2BON/0Yy8%2Ba5vsDU%3D' (2025-10-27)

(cherry picked from commit 233bd250d1)
2025-11-03 17:08:34 +00:00
internal-nix-ci[bot]
e1ff27324b
Merge pull request #14438 from NixOS/backport-14434-to-2.32-maintenance
[Backport 2.32-maintenance] libstore: Improve store-reference back-compat with IPv6 ZoneId literals
2025-11-01 00:18:55 +00:00
Sergei Zimmerman
7b41563055 libstore: Improve store-reference back-compat with IPv6 ZoneId literals
This restores the pre-2.31 handling of ZoneID identifiers in store references.
It's the only place we reasonably care about this back-compat.

(cherry picked from commit 8dbc2475f7)
2025-10-31 23:50:22 +00:00
internal-nix-ci[bot]
7f9b9c3638
Merge pull request #14436 from NixOS/backport-14431-to-2.32-maintenance
[Backport 2.32-maintenance] libfetchers: Restore plain git inputs recognition
2025-10-31 23:25:25 +00:00
Sergei Zimmerman
ed09f1b4d9 libfetchers: Restore plain git inputs recognition
Accidentally broken in dbc235cc62.
Adds a bit of tests for this, even though this protocol is mostly deprecated
everywhere.

(cherry picked from commit ade3d5d746)
2025-10-31 23:01:54 +00:00
internal-nix-ci[bot]
fc6811cb51
Merge pull request #14435 from NixOS/backport-14432-to-2.32-maintenance
[Backport 2.32-maintenance] meson: Also split version string at '+' for Darwin
2025-10-31 22:24:18 +00:00
Sergei Zimmerman
a24df3d4e5 meson: Also split version string at '+' for Darwin
(cherry picked from commit 1ca6e9ef54)
2025-10-31 21:47:27 +00:00
internal-nix-ci[bot]
e6003b5c4f
Merge pull request #14430 from NixOS/backport-14137-to-2.32-maintenance
[Backport 2.32-maintenance] fix(libstore/build/derivation-goal): don't assert on partially valid outputs
2025-10-31 20:59:43 +00:00
Bernardo Meurer Costa
f566957dc4
fix(libstore/build/derivation-goal): don't assert on partially valid outputs
Fixes: #14130
(cherry picked from commit 9eecee3d4e)
2025-10-31 23:30:03 +03:00
internal-nix-ci[bot]
f434a3e3c6
Merge pull request #14413 from NixOS/backport-14410-to-2.32-maintenance
[Backport 2.32-maintenance] zsh/completion: put compdef on first line
2025-10-29 16:17:24 +00:00
bryango
939f81c2e6 zsh/completion: put compdef on first line
Some zsh setups (including mine) do not load the
completion if `#compdef` is not on the first line.

So we move the `# shellcheck` comment to the
second line to avoid this issue.

(cherry picked from commit 956fffdd6f)
2025-10-29 15:58:06 +00:00
internal-nix-ci[bot]
758dacacf4
Merge pull request #14409 from NixOS/backport-14289-to-2.32-maintenance
[Backport 2.32-maintenance] Fix issue #14287
2025-10-29 08:29:01 +00:00
John Ericson
9e4177bc67 Fix issue #14287
The test added in the previous commit now passes.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit de192794c9)
2025-10-29 07:59:08 +00:00
John Ericson
328a3bbbd0 Regression test for issue #14287
This will currently fail, until the bug is fixed.

Co-Authored-By: Sergei Zimmerman <sergei@zimmerman.foo>
(cherry picked from commit 246dbe1c05)
2025-10-29 07:59:08 +00:00
internal-nix-ci[bot]
5c9481de19
Merge pull request #14382 from NixOS/backport-14364-to-2.32-maintenance
[Backport 2.32-maintenance] diff-closures: print sizes with dynamic unit
2025-10-27 20:52:05 +00:00
Marcel
ebadea0734 treewide: replace manual MiB calculations with renderSize
(cherry picked from commit 584a8e8a00)
2025-10-27 19:43:40 +00:00
Marcel
7d7ca3fe96 refactor(libutil): remove showBytes() in favor of renderSize()
The `showBytes()` function was redundant with `renderSize()` as the
latter automatically selects the appropriate unit (KiB, MiB, GiB, etc.)
based on the value, whereas `showBytes()` always formatted as MiB
regardless of size.

Co-authored-by: Bernardo Meurer Costa <beme@anthropic.com>
(cherry picked from commit f234633e27)
2025-10-27 19:43:40 +00:00
Marcel
3a92f83e75 diff-closures: print sizes with dynamic unit
(cherry picked from commit 9d4d10954a)
2025-10-27 19:43:40 +00:00
Eelco Dolstra
291e8ab6bd
Merge pull request #14372 from NixOS/backport-14362-to-2.32-maintenance
[Backport 2.32-maintenance] libexpr: Speed up BindingsBuilder::finishSizeIfNecessary
2025-10-27 16:41:28 +01:00
Eelco Dolstra
19441dd317 Bump version 2025-10-27 16:36:00 +01:00
internal-nix-ci[bot]
71ec2cf62d
Merge pull request #14371 from NixOS/backport-14340-to-2.32-maintenance
[Backport 2.32-maintenance] nix-2.32 needs boost-1.87+ for `try_emplace_and_cvisit`
2025-10-27 15:01:12 +00:00
Sergei Zimmerman
b36f8043d2 libexpr: Speed up BindingsBuilder::finishSizeIfNecessary
Instead of iterating over the newly built bindings we can
do a cheaper set_intersection to count duplicates or fall back
to a per-element binary search over the "base" bindings.

This speeds up `hello` evaluation by around 10ms (0.196s -> 0.187s) and
`nixos.closures.ec2.x86_64-linux` by 140ms (2.744s -> 2.609s).

This addresses a somewhat steep performance regression from 82315c3807
that reduced memory requirements of attribute set merges. With this patch
we get back around to 2.31 level of eval performance while keeping the memory
usage optimization.

Also document the optimization a bit more.

(cherry picked from commit ec2fd2dc23)
2025-10-27 14:40:17 +00:00
Jens Petersen
4d1f72a324 libexpr needs boost-1.87+ for try_emplace_and_cvisit
Since 2.32, nix now needs boost 1.87 or later to build,
due to using unordered::concurrent_flat_map try_emplace_and_cvisit

../src/libexpr/eval.cc: In member function ‘void nix::EvalState::evalFile(const nix::SourcePath&, nix::Value&, bool)’:
../src/libexpr/eval.cc:1096:20: error: ‘class boost::unordered::concurrent_flat_map<nix::SourcePath, nix::Value*, std::hash<nix::SourcePath>, std::equal_to<nix::SourcePath>, traceable_allocator<std::pair<const nix::SourcePath, nix::Value*> > >’ has no member named ‘try_emplace_and_cvisit’; did you mean ‘try_emplace_or_cvisit’?
 1096 |     fileEvalCache->try_emplace_and_cvisit(
      |                    ^~~~~~~~~~~~~~~~~~~~~~
      |                    try_emplace_or_cvisit

See 834580b539

(cherry picked from commit f594a8e11e)
2025-10-27 14:28:38 +00:00
internal-nix-ci[bot]
ac3532d0f2
Merge pull request #14354 from NixOS/backport-14343-to-2.32-maintenance
[Backport 2.32-maintenance] Revert "libmain: Catch logger exceptions in `handleExceptions`"
2025-10-25 00:00:15 +00:00
Sergei Zimmerman
84dbf182d4 Revert "libmain: Catch logger exceptions in handleExceptions"
This reverts commit 90d1ff4805.

The initial issue with EPIPE was solved in 9f680874c5.
Now this patch does move bad than good by eating up boost::io::format_error that are
bugs.

(cherry picked from commit 4f5af471fb)
2025-10-24 23:28:53 +00:00
internal-nix-ci[bot]
4a27d70132
Merge pull request #14280 from NixOS/backport-14276-to-2.32-maintenance
[Backport 2.32-maintenance] libstore/registerOutputs: Don't try to optimize a non-existent actual…
2025-10-16 22:17:53 +00:00
Sergei Zimmerman
dadb5b01b7 libstore/registerOutputs: Don't try to optimize a non-existent actualPath
Since 3c610df550 this resulted in `getting status of`
errors on paths inside the chroot if a path was already valid. Careful inspection
of the logic shows that if buildMode != bmCheck actualPath gets reassigned to
store.toRealPath(finalDestPath). The only branch that cares about actualPath is
the buildMode == bmCheck case, which doesn't lead to optimisePath anyway.

(cherry picked from commit 4cbcaad435)
2025-10-16 21:46:08 +00:00
internal-nix-ci[bot]
3c39583e55
Merge pull request #14267 from NixOS/backport-14263-to-2.32-maintenance
[Backport 2.32-maintenance] Restore `ServeProto::Command::ImportPaths`
2025-10-16 00:07:32 +00:00
Sergei Zimmerman
a038c92d38 Restore ServeProto::Command::ImportPaths
This partially reverts commit 5e46df973f,
partially reversing changes made to
8c789db05b.

We do this because Hydra, while using the newer version of the protocol,
still uses this command, even though Nix (as a client) doesn't use it.
On that basis, we don't want to remove it (or consider it only part of
the older versions of the protocol) until Hydra no longer uses the
Legacy SSH Protocol.

(cherry picked from commit 0deb492b3d)
2025-10-15 23:38:26 +00:00
internal-nix-ci[bot]
cf6ad228ae
Merge pull request #14259 from NixOS/backport-14253-to-2.32-maintenance
[Backport 2.32-maintenance] libfetchers/git-utils: Be more correct about validating refnames
2025-10-15 20:33:35 +00:00
Sergei Zimmerman
44701007b4 libfetchers/git-utils: Be more correct about validating refnames
Turns out there's a much better API for this that doesn't have the
footguns of the previous method.

isLegalRefName is somewhat of a misnomer, since it's mainly used to
validate user inputs that can be either references, branch names,
psedorefs or tags.

(cherry picked from commit 5d1178b817)
2025-10-15 20:08:43 +00:00
internal-nix-ci[bot]
ff1f145992
Merge pull request #14256 from NixOS/backport-14205-to-2.32-maintenance
[Backport 2.32-maintenance] Improved backwards compatibility hack for git URLs using dir=...
2025-10-15 16:31:21 +00:00
Graham Dennis
3519ad2ca6 Improve comment
(cherry picked from commit 8d9e9bc400)
2025-10-15 15:58:18 +00:00
Graham Dennis
16af6a8ed1 Improved backwards compatibility hack for git URLs using dir=... attribute
(cherry picked from commit 43b01b6790)
2025-10-15 15:58:18 +00:00
Eelco Dolstra
549a2e8272 Bump version 2025-10-14 11:26:39 +02:00
internal-nix-ci[bot]
2531dcad75
Merge pull request #14238 from NixOS/backport-14237-to-2.32-maintenance
[Backport 2.32-maintenance] Remove validation of URLs passed to FileTransferRequest verbatim
2025-10-13 21:23:05 +00:00
Sergei Zimmerman
11f9c59140 Remove validation of URLs passed to FileTransferRequest verbatim
CURL is not very strict about validation of URLs passed to it. We
should reflect this in our handling of URLs that we get from the user
in <nix/fetchurl.nix> or builtins.fetchurl. ValidURL was an attempt to
rectify this, but it turned out to be too strict. The only good way to
resolve this is to pass (in some cases) the user-provided string verbatim
to CURL. Other usages in libfetchers still benefit from using structured
ParsedURL and validation though.

nix store prefetch-file --name foo 'https://cdn.skypack.dev/big.js@^5.2.2'
error: 'https://cdn.skypack.dev/big.js@^5.2.2' is not a valid URL: leftover

(cherry picked from commit 47f427a172)
2025-10-13 20:48:15 +00:00
internal-nix-ci[bot]
a25a219e79
Merge pull request #14213 from NixOS/backport-14194-to-2.32-maintenance
[Backport 2.32-maintenance] libutil: Print stack trace on assertion failure
2025-10-11 00:40:50 +00:00
Sergei Zimmerman
f07486b205 libutil: Print stack trace on assertion failure
This change overrides __assert_fail on glibc/musl
to instead call std::terminate that we have a custom
handler for. This ensures that we have more context
to diagnose issues encountered by users in the wild.

(cherry picked from commit 46382ade74)
2025-10-11 00:08:36 +00:00
internal-nix-ci[bot]
9ec98f7844
Merge pull request #14212 from NixOS/backport-14210-to-2.32-maintenance
[Backport 2.32-maintenance] libstore: Fix double-quoting of paths in logs
2025-10-10 23:26:18 +00:00
Sergei Zimmerman
634e1d3b65 libstore: Fix double-quoting of paths in logs
std::filesystem::path is already quoted by boost::format with double quotes (").
(cherry picked from commit f30cb8667b)
2025-10-10 22:54:22 +00:00
internal-nix-ci[bot]
70655061e3
Merge pull request #14202 from NixOS/backport-14199-to-2.32-maintenance
[Backport 2.32-maintenance] packaging: only override `toml11` when necessary
2025-10-09 18:04:05 +00:00
Seth Flynn
da328e6004 packaging: only override toml11 when necessary
v4.4.0 hit Nixpkgs in https://github.com/NixOS/nixpkgs/pull/442682.
Ideally we'd just use that, but this keeps the fallback behavior until
it's more widespread

(cherry picked from commit 0f016f9bf5)
2025-10-09 17:56:10 +00:00