about summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-11T10·19+0200
committertazjin <mail@tazj.in>2021-04-11T20·09+0000
commitd7b89df748fd9de8015602c1a7d9d36cddd96664 (patch)
tree570db67655dda8b0971b7ba041eee4bc6bf9545b /default.nix
parent6c3585f76425687324275dbbff6098886479c6b6 (diff)
feat(ops/pipelines): Add gcroots for depot builds on canon r/2477
Adds a conditional build step that only runs on the canon branch, and
only if :duck: (the status reporting step) succeeds, which creates a
new Nix GC root for all depot targets named `depot-canon`.

In practice this might be a bit racey, as canon builds are not
guaranteed to succeed in order (though it is likely). This shouldn't
matter much in practice: We only want to prevent rebuilds of the whole
world.

This fixes b/102

Change-Id: Id3d0bf4158bffcb1ed6929888a29d31609b6ece1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2904
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index cc2ebcabcf..c5db0d1e32 100644
--- a/default.nix
+++ b/default.nix
@@ -105,6 +105,12 @@ in fix(self: {
     # remove nixpkgs from the set, for obvious reasons.
     third_party = self.third_party // { nixpkgs = null; };
   });
+
+  # Derivation that gcroots all depot targets.
+  ci.gcroot = self.third_party.nixpkgs.symlinkJoin {
+    name = "depot-gcroot";
+    paths = self.ci.targets;
+  };
 }
 
 # Add local packages as structured by readTree