From 3a8925239a690a97804cfe7196c6c23c32d7306f Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 9 Sep 2021 00:20:31 +0200 Subject: refactor(web/bubblegum): only rebuild examples on dependency change Using sparseTree we can make a (surprisingly long) list of things from depot the examples depend on and create a stripped down depot version which only contains them. As a result the examples are no longer rebuilt on every commit. Change-Id: I3693570ca4bdbbf9da795e552f278f3b1b1b77a9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3504 Tested-by: BuildkiteCI Reviewed-by: tazjin --- web/bubblegum/default.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/bubblegum/default.nix b/web/bubblegum/default.nix index ed4e48839b89..0ad541390bb7 100644 --- a/web/bubblegum/default.nix +++ b/web/bubblegum/default.nix @@ -6,8 +6,27 @@ let runExecline getBins utils + sparseTree ; + minimalDepot = sparseTree depot.path [ + # general depot things + (depot.path + "/default.nix") + (depot.path + "/nix/readTree") + # nixpkgs for lib and packages + (depot.path + "/third_party/nixpkgs") + (depot.path + "/third_party/overlays") + # bubblegum and its dependencies + (depot.path + "/web/bubblegum") + (depot.path + "/nix/runExecline") + (depot.path + "/nix/utils") + (depot.path + "/nix/sparseTree") + # tvix docs for svg demo + (depot.path + "/tvix/docs") + # for blog.nix + (depot.path + "/users/sterni/nix") + ]; + statusCodes = { # 1xx "Continue" = 100; @@ -205,7 +224,7 @@ let ] ++ [ "${bins.nint}" # always pass depot so scripts can use this library - "--arg depot '(import ${depot.path} {})'" + "--arg depot '(import ${minimalDepot} {})'" ]); in runExecline.local drvName {} [ "importas" "out" "out" -- cgit 1.4.1