From 7837a236e728988fcd501917444828b790c367f9 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 01:48:55 +0000 Subject: populate: lock files rewritten in place change only if they differ A file or git source whose lock file the flakes step rewrites in place gets the original back from delivering it, on every run, from rsync, or from git reset, which also printed HEAD is now at, and Nix printed that it updates the lock file, so the record said the source changed on every run. Populate keeps a copy of the rewritten lock file in .populate/locks/, and the flakes step compares with it, printing what Nix says about the lock file, and changed, only if it differs. Delivering such a source doesn't count bringing back the lock file: rsync returns the paths of what it changed, and the git source's script takes the lock file's path, and resets quietly if that's all that differs. relock also checks that the second, unchanged, run prints nothing about lock files, and says nothing changed, now for rewriting in place too. --- pkgs/populate/src/flake_input.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/populate/src/flake_input.rs') diff --git a/pkgs/populate/src/flake_input.rs b/pkgs/populate/src/flake_input.rs index b38965d..9763ade 100644 --- a/pkgs/populate/src/flake_input.rs +++ b/pkgs/populate/src/flake_input.rs @@ -595,7 +595,7 @@ fn upload_patches( &dir.to_string_lossy(), &format!("{sentinel}/patches/{name}"), ) - .map(|_| ()) + .map(drop) } /// Uploads the flake itself to a target that can't fetch it, unless the @@ -615,7 +615,7 @@ fn upload_self(context: &Context, name: &str, sentinel: &str, self_path: &str) - .join("flake-uploads") .join(name) .join("tree"); - rsync::transfer(context, &config, self_path, &upload.to_string_lossy()).map(|_| ()) + rsync::transfer(context, &config, self_path, &upload.to_string_lossy()).map(drop) } #[cfg(test)] -- cgit v1.3.1