aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/docs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/populate/docs')
-rw-r--r--pkgs/populate/docs/design.md42
1 files changed, 28 insertions, 14 deletions
diff --git a/pkgs/populate/docs/design.md b/pkgs/populate/docs/design.md
index 7d12c55..db8299f 100644
--- a/pkgs/populate/docs/design.md
+++ b/pkgs/populate/docs/design.md
@@ -107,20 +107,34 @@ via `sudo`.
Populate runs rsync, Git, ssh, and Nix as programs, found in `PATH`.
-Each rsync run costs several round trips to the target, and about 45 ms
-of rsync waiting for its own processes, also when there's nothing to
-transfer. So file sources that rsync would find nothing to do for get
-skipped: right after taking the lock, one command lists the target paths
-of the file sources that are directories, compared by size and time, and
-whose lock file the flakes step doesn't rewrite, with find. Each such
-source's turn lists what rsync would transfer, with find if nothing
-excludes or filters anything, else with `rsync --list-only`, the same run
-that checks the `.rsync-filter` files. If both listings have the same
-entries, with mode and path, and for files size and time in whole seconds,
-and for symlinks the target, as far as rsync's quick check goes, neither
-`break_hard_links` nor rsync runs. Entries populate can't compare, e.g.
-paths with control characters, devices, or a source that needs
-`--insecure-links`, make it run rsync.
+Each command on a remote target costs about three round trips (a
+channel, the command, its exit status), and each rsync run several more,
+and about 45 ms of rsync waiting for its own processes, also when there's
+nothing to transfer. So sources with nothing to do get skipped: right
+after taking the lock, one command on the target, the probe (`probe.rs`),
+finds out what's at the target paths of those whose lock file the flakes
+step doesn't rewrite:
+
+- For file sources that are directories, compared by size and time, a
+ listing, with find. Each such source's turn lists what rsync would
+ transfer, with find if nothing excludes or filters anything, else with
+ `rsync --list-only`, the same run that checks the `.rsync-filter`
+ files. If both listings have the same entries, with mode and path, and
+ for files size and time in whole seconds, and for symlinks the target,
+ as far as rsync's quick check goes, neither `break_hard_links` nor rsync
+ runs. Entries populate can't compare, e.g. paths with control
+ characters, devices, or a source that needs `--insecure-links`, make it
+ run rsync.
+- For symlink sources, the symlink there, if any. If it points to the
+ target already, nothing runs.
+- For git sources with a commit as ref, and without `fetchAlways`, the
+ work tree's HEAD, its origin's URL, what `git status --ignored` and `git
+ submodule status` print, but only if `git_problems` finds nothing wrong
+ with it, which keeps guarding every Git command. If the commit is
+ checked out, the URL is the source's, nothing is modified, untracked,
+ or ignored, and the submodules are at their commits, nothing runs, and
+ the flakes step takes the work tree for checked, as after the git
+ script.
## Development
[cgit] Unable to lock slot /tmp/cgit/c3100000.lock: Permission denied (13)