Skip to content

Commit 5f30c1c

Browse files
author
Arnaud Bailly
authored
Adding some note about local vs. global nix.conf (input-output-hk#1924)
I faced some puzzling behaviour where artifacts expected to be cached were not found and nix built them. It turned out the local configuration was wrong. It's not clear how this configuration was written in the first place as the most likely candidate I checked should have had different caches.
1 parent 6bdb9aa commit 5f30c1c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/troubleshooting.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ If you think you are doing all of these and you still find you're building GHC,
1515
### Why am I building lots of Haskell packages?
1616

1717
We don't generally cache much of Hackage (there's a lot of it!), except for the parts which are used by our tests.
18-
So this is expected, unfortunately.
18+
So this is expected, unfortunately. However, if you are building from a recent branch without significant dependencies
19+
changes, most of those dependencies should be cached and you should not be building core things like `Cabal` or `ghc-lib`.
20+
21+
If this happens, chances are nix cache are either:
22+
* Incorrectly configured: Check the aforementioned links,
23+
* Overriding global configuration in `/etc/nix/nix.conf` with local `~/.config/nix/nix.conf`. This can happen if for example
24+
one project is using `nix flake` with some locally configured repositories, while another project is not.
25+
Use `nix show-config` to check which caches are defined, then update or remove `~/.config/nix/nix.conf`.
1926

2027
### How do I prevent the evaluation-time dependencies of my project from being garbage-collected?
2128

0 commit comments

Comments
 (0)