Eelco Dolstra
4adb32f7d5
nix flake metadata: Don't show "Inputs" if there are no inputs
2022-08-16 14:58:08 +02:00
Eelco Dolstra
78bd377594
Show when we're evaluating a flake
2022-08-12 15:57:25 +02:00
Eelco Dolstra
330638cf26
ProgressBar: Delay before showing a new activity
...
Some activities are numerous but usually very short (e.g. copying a
source file to the store) which would cause a lot of flickering. So
only show activities that have been running for at least 10 ms.
2022-08-12 15:56:08 +02:00
Eelco Dolstra
ab6466a964
Add FIXME
2022-08-12 14:08:18 +02:00
Eelco Dolstra
639db1e4a8
GitInputScheme::getFingerprint(): Taking the submodules setting into account
...
This setting changes the contents of the tree, so it affects the
evaluation cache and store path cache.
2022-08-12 14:01:03 +02:00
Eelco Dolstra
2d76ef0b7b
Remove warnLargeDump()
...
This message was unhelpful (#1184 ) and probably misleading since
memory is O(1) in most cases now.
2022-08-12 12:28:02 +02:00
Eelco Dolstra
f8bf44bf76
Add an activity for copying sources to the store
...
Fixes #1184 since it's now visible in the progress bar which path is
taking a long time to copy.
2022-08-12 12:20:09 +02:00
Eelco Dolstra
bb962381e9
Fix clang build
2022-08-12 11:58:48 +02:00
Eelco Dolstra
beac2e67cd
Persistently cache InputAccessor::fetchToStore()
...
This especially speeds up repeated evaluations that copy a large
source tree (e.g. 'nix.nixPath = [ "nixpkgs=${nixpkgs}" ];').
2022-08-11 20:34:27 +02:00
Eelco Dolstra
2e0d63caf6
Add InputAccessor::fetchToStore()
2022-08-11 20:03:22 +02:00
Eelco Dolstra
c0d33087c8
Cache git revCount / lastModified attributes
...
Especially revCount is very slow to compute since it requires querying
the entire history.
2022-08-11 12:37:10 +02:00
Eelco Dolstra
3b45475f75
Remove Input::hasAllInfo()
2022-08-10 16:51:45 +02:00
Eelco Dolstra
90e9f50a66
Remove Input::locked
2022-08-10 16:47:36 +02:00
Eelco Dolstra
4f8b253ea7
Remove Input::direct
2022-08-10 16:39:25 +02:00
Eelco Dolstra
dd1dac0f78
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-10 12:38:31 +02:00
Théophane Hufschmitt
5192bb093a
Merge remote-tracking branch 'upstream/master' into fix-mv-in-different-filesystems
2022-08-08 15:42:56 +02:00
Théophane Hufschmitt
f4a8426098
Remove the explicit c++fs
linkage on darwin
...
Doesn't seem needed on a recent-enough clang anymore (and even seems to
break stuff)
2022-08-08 14:34:22 +02:00
Dave Nicponski
cb6794a0d9
Do not spam logs if the owned-homedir check results in a noop
2022-08-07 10:13:11 -04:00
Eelco Dolstra
b449825e91
Resstore 'nix flake archive'
2022-08-04 14:47:41 +02:00
Eelco Dolstra
5ef9008bf3
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-04 13:45:22 +02:00
Eelco Dolstra
15f37eeb5a
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-08-04 13:34:38 +02:00
Erik Arvstedt
4c8441be0a
docs/flake-update: fix example
2022-08-04 09:45:30 +02:00
Erik Arvstedt
53833dfb40
libexpr/flake: remove FIXME
...
Line 593 checks that all overrides (i.e. all elements of
`lockFlags.inputOverrides`) are members of `overridesUsed`.
2022-08-04 09:45:29 +02:00
Erik Arvstedt
c9f446ede1
flakeref: fix comment
2022-08-04 09:45:28 +02:00
Eelco Dolstra
ccbd906c86
Fix NIX_COUNT_CALLS=1
...
Also, make the JSON writer support std::string_view.
Fixes #6857 .
2022-08-03 17:46:51 +02:00
Eelco Dolstra
55a10576c1
nix repl: Print accessors in paths
2022-08-03 16:36:20 +02:00
Théophane Hufschmitt
1ba5b3e001
Make moveFile
more atomic
...
Rather than directly copying the source to its dest, copy it first to a
temporary location, and eventually move that temporary.
That way, the move is at least atomic from the point-of-view of the destination
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
90f9680733
Only use renameFile
where needed
...
In most places the fallback to copying isn’t needed and can actually be
bad, so we’d rather not transparently fallback
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
d71d9e9fbf
moveFile -> renameFile
...
`move` tends to have this `mv` connotation of “I will copy it for you if
needs be”
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
a4f0fd633c
Link against c++fs on darwin
...
Required by the old clang version
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c5db1821a9
Re-implement the recursive directory copy
...
The recursive copy from the stl doesn’t exactly do what we need because
1. It doesn’t delete things as we go
2. It doesn’t keep the mtime, which change the nars
So re-implement it ourselves. A bit dull, but that way we have what we want
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
6f89fb6008
rename: Fallback to a copy if the filesystems mismatch
...
In `nix::rename`, if the call to `rename` fails with `EXDEV` (failure
because the source and the destination are in a different filesystems)
switch to copying and removing the source.
To avoid having to re-implement the copy manually, I switched the
function to use the c++17 `filesystem` library (which has a `copy`
function that should do what we want).
Fix #6262
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c2de0a232c
Create a wrapper around stdlib’s rename
...
Directly takes some c++ strings, and gently throws an exception on error
(rather than having to inline this logic everywhere)
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
8119390abc
Move some fs-related functions to their own file
...
Unclutter `util.cc` a bit
2022-08-03 10:27:25 +02:00
Eelco Dolstra
71b155b9e6
Move download stuff into tarball.hh
2022-08-01 16:05:58 +02:00
Eelco Dolstra
48012603b3
Move FSInputAccessor into a separate file
2022-08-01 16:00:12 +02:00
Eelco Dolstra
55c63c9b89
Remove InputScheme::fetchToStore()
...
InputSchemes now only have a getAccessor(). They could be implemented
internally by fetching the input to the store, but in that case they
will just return a FSInputAccessor.
2022-08-01 15:44:40 +02:00
Eelco Dolstra
59a8e05754
Fix test
2022-07-27 14:41:32 +02:00
Eelco Dolstra
f780539406
Add abstract interface for writing files to an Input
2022-07-27 14:26:15 +02:00
Eelco Dolstra
bb4d35dcca
Make 'nix edit' etc. work again
2022-07-26 17:06:45 +02:00
Eelco Dolstra
1790698a74
Rename fetch() -> fetchToStore(), lazyFetch() -> getAccessor()
2022-07-25 16:30:50 +02:00
Eelco Dolstra
7a64bb7f1c
Rename Input::fetch() to fetchToStore()
2022-07-25 15:48:31 +02:00
Eelco Dolstra
a3427a1478
nix registry pin: Warn if the resolved flake is not locked
2022-07-25 15:48:16 +02:00
Eelco Dolstra
184c6605b0
nix flake pin: Use lazyFetch()
2022-07-25 15:44:45 +02:00
Eelco Dolstra
c0555c8e1f
Remove Input::computeStorePath()
2022-07-25 15:35:53 +02:00
Eelco Dolstra
4f8f52ae58
Remove Tree datatype
2022-07-25 15:21:37 +02:00
Eelco Dolstra
e7faf65784
Remove FlakeRef::fetchTree()
2022-07-25 15:12:28 +02:00
Eelco Dolstra
022390af5a
Merge remote-tracking branch 'origin/master' into lazy-trees
2022-07-22 15:27:40 +02:00
Eelco Dolstra
f97489e7ab
Remove parent hackery from the path fetcher
...
Relative paths of subflakes are now handled in lockFlake().
2022-07-22 15:24:41 +02:00
Eelco Dolstra
3d27ce36d0
Restore the evaluation cache
2022-07-22 15:19:30 +02:00