From db2137d756001f150c37003b0fa84fc13ce00384 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 15 Nov 2024 05:22:54 +0000 Subject: [PATCH] ccache: disable --- hosts/modules/roles/build-machine.nix | 23 +++++++++++++---------- overlays/pkgs-ccache.nix | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/hosts/modules/roles/build-machine.nix b/hosts/modules/roles/build-machine.nix index ef584c4a1..051099581 100644 --- a/hosts/modules/roles/build-machine.nix +++ b/hosts/modules/roles/build-machine.nix @@ -50,16 +50,19 @@ in nix.settings.system-features = [ "big-parallel" ]; - programs.ccache.enable = true; - nix.settings.extra-sandbox-paths = [ "/var/cache/ccache" ]; - sane.persist.sys.byStore.plaintext = [ - { group = "nixbld"; mode = "0775"; path = "/var/cache/ccache"; method = "bind"; } - ]; - # `sloppiness = random_seed`: see - sane.fs."/var/cache/ccache/ccache.conf".file.text = '' - max_size = 50G - sloppiness = random_seed - ''; + # XXX(2024-xx): ccache _works_, but the cache hit rate is so low that it's often a net negative! + # ElvishJerricco linked his ccache config in #nix-offtopic 2024-11-09, claiming he got it to + # actually speed things up with the right env vars; didn't see anything obvious there. + # programs.ccache.enable = true; + # nix.settings.extra-sandbox-paths = [ "/var/cache/ccache" ]; + # sane.persist.sys.byStore.plaintext = [ + # { group = "nixbld"; mode = "0775"; path = "/var/cache/ccache"; method = "bind"; } + # ]; + # # `sloppiness = random_seed`: see + # sane.fs."/var/cache/ccache/ccache.conf".file.text = '' + # max_size = 50G + # sloppiness = random_seed + # ''; # corresponds to env var: NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 # nixpkgs.config.allowUnsupportedSystem = true; diff --git a/overlays/pkgs-ccache.nix b/overlays/pkgs-ccache.nix index 991d509da..94f20df76 100644 --- a/overlays/pkgs-ccache.nix +++ b/overlays/pkgs-ccache.nix @@ -1,5 +1,5 @@ # `pkgsCCcache.foo`: builds `foo`, using the `ccache` compiler so that incremental builds are cheaper. -# requires `programs.ccache.enable = true`. +# requires `programs.ccache.enable = true` (see: ) # # common operations: # - `nix-ccache --show-stats`