1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2026-01-10 16:31:22 +01:00
Commit graph

22474 commits

Author SHA1 Message Date
Eelco Dolstra
ca9fb4cffd RemoteFSAccessor: Make the local NAR cache content-addressed 2026-01-07 22:46:33 +01:00
John Ericson
5a65b1f131
Merge pull request #14947 from NixOS/local-nar-cache
BinaryCacheStoreConfig: Change localNarCache to std::filesystem::path
2026-01-07 20:56:29 +00:00
Eelco Dolstra
24da83853a BinaryCacheStoreConfig: Change localNarCache to std::filesystem::path 2026-01-07 21:15:19 +01:00
Eelco Dolstra
6f7190bdae
Merge pull request #14946 from NixOS/fix-structured-attrs-test
Fix structured-attrs test failure in dev shell
2026-01-07 18:36:52 +00:00
Eelco Dolstra
7ce871ee86 Fix structured-attrs test failure in dev shell
Fixes "error: cannot create symlink '.../tests/functional/result';
already exists".
2026-01-07 18:00:27 +01:00
Sergei Zimmerman
b474e8d249
Merge pull request #14935 from NixOS/delete-path-fchmod
libutil: Implement unix::fchmodatTryNoFollow, use in deletePath
2026-01-07 13:12:18 +00:00
Sergei Zimmerman
9a63752317
libutil: Implement unix::fchmodatTryNoFollow
Using fchmodat after a fstatat in deletePath has a slight TOCTOU
window. We can plug it by using fchmodat (the libc wrapper with
AT_SYMLINK_NOFOLLOW), but it tries fchmodat2 and falls back to the
O_PATH trick while failing when procfs isn't mounted. We can do a bit
better than that and also cache whether syscalls are unsupported to
avoid the repeated context switching that glibc would impose.

Also tests the fallback path. It's only for kernels older than 6.6 and
when procfs isn't accessible that we fall back to the racy fchmodat
without AT_SYMLINK_NOFOLLOW.

What previously used to be:

openat(AT_FDCWD, "/tmp/store-race/nix/var/nix/builds", O_RDONLY) = 11
newfstatat(11, "nix-2704212-84654554", {st_mode=S_IFDIR|000, st_size=3, ...}, AT_SYMLINK_NOFOLLOW) = 0
fchmodat(11, "nix-2704212-84654554", 040700) = 0

Is now a TOCTOU-free sequence of syscalls:

openat(AT_FDCWD, "/tmp/store-race/nix/var/nix/builds", O_RDONLY) = 11
newfstatat(11, "nix-2704953-1733606057", {st_mode=S_IFDIR|000, st_size=3, ...}, AT_SYMLINK_NOFOLLOW) = 0
fchmodat2(11, "nix-2704953-1733606057", 040700, AT_SYMLINK_NOFOLLOW) = 0

Or if the fchmodat2 is not supported:

openat(11, "nix-2705443-3010460784", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 12
fstat(12, {st_mode=S_IFDIR|000, st_size=3, ...}) = 0
chmod("/proc/self/fd/12", 040700)       = 0
openat(11, "nix-2705443-3010460784", O_RDONLY|O_NOFOLLOW|O_DIRECTORY) = 12

This prevents a potentially arbitrary chmod that follows symlinks,
though the race window is very small. Also in the case that fchmodat2
isn't supported we could instead open the /proc/self/fd/N path instead
of using openat, but that's pretty much equivalent. We only care
about ensuring that the thing we chmodded wasn't a symlink since
fchmodat follows symlinks and the support for AT_SYMLINK_NOFOLLOW
in libc for that is pretty spotty on Linux. E.g. glibc fails if the
AT_SYMLINK_NOFOLLOW is specified and procfs isn't available even on
regular files. The patch also includes a test that uses a user namespace
on Linux to test this exact scenario (though it's rather exotic).
2026-01-07 14:59:05 +03:00
Eelco Dolstra
afc6c24d68
Merge pull request #14928 from Zaczero/zaczero/nixmain
Remove regex from isNixCommand
2026-01-06 17:56:41 +00:00
Eelco Dolstra
a3043d991f
Merge pull request #14925 from Zaczero/zaczero/trycat
Remove redundant try/catch
2026-01-06 17:42:51 +00:00
Kamil Monicz
7c3b4f72b8
Remove regex from isNixCommand 2026-01-06 18:04:59 +01:00
Eelco Dolstra
7a5f49323d
Merge pull request #14923 from NixOS/remove-store-hashes
Get rid of real store paths in docs/tests
2026-01-06 17:00:10 +00:00
Kamil Monicz
1176d59c8a
Remove redundant try/catch 2026-01-06 17:51:14 +01:00
Graham Christensen
05df7d716a Auto-replace actually existing store path hashes 2026-01-06 17:26:20 +01:00
Sergei Zimmerman
75da37f792
libutil-tests: Move unix-specific tests for file descriptors to unix/file-descriptor.cc 2026-01-06 18:46:34 +03:00
Graham Christensen
07a260ca18 Invalidation script 2026-01-06 15:55:08 +01:00
Graham Christensen
8ba7ebca3b Replace hashes that appear in cache.nixos.org with hashes which are unlikely to do so (for the diff from 3.14.0 to 3.15.0) 2026-01-06 15:54:22 +01:00
Sergei Zimmerman
931f84b720
Merge pull request #14921 from qowoz/lowdown
packaging: fix lowdown with overridden nixpkgs
2026-01-06 03:41:10 +00:00
zowoq
ec12953822 packaging: fix lowdown with overridden nixpkgs
unstable has a patch that doesn't apply to 2.0.2
2026-01-06 13:15:55 +10:00
Sergei Zimmerman
22e46fb0ef
Merge pull request #14920 from NixOS/fix-ci-oom
tests/functional: Reduce max-call-depth for stack overflow tests
2026-01-06 02:39:46 +00:00
Sergei Zimmerman
9859068689
tests/functional: Reduce max-call-depth for stack overflow tests
This OOMs VM tests in CI and it's just wasteful.
2026-01-06 02:34:48 +03:00
Sergei Zimmerman
cc5a403bc4
Merge pull request #14919 from artemist/cgroup-fix
Fix creation of cgroups
2026-01-05 20:57:03 +00:00
Artemis Tosini
357a45253c
Fix creation of cgroups
A commit in #14800 broke tests around creating cgroups due to incorrect
path handling logic.
(See https://hydra.nixos.org/build/318367985/nixlog/11)

Fix that logic and represent cgroups as CanonPath.

Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2026-01-05 19:48:08 +00:00
John Ericson
6c884fff0c
Merge pull request #14802 from NixOS/improve-timeouts-test
Improve the timeouts test
2026-01-05 19:29:16 +00:00
Eelco Dolstra
bf3638376f
Merge pull request #14918 from NixOS/rename-realPathInSandbox
Rename realPathInSandbox() -> realPathInHost()
2026-01-05 18:03:21 +00:00
Eelco Dolstra
d022cb61f2 Rename realPathInSandbox() -> realPathInHost()
This function was named incorrectly. It denotes the path in the host
filesystem, not in the sandbox.
2026-01-05 18:18:46 +01:00
John Ericson
31bffd3c78
Merge pull request #14897 from NixOS/drop-kaitai
Drop kaitai checks
2026-01-05 15:14:13 +00:00
Sergei Zimmerman
7610d07601
Merge pull request #14911 from tomfitzhenry/set-extract-unused-result
fix: replace unused-result of set::extract with erase
2026-01-05 14:24:37 +00:00
Sergei Zimmerman
ab7c0ae4a3 Drop kaitai checks
Pulling in the java into the tests closure for just testing a piece of code
for the docs (and the tests actually are wrong, since a correct parser must *reject*
those NARs). This is too much of an ask to maintain for zero benefit. I already had
to disable it basically everywhere, because it works only on linux.

It can be revisited in the future, but considering that it's not exercised anywhere and
shouldn't be used anywhere other than a toy example for the docs I think it's best to drop
it.
2026-01-04 21:45:34 -05:00
John Ericson
fef2e2e314
Merge pull request #14800 from obsidiansystems/std-file-system-path-in-builder
Use `std::filesystem::path` in `DerivationBuilder`
2026-01-04 22:39:09 +00:00
Jörg Thalheim
644be074e1
Merge pull request #14916 from NixOS/drop-docker-push-on-master
ci: Stop uploading docker images for pre-release versions
2026-01-02 16:23:54 +00:00
Sergei Zimmerman
b75403f15b
ci: Stop uploading docker images for pre-release versions
This is no longer needed (best I can tell), since nix docker
images now get uploaded to GHCR as part of the release process too
and they contain both aarch64 and x86_64 instead of only x86_64.
2026-01-02 18:36:38 +03:00
Sergei Zimmerman
28c7e42ab5
Merge pull request #14624 from roberth/deepSeq-stack-overflow
Fix most remaining stack overflows
2026-01-02 14:53:07 +00:00
Tom Fitzhenry
401fbe3981 fix: replace unused set::extract with erase
As of https://github.com/llvm/llvm-project/pull/169982 this will be
caught by LLVM, and it's the only such example.
2026-01-02 11:37:15 +11:00
Jörg Thalheim
e44e1cc99c
Merge pull request #14903 from NixOS/release-github-actions-workflow
upload-release.pl: Fix up nix-channels bucket location, use awscli2
2026-01-01 20:47:33 +00:00
Sergei Zimmerman
0900638f1d
upload-release.pl: Fix up nix-channels bucket location, use awscli2
I messed up and accidentally configured the S3 client to use the same
host as the nix-releases bucket, but nix-channels is us-east-1 and
nix-releases is eu-west-1.
2026-01-01 22:21:15 +03:00
John Ericson
df74624754
Merge pull request #14896 from NixOS/fix-freebsd
libutil: Fix on freebsd
2026-01-01 14:20:48 +00:00
John Ericson
73a7962073
Merge pull request #14888 from NixOS/release-github-actions-workflow
ci: GitHub releng for release automation
2026-01-01 14:19:44 +00:00
Sergei Zimmerman
f129bbb9e9
libutil: Fix on freebsd
Also remove the redundant ifdef. I forgot to add the necessary includes
while moving the code around.
2026-01-01 16:25:41 +03:00
Sergei Zimmerman
4b8991256a
dev-shell: Fix on freebsd 2026-01-01 15:26:54 +03:00
tomberek
843395a2c8
Merge pull request #14821 from obsidiansystems/local-binary-cache-store-upsert
`LocalBinaryCacheStore::upsertFile` support slash in path
2025-12-31 20:17:11 +00:00
tomberek
fc52891b44
Merge pull request #14892 from roberth/flake-compat-44-builtins-path-hash
Improve builtins.path docs wrt recursive, sha256
2025-12-31 02:20:56 +00:00
John Ericson
04c0e3432a Use std::filesystem::path in DerivationBuilder
Since it is currently unix-only, we can use `.native()` not `.string()`
for perf, and we don't have to worry about platform-specific
conversions.
2025-12-30 14:39:54 -05:00
Eelco Dolstra
dd75397f73
Merge pull request #14894 from NixOS/undo-push
Undo accidental push to master
2025-12-30 18:45:40 +00:00
Eelco Dolstra
2c55c4aae4 Revert "Add builtins.imap function"
This reverts commit 4db99ea955.
2025-12-30 19:09:59 +01:00
Eelco Dolstra
80c9ad7de4 Revert "Pre-allocate small integers in builtins.{genList,imap}"
This reverts commit 24610d51f4.
2025-12-30 19:09:55 +01:00
Eelco Dolstra
24610d51f4 Pre-allocate small integers in builtins.{genList,imap} 2025-12-30 18:56:34 +01:00
Eelco Dolstra
4db99ea955 Add builtins.imap function
This allows the `imap0` and `imap1` functions (which are called
hundreds of thousands of times during NixOS evaluation) to be done
more efficiently.
2025-12-30 18:56:34 +01:00
Sergei Zimmerman
84ff2ef347
release-process: Document usage of upload-release.yml workflow 2025-12-30 02:28:04 +03:00
Sergei Zimmerman
3933e45d52
upload-release: Only upload the newly created tag 2025-12-30 02:28:02 +03:00
Sergei Zimmerman
a1569458cc
upload-release: Also push to GHCR as part of the release process 2025-12-30 02:00:21 +03:00