1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 16:10:59 +01:00
Commit graph

22146 commits

Author SHA1 Message Date
John Ericson
1e9b1ff851
Merge pull request #14676 from NixOS/fs-fixes
libstore: Use makeTempPath in optimizePath_, assorted fs fixes
2025-12-01 01:55:20 +00:00
Sergei Zimmerman
40e3f5c0a4
libutil: Make AutoDelete non-copyable and non-movable
This is a good precaution, since we don't want to delete
directories twice accidentally.
2025-12-01 03:09:20 +03:00
Sergei Zimmerman
bf7c53f2d3
libutil: Propagate error code in createSymlink 2025-12-01 03:00:45 +03:00
Sergei Zimmerman
1cc337bb5f
libstore: Actually correctly call remove in case rename fails 2025-12-01 02:56:44 +03:00
Sergei Zimmerman
d888846b68
libstore: Use makeTempPath in optimizePath_
This was intended to be cherry-picked in 6aed9d877c,
but was left hanging. This is actually important for fixing [^]. emilazy let me know
of this bad cherry-pick and its significance.

[^]: https://github.com/NixOS/nix/issues/7273

Originally fixed by Lily Ballard <lily@ballards.net> in https://gerrit.lix.systems/c/lix/+/2100.
2025-12-01 02:51:37 +03:00
tomberek
8be9507a88
Merge pull request #14670 from juhp/RLO-chars
release-notes/rl-2.26.md: remove hidden Unicode RLO control chars
2025-11-30 20:00:38 +00:00
John Ericson
5b175ace18
Merge pull request #14675 from NixOS/cleanup-verb-filetransfer
libstore: Split FileTransferRequest::verb into verb + noun
2025-11-30 16:59:56 +00:00
Sergei Zimmerman
430bcda3ea
libstore: Split FileTransferRequest::verb into verb + noun
With the addition of "delete" method we can no longer rely on
just concatenating "ing" to get the continuous form of the verb.
Also some use-cases actually need a noun instead.
2025-11-30 18:49:11 +03:00
John Ericson
d7c29383c6
Merge pull request #14674 from Mic92/ca-derivation
Fix crash when querying realisations without ca-derivations enabled
2025-11-30 14:30:53 +00:00
Jörg Thalheim
ee5860f542 Fix crash when querying realisations without ca-derivations enabled
queryRealisationUncached was crashing with an assertion failure when
ca-derivations experimental feature is not enabled, because the SQLite
statements for realisations are only initialized when ca-derivations
is enabled.

Return nullptr (no realisation found) when ca-derivations is disabled,
matching the behavior of other CA-related functions like registerDrvOutput
which check for the feature before proceeding.
2025-11-30 14:25:11 +01:00
Jens Petersen
dacd5eac64 release-notes/rl-2.26.md: remove hidden Unicode RLO control chars (#14666)
They are flagged by Fedora CI checks as a potential security issue.
Use of such raw Right-to-Left control characters in source code is
strongly discouraged

also update release-credits-handle-to-name.json
2025-11-30 18:38:18 +08:00
John Ericson
3a32039508
Merge pull request #14672 from NixOS/fix-13948
libfetchers: Fix fetchGit with ref = "HEAD"
2025-11-30 01:03:01 +00:00
John Ericson
01dbbc926f
Merge pull request #14540 from lovesegfault/pre-compute-outputgraph
perf(libstore/derivation-builder): pre-compute outputGraph for linear complexity
2025-11-29 21:46:21 +00:00
Sergei Zimmerman
18f3598d57
libfetchers: Fix fetchGit with ref = "HEAD"
This seems to have been broken in ee9fa0d360.
Adding the HEAD:HEAD refspec looks like the correct solution.

Suggested-by: hxtmdev on github
2025-11-29 05:39:04 +03:00
John Ericson
c33b2c5834 perf(libstore/derivation-builder): Futher simplify / maybe optimize
We can precompute the exact information we need for topo sorting and
store it in `PerhapsNeedToRegister`. Depending on how `topoSort` works,
this is easy a performance improvement or just completely harmless.

Co-Authored-By: Bernardo Meurer Costa <beme@anthropic.com>
2025-11-28 21:38:59 -05:00
John Ericson
686ad9b052 perf(libstore/derivation-builder): pre-compute outputGraph for linear complexity
Build the inverse of `scratchOuputs` before running topoSort, avoiding
quadratic complexity when determining which outputs reference each
other. This fixes the FIXME comment about building the inverted map up
front.

Inspired by Lix commit 10c04ce84 / Change Id
Ibdd46e7b2e895bfeeebc173046d1297b41998181, but ended up being completely
different code.

Co-Authored-By: Maximilian Bosch <maximilian@mbosch.me>
Co-Authored-By: Bernardo Meurer Costa <beme@anthropic.com>
2025-11-28 21:38:59 -05:00
John Ericson
13b4512cbe topoSort: Optimize templating
- No `std::function` overhead

- Don't copy if not necessary

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2025-11-28 21:38:54 -05:00
Sergei Zimmerman
0903b0aa7d
Merge pull request #14671 from NixOS/fix-asan-stack-overload-repl-doc
tests/functional: Work around stack overflows under ASAN in doc-funct…
2025-11-29 00:56:10 +00:00
Sergei Zimmerman
a2acb6d7aa
tests/functional: Work around stack overflows under ASAN in doc-functor tests
This was failing under ASAN in https://hydra.nixos.org/build/315173638/nixlog/1.
ASAN uses a bit more stack space and the default max call depth is not enough.
Not sure what's so special about this particular test.
2025-11-29 01:10:26 +03:00
John Ericson
048a58d331
Merge pull request #14668 from NixOS/fix-i686-expr-tests
libexpr: Fix tests on 32 bit systems
2025-11-28 02:33:29 +00:00
Sergei Zimmerman
7dfad3dba7
libexpr: Fix tests on 32 bit systems
This test is now pointless and the comment is outdated. Also the test fails
on 32 bit systems with:

../nix_api_value_internal.cc:22: Failure
Expected equality of these values:
  sizeof(nix::Value)
    Which is: 12
  sizeof(nix_value)
    Which is: 8

It just happeneded to work because Value is 16 bytes and nix_value was also 16 bytes.

Also get rid of a pointless inline in new_nix_value, since it's already static and
inline there does nothing.
2025-11-28 00:35:56 +03:00
John Ericson
11b0fcd6cd
Merge pull request #14667 from Mic92/fix-remote-builder-hang
daemon: fix hang on SSH disconnect during remote builds
2025-11-27 14:47:21 +00:00
Jörg Thalheim
98c7ca2c9f daemon: fix hang on SSH disconnect during remote builds
When an SSH connection dies during a remote build, MonitorFdHup correctly
detects the disconnect and calls triggerInterrupt(). However, without
ReceiveInterrupts instantiated, no SIGUSR1 is sent to interrupt the
blocking read() syscall. This causes the daemon to hang indefinitely
while holding file locks, blocking subsequent builds.

The fix instantiates ReceiveInterrupts in processConnection(), which
registers a callback to send SIGUSR1 to the current thread when
triggerInterrupt() is called. This allows the blocking read() to return
with EINTR, causing checkInterrupt() to throw and the daemon to exit
cleanly.

This pattern is already used in ThreadPool::doWork() and
SubstitutionGoal for the same purpose.
2025-11-27 13:56:37 +01:00
John Ericson
a3d77a4bf2
Merge pull request #14664 from NixOS/fix-i686-asan
libstore: Align LocalFSStore to 8 bytes even on i686-linux
2025-11-27 04:26:08 +00:00
John Ericson
ad07be0a55
Merge pull request #14665 from vinayakankugoyal/path
Use std::filesystem::path in libmain.
2025-11-27 03:01:56 +00:00
Ubuntu
16f218b37c Use std::filesystem::path in libmain. 2025-11-27 01:36:52 +00:00
John Ericson
35492fe94a
Merge pull request #14632 from NixOS/path-setting
Add `Setting<std::filesystem::path>` and `Setting<std::optional<std::filesystem::path>>` specializations
2025-11-27 00:29:28 +00:00
Sergei Zimmerman
7c76a812fe
libstore: Align LocalFSStore to 8 bytes even on i686-linux
This works around https://hydra.nixos.org/build/314579538/nixlog/1.
2025-11-27 03:08:11 +03:00
John Ericson
d3aa04561f
Merge pull request #14659 from vinayakankugoyal/path
Use std::filesystem::path in libflake.
2025-11-27 00:07:58 +00:00
John Ericson
80c545bcdc Fix include errors masked by precompiled headers 2025-11-26 18:43:32 -05:00
John Ericson
1e36f203e6 Fix issues with std::filesystem::path settings 2025-11-26 18:18:50 -05:00
John Ericson
37cf990b41 Merge branch 'master' into path-setting 2025-11-26 17:57:45 -05:00
Ubuntu
3e8c220b60
Use std::filesystem::path in libflake. 2025-11-27 01:39:37 +03:00
Eelco Dolstra
aa0265f77e
Merge pull request #14656 from NixOS/cleanup-github-attrs
Move GitHub input attribute validation into inputFromAttrs()
2025-11-26 19:16:24 +00:00
Eelco Dolstra
e7f95783db Move GitHub input attribute validation into inputFromAttrs()
Previously inputFromAttrs() didn't do any validation. inputFromURL()
now calls inputFromAttrs(), so we only need to validate in one place.

Fixes #14655.
2025-11-26 19:38:42 +01:00
John Ericson
3c2d5a1bdc
Merge pull request #14652 from vinayakankugoyal/path
Replace Path with std::filesystem::path in libfetchers.
2025-11-26 17:07:43 +00:00
Ubuntu
f0390758dd Replace Path with std::filesystem::path in libfetchers. 2025-11-26 11:23:41 -05:00
Ubuntu
e761a9fb6d Use std::filesystem::path instead of Path in libexpr. 2025-11-26 11:18:38 -05:00
Eelco Dolstra
2e262c6685
Merge pull request #14643 from NixOS/binary-cache-nar-from-path
BinaryCacheStore::narFromPath(): Fix unreachable code
2025-11-26 09:53:23 +00:00
John Ericson
15b222b6d6
Merge pull request #14650 from xokdvium/double-quotes-lockfiles
libstore: Fix double quotes in debug logs for pathlocks
2025-11-26 02:53:39 +00:00
John Ericson
c38349583f
Merge pull request #14651 from NixOS/restore-sink-more-openat2
libutil: Use openFileEnsureBeneathNoSymlinks in RestoreSink::createRe…
2025-11-26 01:45:50 +00:00
John Ericson
31ce0c8169
Merge pull request #14649 from vinayakankugoyal/path
Use std::filesystem::path instead of Path in libexpr.
2025-11-26 01:23:16 +00:00
Sergei Zimmerman
0778b861a9
libutil: Use openFileEnsureBeneathNoSymlinks in RestoreSink::createRegularFile
Add more assertions for preconditions of openFileEnsureBeneathNoSymlinks to prevent
misuse. Also start using it for regular file creation as well.
2025-11-26 03:49:33 +03:00
Sergei Zimmerman
3716bd9a62
libstore: Fix double quotes in debug logs for pathlocks
This is now using std::filesystem which gets double-quoted.
2025-11-26 03:31:32 +03:00
Ubuntu
697b068756 Use std::filesystem::path instead of Path in libexpr. 2025-11-26 00:22:26 +00:00
John Ericson
6cc44e4fdf
Merge pull request #14647 from NixOS/fix-progress-bar
libmain: Fix download progress rendering
2025-11-25 22:52:04 +00:00
Taeer Bar-Yam
952be9fc96
Merge pull request #14644 from Radvendii/fix-14642
parser.y: properly abstract over to-be-created strings
2025-11-25 22:39:38 +00:00
Sergei Zimmerman
4031343e44
libmain: Fix download progress rendering
This was broken in https://github.com/NixOS/nix/pull/14423 accidentally.
Add [[nodiscard]] to prevent such mistakes in the future.
2025-11-26 01:22:47 +03:00
Taeer Bar-Yam
0c0a41a81a
tests: add tests for dynamic attribute in let and inherit
Regression tests for the previous commit.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
Co-authored-by: piegames <git@piegames.de>
2025-11-26 00:10:40 +03:00
Taeer Bar-Yam
97abcda9cc
parser.y: correctly abstract over to-be-constructed ExprString
Fixes the regression from eab467ecfb with
dynamic attributes that a simple string expressions.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
2025-11-25 23:33:58 +03:00