Sergei Zimmerman
cd61e922ff
libutil: Use heterogeneous lookup for LRUCache
...
This gets rid of some ugly std::string_view -> std::string
conversions, which are an eye-sore and lead to extra copying.
2025-05-14 21:42:35 +00:00
Sergei Zimmerman
90d70aa4c9
libutil: Format lru-cache.hh
...
Rip off the band-aid for further refactors. The diff is
very small, so it makes to get it out of the way first.
2025-05-14 21:23:13 +00:00
John Ericson
d972f9e2e2
Split out store-open.hh and store-registration.hh
...
The existing header is a bit too big. Now the following use-cases are
separated, and get their own headers:
- Using or implementing an arbitrary store: remaining `store-api.hh`
This is closer to just being about the `Store` (and `StoreConfig`)
classes, as one would expect.
- Opening a store from a textual description: `store-open.hh`
Opening an aribtrary store implementation like this requires some sort
of store registration mechanism to exists, but the caller doesn't need
to know how it works. This just exposes the functions which use such a
mechanism, without exposing the mechanism itself
- Registering a store implementation: `store-registration.hh`
This requires understanding how the mechanism actually works, and the
mechanism in question involves templated machinery in headers we
rather not expose to things that don't need it, as it would slow down
compilation for no reason.
2025-05-14 16:07:57 -04:00
Jörg Thalheim
e088ab3eaf
Merge pull request #13154 from obsidiansystems/split-store-config
...
Stores no longer inherit from their configs
2025-05-14 21:08:40 +02:00
Jörg Thalheim
addb9f8418
Merge pull request #13180 from Jaculabilis/reload-flakes
...
nix repl: remember :load-flake calls for :reload
2025-05-14 20:35:58 +02:00
Tim Van Baak
fb510a9e50
nix repl: remember :load-flake calls for :reload
...
Fixes #8753
2025-05-13 20:56:41 -07:00
Sergei Zimmerman
20a724d131
docs: Fix miscellaneous typos and formatting issues
2025-05-13 22:20:11 +00:00
John Ericson
934918ba16
Stores no longer inherit from their configs
...
Fix #10766
See that ticket for details.
Progress (I hope!) towards #11139 .
Co-Authored-By: Sergei Zimmerman <xokdvium@proton.me>
2025-05-13 15:56:35 -04:00
Jörg Thalheim
f0f196cef0
Merge pull request #13175 from xokdvium/optimise-fetchtarball
...
libutil/tarfile: Create the scratch `std::vector` only once
2025-05-13 14:21:26 +02:00
Sergei Zimmerman
7628155d2b
libutil/tarfile: Create the scratch std::vector only once
...
I can't find a good way to benchmark in isolation from the
git cache, but common sense dictates that creating (and destroying)
a 131KiB std::vector for each regular file from the archive imposes
quite a significant overhead regardless of the IO bound git cache.
AFAICT there is no reason to keep a copy of the data since
it always gets fed into the sink and there are no coroutines/threads
in sight.
2025-05-13 10:50:46 +00:00
Eelco Dolstra
bdb3f613dd
Improve 'cannot read file from tarball' error
...
It now says e.g.
error: cannot read file from tarball: Truncated tar archive detected while reading data
2025-05-13 10:32:12 +02:00
Jörg Thalheim
ed521760bc
Merge pull request #13161 from NixOS/remove-final
...
nix flake prefetch: Remove __final
2025-05-13 08:50:36 +02:00
Jörg Thalheim
0f985fea11
Merge pull request #13138 from NixOS/register-builtin-builders
...
Register builtin builders
2025-05-13 08:50:19 +02:00
Jörg Thalheim
6fdb170fb3
Merge pull request #13159 from NixOS/ignore-dir
...
Avoid unnecessarily updating old lock files with 'dir' parameters
2025-05-12 22:34:50 +02:00
Eelco Dolstra
da4efbd2fe
Improve 'cannot read file from tarball' error
...
It now says e.g.
error: cannot read file from tarball: Truncated tar archive detected while reading data
2025-05-12 22:08:17 +02:00
Eelco Dolstra
4ea5cb3832
Fix emitting narHash in lock files when lazy trees are disabled
2025-05-12 17:34:32 +02:00
Eelco Dolstra
5a84237209
Improve build failure error messages
...
They're now laid out in a more readable way, and they shows the output
paths (if known).
2025-05-12 15:06:54 +02:00
Eelco Dolstra
c686de6505
nix flake prefetch: Remove __final
...
This is currently an internal attribute, not intended to be shown to
users.
Fixes #13150 .
2025-05-09 16:44:48 +02:00
Graham Christensen
290368169e
Merge pull request #58 from DeterminateSystems/improve-build-failure-error
...
Improve build failure error messages
2025-05-09 14:03:35 +00:00
Eelco Dolstra
d00682beb2
Backward compatibility hack for dealing with dir in URL-style flakerefs
2025-05-09 10:10:42 +02:00
Eelco Dolstra
8014671210
Improve build failure error messages
2025-05-09 00:32:41 +02:00
Eelco Dolstra
7c9d25cf39
Merge pull request #57 from DeterminateSystems/eelcodolstra/fh-800-assess-impact-of-flakelock-url-change-between-nix-versions
...
Canonicalize flake input URLs before checking flake.lock file staleness, for dealing with `dir` in URL-style flakerefs
2025-05-08 18:18:20 +00:00
Eelco Dolstra
bf1c0072f6
Backward compatibility hack for dealing with dir in URL-style flakerefs
2025-05-08 19:12:43 +02:00
Eelco Dolstra
6023688c6c
printValueAsJSON(): Don't devirtualize
...
This is already done by consumers of builtins.toJSON (like
builtins.toFile or builtins.derivation), so we can delay this until
it's actually needed.
2025-05-08 15:33:14 +02:00
Eelco Dolstra
2bbf755bee
Handle FIXMEs
2025-05-07 21:36:13 +02:00
Eelco Dolstra
0f48a152dd
Handle derivation
2025-05-07 20:56:41 +02:00
Eelco Dolstra
8739d35529
Fix tests/NixOS/nix/2.18.1
2025-05-07 19:22:14 +02:00
Eelco Dolstra
2a35d8f800
Add a special type of context for the result of toString
...
When you apply `builtins.toString` to a path value representing a path
in the Nix store (as is the case with flake inputs), historically you
got a string without context (e.g. `/nix/store/...-source`). This is
broken, since it allows you to pass a store path to a
derivation/toFile without a proper store reference. This is especially
a problem with lazy trees, since the store path is a virtual path that
doesn't exist and can be different every time.
For backwards compatibility, and to warn users about this unsafe use
of `toString`, we now keep track of such strings as a special type of
context.
2025-05-07 18:53:39 +02:00
Eelco Dolstra
df93fa8604
Merge pull request #27 from DeterminateSystems/lazy-trees-v2
...
Lazy trees v2
2025-05-07 15:03:25 +00:00
Eelco Dolstra
f6ad6291ab
nix flake metadata: Show store path if available
2025-05-07 15:56:35 +02:00
Eelco Dolstra
9bab483196
Improve error message
...
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2025-05-07 14:07:29 +02:00
Eelco Dolstra
91cde8c79d
EvalState::mountInput(): Throw an error if there is a NAR hash mismatch
2025-05-07 14:07:29 +02:00
gustavderdrache
fb01b8c5c9
Nits: formatting
2025-05-06 15:30:33 -04:00
gustavderdrache
d4eb6059c9
Update src/nix/upgrade-nix.cc
...
Co-authored-by: Graham Christensen <graham@grahamc.com>
2025-05-06 15:11:34 -04:00
gustavderdrache
49da034ecd
Deprecate upgrade-nix command
2025-05-06 15:05:34 -04:00
John Ericson
1594d4b879
Fix windows warning
2025-05-06 15:02:10 -04:00
Eelco Dolstra
577b331464
Merge remote-tracking branch 'detsys/detsys-main' into lazy-trees-v2
2025-05-06 19:09:09 +02:00
Eelco Dolstra
060c34b664
Attempt to fix macOS build
2025-05-06 08:50:14 +02:00
Eelco Dolstra
47989a2124
Simplify ConfigRegistrations
2025-05-05 09:42:16 +02:00
Eelco Dolstra
f59ccb468e
Simplify Implementations registration
2025-05-05 08:41:23 +02:00
Eelco Dolstra
93844a5998
Simplify registerInputScheme()
2025-05-05 08:35:59 +02:00
Eelco Dolstra
e7c0906521
Simplify RegisterCommand
2025-05-05 08:28:12 +02:00
Eelco Dolstra
4de7a986d4
Simplify RegisterPrimOp
2025-05-05 08:26:29 +02:00
Eelco Dolstra
b7add9736c
Simplify RegisterLegacyCommand
2025-05-05 08:22:53 +02:00
Eelco Dolstra
1479305001
Simplify RegisterBuiltinBuilder
2025-05-05 08:16:09 +02:00
Eelco Dolstra
c7a84b9160
Pass tmpDirInSandbox to the builtin builders
2025-05-04 22:19:34 +02:00
Jörg Thalheim
bd80a4f176
Merge pull request #13137 from xokdvium/regex-cache-transparent
...
libexpr: Use C++20 heterogeneous lookup for RegexCache
2025-05-04 22:18:07 +02:00
Eelco Dolstra
fe0124fe17
Put the builder context in a struct
2025-05-04 22:14:11 +02:00
Eelco Dolstra
40bbad3be5
Allow dynamic registration of builtin builders
2025-05-04 22:09:45 +02:00
Sergei Zimmerman
36c583dae0
libexpr: Use C++20 heterogeneous lookup for RegexCache
2025-05-04 16:03:57 +00:00