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

19733 commits

Author SHA1 Message Date
mergify[bot]
53469f6af0
Merge 2fc60bd76a into decc0bfd79 2025-06-24 09:25:09 -07:00
Eelco Dolstra
decc0bfd79 Bump version 2025-06-24 17:14:03 +02:00
Eelco Dolstra
6c7215b278 Merge remote-tracking branch 'cve/fod-cves-2.28' into 2.28-maintenance 2025-06-24 16:06:10 +02:00
mergify[bot]
983d3922ff
Merge pull request #13391 from NixOS/mergify/bp/2.28-maintenance/pr-13348
Make the repl test more robust (backport #13348)
2025-06-22 19:38:47 +00:00
Eelco Dolstra
37fe2584c1 Make the repl test more robust
Seen in 4390954027:

  nix-functional-tests> grep: repl_output: No such file or directory
  nix-functional-tests> +(repl.sh:174) cat repl_output

This is because there is a small possibility that the `nix repl` child
process hasn't created `repl_output` yet. So make sure it exists.

(cherry picked from commit 9eb46e9cc0)
2025-06-22 19:08:35 +00:00
Eelco Dolstra
24c1aa735a Fixes for GHSA-g948-229j-48j3
Squashed commit of the following:

commit 04fff3a637d455cbb1d75937a235950e43008db9
Author: Eelco Dolstra <edolstra@gmail.com>
Date:   Thu Jun 12 12:30:32 2025 +0200

    Chown structured attr files safely

commit 5417ad445e414c649d0cfc71a05661c7bf8f3ef5
Author: Eelco Dolstra <edolstra@gmail.com>
Date:   Thu Jun 12 12:14:04 2025 +0200

    Replace 'bool sync' with an enum for clarity

    And drop writeFileAndSync().

commit 7ae0141f328d8e8e1094be24665789c05f974ba6
Author: Eelco Dolstra <edolstra@gmail.com>
Date:   Thu Jun 12 11:35:28 2025 +0200

    Drop guessOrInventPathFromFD()

    No need to do hacky stuff like that when we already know the original path.

commit 45b05098bd019da7c57cd4227a89bfd0fa65bb08
Author: Eelco Dolstra <edolstra@gmail.com>
Date:   Thu Jun 12 11:15:58 2025 +0200

    Tweak comment

commit 0af15b31209d1b7ec8addfae9a1a6b60d8f35848
Author: Raito Bezarius <raito@lix.systems>
Date:   Thu Mar 27 12:22:26 2025 +0100

    libstore: ensure that temporary directory is always 0o000 before deletion

    In the case the deletion fails, we should ensure that the temporary
    directory cannot be used for nefarious purposes.

    Change-Id: I498a2dd0999a74195d13642f44a5de1e69d46120
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit 2c20fa37b15cfa03ac6a1a6a47cdb2ed66c0827e
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 12:42:55 2025 +0100

    libutil: ensure that `_deletePath` does NOT use absolute paths with dirfds

    When calling `_deletePath` with a parent file descriptor, `openat` is
    made effective by using relative paths to the directory file descriptor.

    To avoid the problem, the signature is changed to resist misuse with an
    assert in the prologue of the function.

    Change-Id: I6b3fc766bad2afe54dc27d47d1df3873e188de96
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit d3c370bbcae48bb825ce19fd0f73bb4eefd2c9ea
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 01:07:47 2025 +0100

    libstore: ensure that `passAsFile` is created in the original temp dir

    This ensures that `passAsFile` data is created inside the expected
    temporary build directory by `openat()` from the parent directory file
    descriptor.

    This avoids a TOCTOU which is part of the attack chain of CVE-????.

    Change-Id: Ie5273446c4a19403088d0389ae8e3f473af8879a
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit 45d3598724f932d024ef6bc2ffb00c1bb90e6018
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 01:06:03 2025 +0100

    libutil: writeFile variant for file descriptors

    `writeFile` lose its `sync` boolean flag to make things simpler.

    A new `writeFileAndSync` function is created and all call sites are
    converted to it.

    Change-Id: Ib871a5283a9c047db1e4fe48a241506e4aab9192
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit 732bd9b98cabf4aaf95a01fd318923de303f9996
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 01:05:34 2025 +0100

    libstore: chown to builder variant for file descriptors

    We use it immediately for the build temporary directory.

    Change-Id: I180193c63a2b98721f5fb8e542c4e39c099bb947
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit 962c65f8dcd5570dd92c72370a862c7b38942e0d
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 01:04:59 2025 +0100

    libstore: open build directory as a dirfd as well

    We now keep around a proper AutoCloseFD around the temporary directory
    which we plan to use for openat operations and avoiding the build
    directory being swapped out while we are doing something else.

    Change-Id: I18d387b0f123ebf2d20c6405cd47ebadc5505f2a
    Signed-off-by: Raito Bezarius <raito@lix.systems>

commit c9b42462b75b5a37ee6564c2b53cff186c8323da
Author: Raito Bezarius <raito@lix.systems>
Date:   Wed Mar 26 01:04:12 2025 +0100

    libutil: guess or invent a path from file descriptors

    This is useful for certain error recovery paths (no pun intended) that
    does not thread through the original path name.

    Change-Id: I2d800740cb4f9912e64c923120d3f977c58ccb7e
    Signed-off-by: Raito Bezarius <raito@lix.systems>
2025-06-19 16:40:11 +02:00
Jörg Thalheim
c6d7a1bb42
Merge pull request #13379 from NixOS/mergify/bp/2.28-maintenance/pr-13376
Revert "Drop magic-nix-cache" (backport #13376)
2025-06-19 16:37:48 +02:00
Eelco Dolstra
d3840a1472 Revert "Drop magic-nix-cache"
This reverts commit 9cc8be2674 since
magic-nix-cache works again (thanks @jchv).

(cherry picked from commit 9b57573bae)
2025-06-19 12:12:28 +00:00
Jörg Thalheim
aee067f539
Merge pull request #13329 from NixOS/mergify/bp/2.28-maintenance/pr-13284
lockFlake(): Allow registry lookups for overridden inputs (backport #13284)
2025-06-11 07:25:42 +02:00
Seth Flynn
6f4c2a0a3b lockFlake(): Allow registry lookups for overridden inputs
Fixes #13144

(cherry picked from commit d0a2323829)

Co-authored-by: bryango <bryango@users.noreply.github.com>
2025-06-11 06:53:31 +02:00
mergify[bot]
f3c10d8c6f
Merge pull request #13318 from NixOS/mergify/bp/2.28-maintenance/pr-13274
Drop magic-nix-cache (backport #13274)
2025-06-03 14:53:18 +00:00
Eelco Dolstra
ddec59e694 Drop magic-nix-cache
This no longer works, see https://determinate.systems/posts/magic-nix-cache-free-tier-eol/.

(cherry picked from commit 9cc8be2674)
2025-06-03 14:18:50 +00:00
Jörg Thalheim
2fc60bd76a tests/fetchGit: work around something that looks a bash parsing quirk.
Before we got something like this but only inside the VM test:

 vm-test-run-functional-tests-on-nixos_user> machine # fetchGit.sh: line 286: unexpected EOF while looking for matching `)'

We now try to do not too much in a single line, so that the bash parser does not get confused.
This also seems more readable and better quoted.

(cherry picked from commit 5419d82547)
2025-05-26 12:54:36 +00:00
Jörg Thalheim
2ae590ed5a git/revCount: improve error message when we have incomplete git history
(cherry picked from commit b1ccfaa080)
2025-05-26 12:54:36 +00:00
Jörg Thalheim
93322ab94f fetchGit: don't compute revCount on shallow repository
This can never work and leads to a crash bug.

(cherry picked from commit 0479db934c)

# Conflicts:
#	src/libfetchers/git.cc
2025-05-26 12:54:36 +00:00
John Ericson
ac328b88d8
Merge pull request #13217 from NixOS/mergify/bp/2.28-maintenance/pr-13212
docs: remove repeated "allowedReferences" and other lexical illusion (backport #13212)
2025-05-16 12:22:08 -04:00
Peder Bergebakken Sundt
a7588b47f2 docs: remove lexical illusions detected with write-good
I made this this non-markdown aware tool somewhat behave with some cursed fd+pandoc invocations

(cherry picked from commit ea5302c4a2)
2025-05-16 15:56:25 +00:00
Peder Bergebakken Sundt
d1e397d2a5 docs: remove repeated "allowedReferences"
This is what write-good lints as a "lexical illusion"

(cherry picked from commit cb16cd707c)
2025-05-16 15:56:25 +00:00
mergify[bot]
a3e6953c71
Merge pull request #13209 from NixOS/mergify/bp/2.28-maintenance/pr-13207
dev-shell: Drop bear dependency (backport #13207)
2025-05-15 22:15:36 +00:00
Sergei Zimmerman
4168ee57ec dev-shell: Drop bear dependency
Since the autotools-based build system has been removed
and meson already generates compile database there's no
need to have it in the devshell.

(cherry picked from commit 67535263a5)
2025-05-15 21:49:11 +00:00
John Ericson
c4d6c6a3ca
Merge pull request #13191 from NixOS/mergify/bp/2.28-maintenance/pr-12977
Docs: fix "building" documentation w.r.t. meson (backport #12977)
2025-05-14 18:15:29 -04:00
Jörg Thalheim
58c84bcf8a docs/building: fix attribute for nix-cli-ccacheStdenv
(cherry picked from commit c12fd7b319)
2025-05-14 17:27:02 -04:00
Jörg Thalheim
f8984c4182 docs: update cross compilation section from autotools to meson
fixes https://github.com/NixOS/nix/issues/12934

Update doc/manual/source/development/building.md

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>

Update doc/manual/source/development/building.md

Co-authored-by: John Ericson <git@JohnEricson.me>
(cherry picked from commit 723f2c7352)
2025-05-14 17:27:02 -04:00
Jörg Thalheim
8f5172d026 fix various typos in docs
(cherry picked from commit a70140b55a)
2025-05-14 17:26:55 -04:00
mergify[bot]
47ba78d251
Merge pull request #13187 from NixOS/mergify/bp/2.28-maintenance/pr-13178
docs: Fix miscellaneous typos and formatting issues (backport #13178)
2025-05-14 19:51:10 +00:00
Sergei Zimmerman
b4bfe15559 docs: Fix miscellaneous typos and formatting issues
(cherry picked from commit 20a724d131)
2025-05-14 19:10:59 +00:00
Jörg Thalheim
2e31ed2f19
Merge pull request #13185 from NixOS/mergify/bp/2.28-maintenance/pr-13180
nix repl: remember :load-flake calls for :reload (backport #13180)
2025-05-14 21:09:48 +02:00
Tim Van Baak
0acb13b7fe nix repl: remember :load-flake calls for :reload
Fixes #8753

(cherry picked from commit fb510a9e50)
2025-05-14 18:36:56 +00:00
Eelco Dolstra
c0cef69790
Merge pull request #13172 from NixOS/mergify/bp/2.28-maintenance/pr-13159
Avoid unnecessarily updating old lock files with 'dir' parameters (backport #13159)
2025-05-13 08:31:17 +02:00
Eelco Dolstra
79eed1d9c4 Backward compatibility hack for dealing with dir in URL-style flakerefs
(cherry picked from commit d00682beb2)
2025-05-12 20:35:46 +00:00
mergify[bot]
9fd0cd8ed0
Merge pull request #13133 from NixOS/mergify/bp/2.28-maintenance/pr-13121
fix: allow redirected HTTP uploads (backport #13121)
2025-05-03 08:50:24 +00:00
Jörg Thalheim
68fd62b1fb
Merge pull request #13132 from NixOS/mergify/bp/2.28-maintenance/pr-13122
Replace all instances of std::filesystem::directory_iterator with DirectoryIterator (backport #13122)
2025-05-03 09:46:57 +02:00
Thomas Bereknyei
f9dd4e5605 fix: allow redirected HTTP uploads
When a PUT is redirected, some of the data can be sent by curl before headers are read. This means the subsequent PUT operation needs to seek back to origin.

(cherry picked from commit 90deb665eb)
2025-05-03 07:34:43 +00:00
Jörg Thalheim
3d8d19928e replace all instances of std::filesystem::directory_iterator with DirectoryIterator
(cherry picked from commit 1c4496f4e5)
2025-05-03 09:07:00 +02:00
Jörg Thalheim
0f4b17e51f add DirectoryIterator to re-throw std::filesystem::filesystem_error
Co-authored-by: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com>
(cherry picked from commit 7ccc0d591f)
2025-05-03 09:06:56 +02:00
mergify[bot]
8de4c272dc
Merge pull request #13124 from NixOS/mergify/bp/2.28-maintenance/pr-13014
Update `nix fmt` man page with official formatter example (backport #13014)
2025-05-01 13:45:45 +00:00
Jeremy Fleischman
6ba4b1d252 Update nix fmt man page with official formatter example
The current example relies upon [nixfmt's deprecated tree traversal
behavior](https://github.com/NixOS/nixfmt/pull/240). The simplest
alternative is the new `nixfmt-tree` wrapper for `nixfmt`/`treefmt`.

(cherry picked from commit 6f71d8a9c2)
2025-05-01 13:11:54 +00:00
Jörg Thalheim
bf0f35ec69
Merge pull request #13110 from NixOS/mergify/bp/2.28-maintenance/pr-13109
libutil: amend OSC 8 escape stripping for xterm-style separator (backport #13109)
2025-05-01 08:11:47 +02:00
mergify[bot]
ff6e0f5228
Merge pull request #13118 from NixOS/mergify/bp/2.28-maintenance/pr-13112
bugfix in getInteger(const nlohmann::json &) and add bounds checks (backport #13112)
2025-04-30 22:01:31 +00:00
Philipp Otterbein
60a6baa2d7 bugfix in getInteger(const nlohmann::json &) and add bounds checks
improve error messages, too

(cherry picked from commit 788be3f964)
2025-04-30 21:20:57 +00:00
Sergei Trofimovich
1e2e52b66a libutil: amend OSC 8 escape stripping for xterm-style separator
Before the change `nix` was stripping warning flags
reported by `gcc-14` too eagerly:

    $ nix build -f. texinfo4
    error: builder for '/nix/store/i9948l91s3df44ip5jlpp6imbrcs646x-texinfo-4.13a.drv' failed with exit code 2;
           last 25 log lines:
           >  1495 | info_tag (mbi_iterator_t iter, int handle, size_t *plen)
           >       |                                            ~~~~~~~~^~~~
           > window.c:1887:39: error: passing argument 4 of 'printed_representation' from incompatible pointer type []
           >  1887 |                                       &replen);
           >       |                                       ^~~~~~~
           >       |                                       |
           >       |                                       int *

After the change the compiler flag remains:

    $ ~/patched.nix build -f. texinfo4
    error: builder for '/nix/store/i9948l91s3df44ip5jlpp6imbrcs646x-texinfo-4.13a.drv' failed with exit code 2;
       last 25 log lines:
       >  1495 | info_tag (mbi_iterator_t iter, int handle, size_t *plen)
       >       |                                            ~~~~~~~~^~~~
       > window.c:1887:39: error: passing argument 4 of 'printed_representation' from incompatible pointer type [-Wincompatible-pointer-types]
       >  1887 |                                       &replen);
       >       |                                       ^~~~~~~
       >       |                                       |
       >       |                                       int *

Note the difference in flag rendering around the warning.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda has a
good sumamry of why it happens. Befomre the change `nix` was handling
just one form or URL separator:

    $ printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

Now it also handled another for (used by gcc-14`):

    printf '\e]8;;http://example.com\aThis is a link\e]8;;\a\n'

While at it fixed accumulation of trailing escape `\e\\` symbol.

(cherry picked from commit e322b714dc)
2025-04-29 20:40:34 +00:00
Eelco Dolstra
6b16f919da Bump version 2025-04-29 21:52:24 +02:00
Jörg Thalheim
4d4a91ab8d
Merge pull request #13101 from NixOS/mergify/bp/2.28-maintenance/pr-13100
allocate SimpleLogger before forking (backport #13100)
2025-04-28 09:48:32 +02:00
Philipp Otterbein
9ba32a2981 allocate SimpleLogger before forking
(cherry picked from commit 4e95f662db)
2025-04-28 07:02:02 +00:00
mergify[bot]
323e840d17
Merge pull request #13097 from NixOS/mergify/bp/2.28-maintenance/pr-13094
libutil: Add missing format arguments to UsageError ctor (backport #13094)
2025-04-25 14:04:08 +00:00
Sergei Zimmerman
1c9e94789e libutil: Add missing format arguments to UsageError ctor
Once again found by an automated migration to `std::format`.
I've tested that boost::format works fine with `std::string_view`
arguments.

(cherry picked from commit 9fff868e39)
2025-04-25 13:22:58 +00:00
Eelco Dolstra
e20b0d7b29
Merge pull request #13090 from NixOS/mergify/bp/2.28-maintenance/pr-13082
Actually ignore system/user registries during locking (2nd attempt) (backport #13082)
2025-04-25 14:13:27 +02:00
Jörg Thalheim
709f05989d tests/flakes: add regression test for resolving user flakes
(cherry picked from commit 6405d6822d)
2025-04-25 13:32:13 +02:00
Eelco Dolstra
dfbb52e6bd lockFlake(): Allow registry lookups for the top-level flake
Fixes #13050.

(cherry picked from commit 68de26d38a)
2025-04-25 13:31:24 +02:00
mergify[bot]
5a7cdc4373
Merge pull request #13092 from NixOS/mergify/bp/2.28-maintenance/pr-13086
libutil: Fix invalid boost format string in infinite symlink recursion error (backport #13086)
2025-04-25 10:48:47 +00:00