summaryrefslogtreecommitdiffhomepage
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/blog/where_flakes_fall_off.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/content/blog/where_flakes_fall_off.md b/content/blog/where_flakes_fall_off.md
index 2aec88e..7720222 100644
--- a/content/blog/where_flakes_fall_off.md
+++ b/content/blog/where_flakes_fall_off.md
@@ -2,7 +2,7 @@
title = "where flakes fall off: an eval cache tale"
author = ["santi"]
description = "a lower case only blog, purely for aesthetics"
-lastmod = 2025-04-22T16:42:48-03:00
+lastmod = 2025-04-22T21:36:26-03:00
tags = ["nix", "flakes"]
draft = false
+++
@@ -100,7 +100,7 @@ evaluating file '/nix/store/0r5c4j5yww8mljggyy3f97glppgnc2pk-source/a/b/c/flake.
(...)
```
-not only do we see the whole copy going on behind our backs together will all file evaluations, we can also see the following worrying line: `source path '/home/leonardo/my-repo/home/leonardo/my-repo/' is uncacheable` (I'll assume the duplicate path is just an issue with the debug print). yep, **flakes can only cache evaluations on clean git trees**.
+not only do we see the whole copy going on behind our backs together with all file evaluations, we can also see the following worrying line: `source path '/home/leonardo/my-repo/home/leonardo/my-repo/' is uncacheable` (I'll assume the duplicate path is just an issue with the debug print). yep, **flakes can only cache evaluations on clean git trees**.
```sh
$ ~/my-repo :: git add .
@@ -174,7 +174,7 @@ thus, we can summarize the two main issues with flakes evaluation cache as:
I'm not the first person to have suffered with these issues. the [lazy trees pull request](https://github.com/NixOS/nix/pull/6530) has been on going since 2022, trying to avoid unncessary copies to the store when the local repository store path isn't read from during evaluation. I don't know the current state of its implementation but the changes are so big that it's been spliced into multiple smaller PRs, so I do not know when this issue is getting fixed. it also does not try to tackle the lack of glanularity of cache invalidation, so I had to look for other solutions.
-the devenv.sh team had noticed that flake eval cache was unreliable and [hand rolled their own](https://devenv.sh/blog/2024/10/03/devenv-13-instant-developer-environments-with-nix-caching/). the solution to the copies is actually to just not do it, by using `nix-build` instead of `nix build`, but, in order to get better glanularity, you need to track yourself which files are read from during evaluation, and implement and invalidate the cache yourself.
+the [devenv.sh](https://devenv.sh/) team had noticed that flake eval cache was unreliable and [hand rolled their own](https://devenv.sh/blog/2024/10/03/devenv-13-instant-developer-environments-with-nix-caching/). the solution to the copies is actually to just not do it, by using `nix-build` instead of `nix build`, but, in order to get better glanularity, you need to track yourself which files are read from during evaluation, and implement and invalidate the cache yourself.
they do it by utilizing the same approach as the [lorri tool](https://github.com/nix-community/lorri): leveraging nix's internal logs, whereby invoking `nix-build` with `-vv --log-format internal-json` provides you a very barebones look into exactly which files and directories are read from during evaluation, which form the basis of a much nicer and more glanular cache.