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 <mail@tazj.in>
This commit is contained in:
sterni 2021-09-09 00:20:31 +02:00
parent 23dd8067c5
commit 3a8925239a

View file

@ -6,8 +6,27 @@ let
runExecline runExecline
getBins getBins
utils 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 = { statusCodes = {
# 1xx # 1xx
"Continue" = 100; "Continue" = 100;
@ -205,7 +224,7 @@ let
] ++ [ ] ++ [
"${bins.nint}" "${bins.nint}"
# always pass depot so scripts can use this library # always pass depot so scripts can use this library
"--arg depot '(import ${depot.path} {})'" "--arg depot '(import ${minimalDepot} {})'"
]); ]);
in runExecline.local drvName {} [ in runExecline.local drvName {} [
"importas" "out" "out" "importas" "out" "out"