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

20431 commits

Author SHA1 Message Date
Eelco Dolstra
62e80f889c Don't crash on flakerefs containing newlines
Fixes #14311.

(cherry picked from commit c1317017e9)
2025-11-06 19:18:08 +00:00
internal-nix-ci[bot]
b479a25292
Merge pull request #14380 from NixOS/backport-14364-to-2.30-maintenance
[Backport 2.30-maintenance] diff-closures: print sizes with dynamic unit
2025-10-27 20:30:07 +00:00
Marcel
f1b04c95ac treewide: replace manual MiB calculations with renderSize
(cherry picked from commit 584a8e8a00)
2025-10-27 19:43:33 +00:00
Marcel
a5a7769d84 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:33 +00:00
Marcel
01fd08803e diff-closures: print sizes with dynamic unit
(cherry picked from commit 9d4d10954a)
2025-10-27 19:43:33 +00:00
internal-nix-ci[bot]
fc0601b153
Merge pull request #14255 from NixOS/backport-13702-to-2.30-maintenance
[Backport 2.30-maintenance] Revert "docker: make sure `nix config check` works"
2025-10-15 12:03:27 +00:00
h0nIg
29bfdb2c3d Revert "docker: make sure nix config check works"
(cherry picked from commit 02cc215221)
2025-10-15 11:35:47 +00:00
internal-nix-ci[bot]
38927ae9c7
Merge pull request #14176 from NixOS/backport-14168-to-2.30-maintenance
[Backport 2.30-maintenance] libutil: Throw if `str("contents")` not found
2025-10-07 22:29:34 +00:00
Samuel Connelly
d9601db10d
libutil: Throw if str("contents") not found
This was broken in 7aa3e7e3a5 (since 2.25).

(cherry picked from commit 242f362567)
2025-10-08 00:59:31 +03:00
John Ericson
f2b45e014b
Merge pull request #14045 from NixOS/mergify/bp/2.30-maintenance/pr-13929
Remove unused function setChildSignalMask() (backport #13929)
2025-09-22 13:26:54 -04:00
Eelco Dolstra
a7943c1be6 Remove unused function setChildSignalMask()
(cherry picked from commit a44dcbff13)
2025-09-22 16:31:05 +00:00
Jörg Thalheim
c6c88d3385
Merge pull request #14003 from NixOS/mergify/bp/2.30-maintenance/pr-13839
don't include derivation name in temporary build directories (backport #13839)
2025-09-16 13:06:02 +02:00
Jörg Thalheim
9001121bd6 don't include derivation name in temporary build directories
With the migration to /nix/var/nix/builds we now have failing builds
when the derivation name is too long.
This change removes the derivation name from the temporary build to have
a predictable prefix length:

Also see: https://github.com/NixOS/infra/pull/764
for context.

(cherry picked from commit 725a2f379f)
2025-09-16 10:23:43 +00:00
mergify[bot]
30229311fa
Merge pull request #13988 from NixOS/mergify/bp/2.30-maintenance/pr-13985
libstore: Raise default connect-timeout to 15 secs (backport #13985)
2025-09-14 12:00:46 +00:00
dramforever
248894690c libstore: Raise default connect-timeout to 15 secs
This allows the weird network or DNS server fallback mechanism inside
glibc to work, and prevents a "Resolving timed out after 5000
milliseconds" error. Read on for details.

The DNS request stuff (dns-hosts) in glibc uses this fallback procedure
to minimize network RTT in the ideal case while dealing with
ill-behaving networks and DNS servers gracefully (see resolv.conf(5)):

- Use sendmmsg() to send UDP DNS requests for IPv4 and IPv6 in parallel
- If that times out (meaning that none or only one of the responses have
  been received), send the requests one by one, waiting for the response
  before sending the next request ("single-request")
- If that still times out, try to use a different socket (hence
  different address) for each request ("single-request-reopen")

The default timeout inside glibc is 5 seconds. Therefore, setting
connect-timeout, and therefore CURLOPT_CONNECTTIMEOUT to 5 seconds
prevents the single-request fallback, and setting it to even 10 seconds
prevents the single-request-reopen fallback as well.

The fallback decision is saved by glibc, but only thread-locally, and
libcurl starts a new thread for getaddrinfo() for each connection.
Therefore for every connection the fallback starts from sendmmsg() all
over again. And since these are considered to have timed out by libcurl,
even though getaddrinfo() might return a successful result, it is not
cached in libcurl.

While a user could tweak these with resolv.conf(5) options (e.g. using
networking.resolvconf.extraOptions in NixOS), and indeed that is
probably needed to avoid annoying delays, it still means that the
default connect-timeout of 5 is too low. Raise it to give fallback a
chance.

(cherry picked from commit 7295034362)
2025-09-14 11:19:49 +00:00
mergify[bot]
d3634e3001
Merge pull request #13973 from NixOS/mergify/bp/2.30-maintenance/pr-13970
Revert "meson: add soversion to libraries (#13960)" (backport #13970)
2025-09-12 21:46:55 +00:00
Sergei Zimmerman
f57f4c7c24 Revert "meson: add soversion to libraries (#13960)"
This reverts commit bdbc739d6e.

Such a change needs more thought put into it. By versioning
shared libraries we'd make a false impression that libraries
themselves are actually versioned and have some sort of stable
ABI, which is not the case.

This will be useful when C bindings become stable, but as long
as they are experimental it does not make sense to set SONAME.

Also this change should not have been backported, since it's
severely breaking.

(cherry picked from commit 0db2b8c8fe)
2025-09-12 21:18:07 +00:00
mergify[bot]
0765fe9d8b
Merge pull request #13967 from NixOS/mergify/bp/2.30-maintenance/pr-13966
meson: add soversion to libraries (#13960) (backport #13966)
2025-09-12 07:12:24 +00:00
Jens Petersen
564b436434 meson: add soversion to libraries (#13960)
(cherry picked from commit bdbc739d6e)
2025-09-12 06:26:40 +00:00
mergify[bot]
4ef8ddbca3
Merge pull request #13921 from NixOS/mergify/bp/2.30-maintenance/pr-13901
Fix macOS HUP detection using kqueue instead of poll (backport #13901)
2025-09-06 08:03:51 +00:00
Jörg Thalheim
b747f703fc Fix macOS HUP detection using kqueue instead of poll
On macOS, poll() is fundamentally broken for HUP detection. It loses event
subscriptions when EVFILT_READ fires without matching the requested events
in the pollfd. This causes daemon processes to linger after client disconnect.

This commit replaces poll() with kqueue on macOS, which is what poll()
uses internally but without the bugs. The kqueue implementation uses
EVFILT_READ which works for both sockets and pipes, avoiding EVFILT_SOCK
which only works for sockets.

On Linux and other platforms, we continue using poll() with the standard
POSIX behavior where POLLHUP is always reported regardless of requested events.

Based on work from the Lix project (https://git.lix.systems/lix-project/lix)
commit 69ba3c92db3ecca468bcd5ff7849fa8e8e0fc6c0

Fixes: https://github.com/NixOS/nix/issues/13847
Related: https://git.lix.systems/lix-project/lix/issues/729
Apple bugs: rdar://37537852 (poll), FB17447257 (poll)

Co-authored-by: Jade Lovelace <jadel@mercury.com>
(cherry picked from commit 1286d5db78)
2025-09-06 07:21:43 +00:00
Eelco Dolstra
84c4de7c40 Bump version 2025-09-02 11:01:51 +02:00
Jörg Thalheim
4692c07349
Merge pull request #13884 from xokdvium/2.30-maintenance-drop-toml-bump
Revert "packaging: Build with toml11 4.4.0"
2025-09-01 09:11:30 +02:00
Sergei Zimmerman
cecac6138b
Revert "packaging: Build with toml11 4.4.0"
This reverts commit 306d8838ab.

This was included in the backport accidentally.
2025-09-01 01:56:58 +03:00
Sergei Zimmerman
a1f07151a5
Merge pull request #13869 from NixOS/mergify/bp/2.30-maintenance/pr-13867
nix/develop: Fix misleading ignored error when run with --arg/--argstr (backport #13867)
2025-08-30 01:04:59 +03:00
Sergei Zimmerman
55a060f64b nix/develop: Fix misleading ignored error when run with --arg/--argstr
This would print erroneous and misleading diagnostics like:

> error (ignored): error: '--arg' and '--argstr' are incompatible with flakes

When run with --expr/--file. Since this installable is used to get the
bash package it doesn't make sense to check this.

(cherry picked from commit b6f98b52a4)
2025-08-29 21:18:41 +00:00
Jörg Thalheim
241c84029e
Merge pull request #13747 from NixOS/mergify/bp/2.30-maintenance/pr-13741
libexpr: Canonicalize TOML timestamps for toml11 > 4.0 (backport #13741)
2025-08-29 07:35:35 +02:00
Sergei Zimmerman
61bb7b27ea
Merge pull request #13842 from NixOS/mergify/bp/2.30-maintenance/pr-13837 2025-08-27 14:29:27 +03:00
Sergei Zimmerman
5de886ecdf flake: Update nixpkgs
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/cd32a774ac52caaa03bcfc9e7591ac8c18617ced?narHash=sha256-VtMQg02B3kt1oejwwrGn50U9Xbjgzfbb5TV5Wtx8dKI%3D' (2025-08-17)
  → 'github:NixOS/nixpkgs/d98ce345cdab58477ca61855540999c86577d19d?narHash=sha256-O2CIn7HjZwEGqBrwu9EU76zlmA5dbmna7jL1XUmAId8%3D' (2025-08-26)

This update contains d1266642a8722f2a05e311fa151c1413d2b9653c, which
is necessary for the TOML timestamps to get tested via nixpkgsLibTests job.

(cherry picked from commit 625477a7df)
2025-08-27 07:52:40 +00:00
Sergei Zimmerman
306d8838ab
packaging: Build with toml11 4.4.0
(cherry picked from commit 320b2c74ef)
2025-08-19 00:10:46 +03:00
Sergei Zimmerman
a2e7c0e040
libexpr: Canonicalize TOML timestamps for toml11 > 4.0
This addresses several changes from toml11 4.0 bump in
nixpkgs [1].

1. Added more regression tests for timestamp formats.
   Special attention needs to be paid to the precision
   of the subsecond range for local-time. Prior versions select the closest
   (upwards) multiple of 3 with a hard cap of 9 digits.

2. Normalize local datetime and offset datetime to always
   use the uppercase separator `T`. This is actually the issue
   surfaced in [2]. This canonicalization is basically a requirement
   by (a certain reading) of rfc3339 section 5.6 [3].

3. If using toml11 >= 4.0 also keep the old behavior wrt
   to the number of digits used for subsecond part of the local-time.
   Newer versions cap it at 6 digits unconditionally.

[1]: https://www.github.com/NixOS/nixpkgs/pull/331649
[2]: https://www.github.com/NixOS/nix/issues/11441
[3]: https://datatracker.ietf.org/doc/html/rfc3339

(cherry picked from commit dc769d72cb)
2025-08-19 00:10:45 +03:00
Sergei Zimmerman
4ba8f167ff
libexpr: Use table.size() instead of unnecessary loop
(cherry picked from commit d8fc55a46e)
2025-08-19 00:10:44 +03:00
Sergei Zimmerman
219b85478a
libexpr: Use recursive lambda instead of std::function
There's no reason to use a std::function for recursive lambdas
since there are polymorphic lambdas.

(cherry picked from commit a80a5c4dba)
2025-08-19 00:10:43 +03:00
Sergei Zimmerman
85df250bea
libexpr: Remove extra trailing semicolons (NFC)
This looks really weird after the reformat.

(cherry picked from commit df4e55ffc1)
2025-08-19 00:10:42 +03:00
Sergei Zimmerman
34b38e18cf
tests/functional/lang: Add more tests for TOML timestamps
Current test suite doesn't cover the subsecond formatting at
all and toml11 is quite finicky with that. We should at the very
least test its behavior to avoid silent breakages on updates.

(cherry picked from commit 7ed0229d1a)
2025-08-19 00:10:41 +03:00
John Ericson
65d09373d1
Merge pull request #13788 from NixOS/mergify/bp/2.30-maintenance/pr-13785
flake: nixpkgs: nixos-unstable -> nixos-25.05-small (backport #13785)
2025-08-18 16:56:18 -04:00
Sergei Zimmerman
1db4697742
hydra: Fix otherNixes.nix_2_3
25.05 has it marked as insecure, but we don't care about it
for testing purposes.

(cherry picked from commit 051290b155)
2025-08-18 23:12:55 +03:00
Sergei Zimmerman
e747853f08
git-blame-ignore-revs: Add nixfmt 1.0.0 reformat 2025-08-18 23:12:44 +03:00
Sergei Zimmerman
7518fdc1f8
flake: Apply nixfmt 1.0.0 2025-08-18 23:11:41 +03:00
Sergei Zimmerman
aec0f0d3f9 flake: nixpkgs: nixos-unstable -> nixos-25.05-small
About time we upgraded our nixpkgs flake input. Ideally
we'd have automation to do this.

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/adaa24fbf46737f3f1b5497bf64bae750f82942e?narHash=sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY%3D' (2025-05-13)
  → 'github:NixOS/nixpkgs/cd32a774ac52caaa03bcfc9e7591ac8c18617ced?narHash=sha256-VtMQg02B3kt1oejwwrGn50U9Xbjgzfbb5TV5Wtx8dKI%3D' (2025-08-17)

(cherry picked from commit fc33681583)
2025-08-18 17:59:06 +00:00
mergify[bot]
1a0f70dd7c
Merge pull request #13728 from NixOS/mergify/bp/2.30-maintenance/pr-13726
docs: add self-attrs documentation (backport #13726)
2025-08-10 15:56:55 +00:00
a-kenji
d9c33be3dd docs: Add self-attribute documentation
(cherry picked from commit 937780ea08)
2025-08-10 15:20:07 +00:00
mergify[bot]
7bd00d13b5
Merge pull request #13562 from NixOS/mergify/bp/2.30-maintenance/pr-13558
meson: Fix `nix_system_cpu` for MIPS and 32 bit ARM systems (backport #13558)
2025-07-27 00:12:12 +00:00
Sergei Zimmerman
b41a9085b2 meson: Fix nix_system_cpu for MIPS and 32 bit ARM systems
Prior patches in 54dc5314e8
and 6db6190002 fixed the default
system double for i686 and ppc/ppc64. This also patch also covers
32 bit arm and mips. ARM cpu names are taken from host_machine.cpu()
for a lack of a better option, but host_machine.cpu_family() is
preferred, since that is supposed to be somewhat standard for cross
files. Endianness is handled correctly by looking at host_machine.endian().

This also updates the documentation to be up to date to how system cpu
is translated from the host_machine specification.

(cherry picked from commit 60d124b36e)
2025-07-26 23:29:28 +00:00
Eelco Dolstra
01b37cfb76 Bump version 2025-07-25 11:31:58 +02:00
Sergei Zimmerman
c56ecddbee
Merge pull request #13549 from NixOS/mergify/bp/2.30-maintenance/pr-13546
ci: Make it actually possible to disable dogfooding (backport #13546)
2025-07-25 02:53:09 +03:00
Sergei Zimmerman
cd9e090506
ci: Roll back default nix to 2.29.1 in install-nix-action
Daemon tests are broken in 2.30.1 Darwin sandbox and there's
no point release with the fix yet.
2025-07-25 02:24:01 +03:00
Sergei Zimmerman
c6893b217a ci: Make it actually possible to disable dogfooding
Github composite actions are a real treat. Boolean inputs
are not actually booleans but rather strings [1].

[1]: https://www.github.com/actions/runner/issues/2238

(cherry picked from commit f0695e177f)
2025-07-24 23:18:46 +00:00
Sergei Zimmerman
e73ac67663
Merge pull request #13538 from NixOS/mergify/bp/2.30-maintenance/pr-13473
ci: Dogfood Nix from master (backport #13473)
2025-07-25 01:06:36 +03:00
Sergei Zimmerman
e1d9f9b9d1
ci: Don't dogfood installer from master
CI on release branches should be stable, otherwise backporting
might become flaky and unreliable. Dogfooding only really makes
sense for CI on master branch, where failures are not as tedious
to work around.
2025-07-24 23:19:58 +03:00