feat(tools/tvlc): init project

tvlc is a tool for managing sparse git worktrees of the TVL depot.
It is still in development; near-term tasks include a setup script,
Nix dependency resolution, worktree removal, and the dispatch
script.

See cs.tvl.fyi/depot/docs/designs/SPARSE_CHECKOUTS.md for more info.

Change-Id: Iad96656f0206178980fe7dcadd3dffe70d690f8f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1760
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Kane York 2020-08-16 18:03:32 -07:00 committed by kanepyork
parent d6f17f48de
commit 92d4554b62
5 changed files with 171 additions and 0 deletions

35
tools/tvlc/default.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs, depot, ... }:
let
commonsh = ./common.sh;
# TODO(riking): path deduction
#tvix-instantiate="${third_party.nix}/bin/nix-instantiate"
pathScripts = pkgs.writeShellScript "imports" ''
'';
# setup: git rev-parse --show-toplevel > $tvlc_root/depot_root
# setup: mkdir $tvlc_root/clients
# setup: echo 1 > $tvlc_root/next_clientid
tvlcNew = pkgs.stdenv.mkDerivation {
name = "tvlc-new";
src = ./tvlc-new;
doCheck = true;
unpackPhase = "true";
buildPhase = ''
substitute ${./tvlc-new} $out --replace common.sh ${commonsh}
'';
checkPhase = ''
${pkgs.shellcheck}/bin/shellcheck $out ${commonsh} && echo "SHELLCHECK OK"
'';
installPhase = ''
chmod +x $out
'';
};
in pkgs.stdenv.mkDerivation rec {
inherit commonsh;
inherit tvlcNew;
}