@@ -59,32 +59,12 @@ final: prev: {
5959
6060 pkgsIncludeOS = prev . pkgsStatic . lib . makeScope prev . pkgsStatic . newScope ( self :
6161 let
62- ccacheNoticeHook = prev . writeTextFile {
63- name = "ccache-notice-hook" ;
64- destination = "/nix-support/setup-hook" ;
65- text = ''
66- echo "====="
67- echo "ccache is enabled!"
68- echo "If you run into any issues, try: --arg withCcache false"
69- echo "It's recommended to run tests with ccache disabled to avoid cache incoherencies."
70- echo "====="
71- '' ;
72- } ;
73-
74- suppressTargetWarningHook = prev . writeTextFile {
75- name = "suppress-target-warning-hook" ;
76- destination = "/nix-support/setup-hook" ;
77- text = ''
78- # see https://github.com/NixOS/nixpkgs/issues/395191
79- # delete this hook and downstream references once resolved
62+ ccache = import ./nix/ccache.nix { pkgs = prev ; inherit ( self . stdenv ) cc ; } ;
8063
81- export NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1
82- '' ;
83- } ;
64+ suppress = import ./nix/suppress.nix { pkgs = prev ; } ;
8465 in {
8566 # self.callPackage will use this stdenv.
8667 stdenv = final . stdenvIncludeOS . includeos_stdenv ;
87- inherit suppressTargetWarningHook ;
8868
8969 # Deps
9070 botan2 = self . callPackage ./deps/botan/default.nix { } ;
@@ -95,36 +75,6 @@ final: prev: {
9575
9676 vmbuild = self . callPackage ./vmbuild.nix { } ;
9777
98- ccacheWrapper = prev . ccacheWrapper . override {
99- inherit ( self . stdenv ) cc ;
100- extraConfig = ''
101- export CCACHE_DIR="/nix/var/cache/ccache"
102- if [ ! -d "$CCACHE_DIR" ]; then
103- echo "====="
104- echo "Directory '$CCACHE_DIR' does not exist"
105- echo "Please create it with:"
106- echo " sudo mkdir -m0770 '$CCACHE_DIR'"
107- echo " sudo chown root:nixbld '$CCACHE_DIR'"
108- echo ""
109- echo 'Alternatively, disable ccache with `--arg withCcache false`'
110- echo "====="
111- exit 1
112- fi
113- if [ ! -w "$CCACHE_DIR" ]; then
114- echo "====="
115- echo "Directory '$CCACHE_DIR' exists, but is not accessible for user $(whoami)"
116- echo "Please verify its access permissions"
117- echo 'Alternatively, disable ccache with `--arg withCcache false`'
118- echo "====="
119- exit 1
120- fi
121-
122- export CCACHE_COMPRESS=1
123- export CCACHE_UMASK=007
124- export CCACHE_SLOPPINESS=random_seed
125- '' ;
126- } ;
127-
12878 # IncludeOS
12979 includeos = self . stdenv . mkDerivation rec {
13080 enableParallelBuilding = true ;
@@ -155,8 +105,8 @@ final: prev: {
155105 nativeBuildInputs = [
156106 prev . buildPackages . cmake
157107 prev . buildPackages . nasm
158- ] ++ prev . lib . optionals disableTargetWarning [ suppressTargetWarningHook ]
159- ++ prev . lib . optionals withCcache [ self . ccacheWrapper ccacheNoticeHook ] ;
108+ ] ++ prev . lib . optionals disableTargetWarning [ suppress . targetWarningHook ]
109+ ++ prev . lib . optionals withCcache [ ccache . wrapper ccache . noticeHook ] ;
160110
161111 buildInputs = [
162112 self . libfmt
0 commit comments