From 58827c3bee1fedeb5f471328b60adea420339a2f Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Nov 2026 12:27:15 +0000 Subject: run-firecracker-vm: the guest drops its caches when nixpkgs's commit changes With --nixpkgs-cache (loose: 7s for nix-instantiate '' -A hello, against 20s without), the guest doesn't see changes to the host's nixpkgs until it drops its caches. When nixpkgs is a Git checkout, the run script now checks its commit every 5 seconds, and on a change (checkout, pull, rebase), connects to the guest's vsock port 1235, where layers/nix.nix has fc-drop-caches run. Changes without a commit still need fc-drop-caches by hand. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8556192..aed5d95 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,11 @@ With nix, `/nixpkgs` is the nixpkgs the guest was built from not cached in the guest, so changes to it show up right away, but evaluating is slow; `--nixpkgs-cache=loose` caches it (several times faster, but changes may not show up while the guest runs). Other modes: -`mmap`, `readahead`, `none` (the default). +`mmap`, `readahead`, `none` (the default). With a cache mode, and a Git +checkout, the run script tells the guest to drop its caches whenever the +checkout's commit changes. For other changes, and in the rare case +that the guest looked for a store path before the host had it, anyone +in the guest can drop them: `fc-drop-caches` (it takes seconds). The guest gets 2 CPUs and 1024 MiB unless told otherwise (`--vcpus N`, 1 to 32; `--mem-size MIB`). -- cgit v1.3.1