diff options
-rw-r--r-- | .envrc | 15 | ||||
-rw-r--r-- | .gcroots/.skip-subtree | 1 | ||||
-rw-r--r-- | .gitignore | 3 |
3 files changed, 17 insertions, 2 deletions
diff --git a/.envrc b/.envrc index 71a05d58b773..1f15539fb2d4 100644 --- a/.envrc +++ b/.envrc @@ -1,7 +1,18 @@ +# Create a gcroot that keeps all third_party.sources alive +nix-build --out-link .gcroots/sources -E ' +with import ./. {}; +third_party.nixpkgs.writeText "depot-3p-sources.txt" ( + toString ( + builtins.map (s: s.outPath or null) ( + builtins.attrValues third_party.sources + ) + ) +)' + # Configure the local PATH to contain tools which are fetched ad-hoc # from Nix. - -out=$(nix-build -A tools.depot-deps --no-out-link) +out=$(nix-build -A tools.depot-deps --out-link .gcroots/depot-deps) PATH_add "$out/bin" watch_file tools/depot-deps.nix +watch_file third_party/sources/sources.json diff --git a/.gcroots/.skip-subtree b/.gcroots/.skip-subtree new file mode 100644 index 000000000000..8c3e8d06db93 --- /dev/null +++ b/.gcroots/.skip-subtree @@ -0,0 +1 @@ +these are just symlinks to prevent Nix from gc-ing paths we'd like to keep diff --git a/.gitignore b/.gitignore index 0b135e70341b..9066757e58e4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ # trash locally that might be valuable in the future. garbage/ +# Nix gcroot symlinks created by .envrc +/.gcroots/* + # Ignore Nix result symlinks result result-* |