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

21542 commits

Author SHA1 Message Date
Eelco Dolstra
0e352a6cec Merge remote-tracking branch 'detsys/detsys-main' into fix-deep-overrides 2025-06-25 21:53:23 +02:00
Eelco Dolstra
1ef1675300 Merge remote-tracking branch 'detsys/detsys-main' into eelcodolstra/fh-865-add-nix-flake-prefetch-inputs-command-to-fetch-inputs-in 2025-06-25 21:52:26 +02:00
detsys-spaghetti[bot]
3a8bd3b108
Merge pull request #128 from DeterminateSystems/release-v3.6.8/754738A2-A724-420B-A33B-FFC8C2CD8356
Release v3.6.8
2025-06-25 10:32:25 +00:00
github-actions[bot]
4ba66db9f6
Generate release notes for 3.6.8 2025-06-25 03:32:40 +00:00
github-actions[bot]
fd8b327060
Set .version-determinate to 3.6.8 2025-06-25 03:32:35 +00:00
github-actions[bot]
c2baff64f7
Prepare release v3.6.8 2025-06-25 03:32:32 +00:00
Sergei Zimmerman
55d12dfc5d
libstore-tests: Don't leak memory in tests
We shouldn't leak memory in unit tests in order
to make enabling ASAN easier.
2025-06-25 00:07:58 +03:00
Cole Helbling
a20a7fa1ea Allow specifying args to external builder program 2025-06-24 08:25:30 -07:00
Graham Christensen
c224b8359c
Merge pull request #126 from DeterminateSystems/release-v3.6.7/84df8907-9f0b-49ea-826a-e1f36408f399
Release v3.6.7
2025-06-24 14:09:18 +00:00
Eelco Dolstra
448cfb71ea Merge remote-tracking branch 'cve/fod-cves-master' 2025-06-24 16:02:58 +02:00
Graham Christensen
404d824194 Update changelogs 2025-06-24 09:31:45 -04:00
Eelco Dolstra
e8f145ae69 nix flake prefetch-inputs: Add
This command fetches all inputs of a flake in parallel.

Example runtime for

  $ chmod -R u+w /tmp/nix2; rm -rf /tmp/nix2; rm ~/.cache/nix/fetcher-cache-v3.sqlite*; rm -rf ~/.cache/nix/tarball-cache/ ~/.cache/nix/gitv3/; time nix flake prefetch-inputs --store /tmp/nix2 https://api.flakehub.com/f/pinned/informalsystems/cosmos.nix/0.3.0/018ce9ed-d0be-7ce5-81b6-a3c6e3ae1187/source.tar.gz

with http-connections = 1:

real    4m11.859s
user    2m6.931s
sys     0m25.619s

and http-connections = 25 (the default):

real    0m57.146s
user    2m49.506s
sys     0m36.008s
2025-06-24 15:30:49 +02:00
Eelco Dolstra
731b630321 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-24 09:27:39 -04:00
github-actions[bot]
098be10e28
Generate release notes for 3.6.7 2025-06-24 13:18:13 +00:00
github-actions[bot]
ff05659f8b
Set .version-determinate to 3.6.7 2025-06-24 13:18:08 +00:00
github-actions[bot]
58a878d846
Prepare release v3.6.7 2025-06-24 13:18:05 +00:00
Graham Christensen
5dea62be29
Merge pull request #124 from DeterminateSystems/sync-2.29.1
Sync 2.29.1
2025-06-23 21:41:37 +00:00
Robert Hensing
f9afc1e68c
Merge pull request #13393 from egorkonovalov/patch-1
Fix typo: remove an extra word
2025-06-23 16:07:14 +02:00
Eelco Dolstra
7059d2b58b Merge remote-tracking branch 'origin/2.29-maintenance' into sync-2.29.1 2025-06-23 15:02:22 +02:00
Egor Konovalov
df21f24987
Fix link
Remove extra `realise`
2025-06-23 11:26:59 +02:00
Robert Hensing
6a74590063
Merge pull request #13388 from NaN-git/opt-string_view
libexpr: further removal of `std::string` copies
2025-06-23 09:05:28 +02:00
mergify[bot]
b3b137ec4a
Merge pull request #13392 from NixOS/mergify/bp/2.29-maintenance/pr-13348
Make the repl test more robust (backport #13348)
2025-06-22 19:41:08 +00:00
Eelco Dolstra
833406121c Make the repl test more robust
Seen in https://github.com/DeterminateSystems/nix-src/actions/runs/15590867877/job/43909540271:

  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:09:38 +00:00
Eelco Dolstra
37685b1c9c Fix Darwin test failure in repl.sh
Fixes

  error:
         … while processing sandbox path '/private/tmp/nix-shell.0MDgyx/nix-test/ca/repl/store/nix/var/nix/builds/nix-build-simple.drv-65916-3910734210' (/private/tmp/nix-shell.0MDgyx/nix-test/ca/repl/store)

         error: 'nix' is too short to be a valid store path

which happened because we were now putting the build directory
underneath the store directory.
2025-06-22 16:49:44 +02:00
Eelco Dolstra
2e2fe4cb07 Cleanup 2025-06-22 16:49:44 +02:00
Eelco Dolstra
5acf50a327 Disallow the build directory having world-writable parents 2025-06-22 16:49:44 +02:00
eldritch horrors
88b7db1ba4 libstore: Don't default build-dir to temp-dir, store setting
If a build directory is accessible to other users it is possible to
smuggle data in and out of build directories. Usually this is only
a build purity problem, but in combination with other issues it can
be used to break out of a build sandbox. to prevent this we default
to using a subdirectory of nixStateDir (which is more restrictive).

(cherry picked from pennae Lix commit 55b416f6897fb0d8a9315a530a9b7f0914458ded)
(store setting done by roberth)
2025-06-22 16:49:44 +02:00
Eelco Dolstra
9af4c267c6 Chown structured attr files safely 2025-06-22 16:48:34 +02:00
Eelco Dolstra
a4b5584fb1 Replace 'bool sync' with an enum for clarity
And drop writeFileAndSync().
2025-06-22 16:48:34 +02:00
Eelco Dolstra
479c356510 Drop guessOrInventPathFromFD()
No need to do hacky stuff like that when we already know the original path.
2025-06-22 16:48:34 +02:00
Eelco Dolstra
e5dc3e84f0 Tweak comment 2025-06-22 16:48:34 +02:00
Raito Bezarius
4ea4813753 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
5ec047f348 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
4e59d3fdb2 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
034f59bbb9 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
002d202653 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
6a5b6ad3b7 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>
2025-06-22 16:48:33 +02:00
Raito Bezarius
7226a116a0 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-22 16:48:33 +02:00
John Ericson
b9b510d692
Merge pull request #13383 from xokdvium/meson-format-multiline
Restore multiline formatting of lists in meson files
2025-06-20 18:19:03 -04:00
Sergei Zimmerman
a4dcce36c9
Merge pull request #13382 from synalice/patch-3
Update docs
2025-06-20 23:18:11 +03:00
Sergei Zimmerman
6ef683cb2a
Restore multiline formatting of lists in meson files
Applies a workaround to enforce multiline formatting
of lists to reduce code churn introduced in 93a42a5971.
2025-06-20 23:12:36 +03:00
Nikita Krasnov
785f3867fd
Update docs 2025-06-20 21:19:13 +03:00
Robert Hensing
42ea2724a8
Merge pull request #13353 from lucperkins/messages-present-tense
Rework future tense in user-facing messages
2025-06-20 10:43:03 +02:00
Luc Perkins
3132aba8e4
Fix broken test 2025-06-19 15:23:10 -07:00
Luc Perkins
9c120596ec
Merge remote-tracking branch 'upstream/master' into messages-present-tense 2025-06-19 10:51:50 -07:00
Eelco Dolstra
1d5e161755
Merge pull request #113 from DeterminateSystems/eelcodolstra/fh-851-lock-nar-hashes-by-default
Add lazy-locks setting
2025-06-19 17:01:14 +00:00
Eelco Dolstra
692dfb424a
Merge pull request #117 from DeterminateSystems/test-uncacheable
Fix fetchToStore() caching with --impure, improve testing
2025-06-19 16:51:11 +00:00
Vladimír Čunát
5d2986d3c5 tests: fixup with jq-1.8.0 2025-06-19 18:48:59 +02:00
Jörg Thalheim
aa1629ca35
Merge pull request #13378 from NixOS/improve-rosetta-hint
Improve the Rosetta installation hint
2025-06-19 16:38:10 +02:00
mergify[bot]
075df0b446
Merge pull request #13380 from NixOS/mergify/bp/2.29-maintenance/pr-13376
Revert "Drop magic-nix-cache" (backport #13376)
2025-06-19 12:44:08 +00:00