about summary refs log tree commit diff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/.skip-subtree2
-rw-r--r--views/README.md31
-rw-r--r--views/default.nix26
-rw-r--r--views/kit/README.md26
-rw-r--r--views/kit/buildkite.yml16
-rw-r--r--views/kit/default.nix33
-rw-r--r--views/kit/workspace.josh14
-rw-r--r--views/tvix/buildkite.yml9
-rw-r--r--views/tvix/default.nix24
-rw-r--r--views/tvix/workspace.josh5
10 files changed, 186 insertions, 0 deletions
diff --git a/views/.skip-subtree b/views/.skip-subtree
new file mode 100644
index 000000000000..d33c73476b52
--- /dev/null
+++ b/views/.skip-subtree
@@ -0,0 +1,2 @@
+//views is not part of the depot build tree, see the README for more
+information.
diff --git a/views/README.md b/views/README.md
new file mode 100644
index 000000000000..a6ebd93a7788
--- /dev/null
+++ b/views/README.md
@@ -0,0 +1,31 @@
+depot views
+===========
+
+This folder contains external views of depot content, defined using
+josh workspaces. See the individual views for a description of their
+individual content and usage information.
+
+Testing changes locally
+-----------------------
+
+Generally, when iterating on these files, it's best to locally invoke `josh-
+filter` (from `//third_party//josh`) locally to inspect how the workspace would
+look like:
+
+  - Commit your changes. This is required, as `josh-filter` operates on your
+    `HEAD`, not working directory state.
+  - Invoke `josh-filter` with the filter expression,
+    for example `josh-filter ':workspace=views/tvix'`.
+  - Peek at the synthesized git history by looking at `FILTERED_HEAD`.
+
+Testing changes in Gerrit
+-------------------------
+
+It's also possible to clone resulting workspaces for CLs that were already
+pushed to Gerrit, but didn't land in master yet.
+
+For CL1234 at revision 2, the URL passed to `git clone` would look like this:
+
+```
+https://code.tvl.fyi/depot.git@refs/changes/32/1234/2:workspace=views/kit.git
+````
diff --git a/views/default.nix b/views/default.nix
new file mode 100644
index 000000000000..83c2782719ca
--- /dev/null
+++ b/views/default.nix
@@ -0,0 +1,26 @@
+# Export configuration for the views.
+{ depot, pkgs, ... }:
+
+let
+  export-tvix = depot.tools.releases.filteredGitPush {
+    filter = ":workspace=views/tvix";
+    remote = "git@github.com:tvlfyi/tvix.git";
+    ref = "refs/heads/canon";
+  };
+
+  export-kit = depot.tools.releases.filteredGitPush {
+    filter = ":unsign:workspace=views/kit";
+    remote = "git@github.com:tvlfyi/kit.git";
+    ref = "refs/heads/canon";
+  };
+in
+(pkgs.runCommandLocal "export-views" { }
+  ''
+    echo "no-op carrier target for repo export steps" | tee $out
+  '').overrideAttrs
+  (_: {
+    meta.ci.extraSteps = {
+      inherit export-tvix export-kit;
+    };
+  })
+
diff --git a/views/kit/README.md b/views/kit/README.md
new file mode 100644
index 000000000000..95a38e738260
--- /dev/null
+++ b/views/kit/README.md
@@ -0,0 +1,26 @@
+The TVL Kit
+===========
+
+[![Build status](https://badge.buildkite.com/cd7240a881c7e77c3ed8cc040f81734623f57038563b37213d.svg?branch=canon)](https://buildkite.com/tvl/tvl-kit)
+
+This folder contains a publicly available version of the core TVL
+tooling, currently comprising of:
+
+* `buildkite`: TVL tooling for dynamically generating Buildkite
+  pipelines with Nix.
+* `buildGo`: Nix-based build system for Go.
+* `readTree`: Nix library to dynamically compute attribute trees
+  corresponding to the physical layout of a repository.
+* `besadii`: Configurable Gerrit/Buildkite integration hook.
+* `magrathea`: Command-line tool for working with TVL-style monorepos
+* `checks`: Collection of useful CI checks for Buildkite
+
+It can be accessed via git by cloning it as such:
+
+    git clone https://code.tvl.fyi/depot.git:unsign:workspace=views/kit.git tvl-kit
+
+If you are looking at this within the TVL depot, you can see the
+[josh][] configuration in `workspace.josh`. You will find the projects
+at slightly different paths within the depot.
+
+[josh]: https://github.com/josh-project/josh/
diff --git a/views/kit/buildkite.yml b/views/kit/buildkite.yml
new file mode 100644
index 000000000000..0bba63726db5
--- /dev/null
+++ b/views/kit/buildkite.yml
@@ -0,0 +1,16 @@
+# Build pipeline for the filtered //views/kit workspace of depot. This
+# pipeline is triggered by each build of canon.
+#
+# Pipeline status is visible on https://buildkite.com/tvl/tvl-kit
+
+steps:
+  - command: "nix-build --no-out-link -A besadii"
+    label: ":nix: besadii"
+
+  - command: "nix-build --no-out-link -A magrathea"
+    label: ":nix: magrathea"
+
+  - label: ":nix: lazy-deps"
+    command: |
+      nix-build -E 'with import ./. {}; lazy-deps { mg.attr = "magrathea"; }'
+      result/bin/mg
diff --git a/views/kit/default.nix b/views/kit/default.nix
new file mode 100644
index 000000000000..4e7e5955aa74
--- /dev/null
+++ b/views/kit/default.nix
@@ -0,0 +1,33 @@
+# Externally importable TVL depot stack. This is intended to be called
+# with a supplied package set, otherwise the package set currently in
+# use by the TVL depot will be used.
+#
+# For now, readTree is not used inside of this configuration to keep
+# it simple. Adding it may be useful if we set up test scaffolding
+# around the exported workspace.
+
+{ pkgs ? (import ./nixpkgs {
+    depotOverlays = false;
+    depot.third_party.sources = import ./sources { };
+    externalArgs = args;
+  })
+, ...
+}@args:
+
+pkgs.lib.fix (self: {
+  besadii = import ./besadii {
+    depot.nix.buildGo = self.buildGo;
+  };
+
+  buildGo = import ./buildGo { inherit pkgs; };
+
+  buildkite = import ./buildkite {
+    inherit pkgs;
+    depot.nix.readTree = self.readTree;
+  };
+
+  checks = import ./checks { inherit pkgs; };
+  lazy-deps = import ./lazy-deps { inherit pkgs; };
+  magrathea = import ./magrathea { inherit pkgs; };
+  readTree = import ./readTree { };
+})
diff --git a/views/kit/workspace.josh b/views/kit/workspace.josh
new file mode 100644
index 000000000000..202dee350dae
--- /dev/null
+++ b/views/kit/workspace.josh
@@ -0,0 +1,14 @@
+::LICENSE
+besadii = :/ops/besadii
+:/nix:[
+    ::buildGo/
+    ::buildkite/
+    ::lazy-deps/
+    ::readTree/
+]
+:/third_party:[
+    ::nixpkgs/
+    ::sources/
+]
+magrathea = :/tools/magrathea
+checks = :/tools/checks
diff --git a/views/tvix/buildkite.yml b/views/tvix/buildkite.yml
new file mode 100644
index 000000000000..4001ba9b9cdb
--- /dev/null
+++ b/views/tvix/buildkite.yml
@@ -0,0 +1,9 @@
+# Build pipeline for the filtered //views/tvix workspace of depot. This
+# pipeline is triggered by each build of canon.
+#
+# Pipeline status is visible on https://buildkite.com/tvl/tvix
+
+steps:
+  - label: ":crab: cargo build"
+    command: |
+      nix-shell --run "cargo build && cargo test"
diff --git a/views/tvix/default.nix b/views/tvix/default.nix
new file mode 100644
index 000000000000..33d6b6368668
--- /dev/null
+++ b/views/tvix/default.nix
@@ -0,0 +1,24 @@
+# Externally importable TVL depot stack. This is intended to be called
+# with a supplied package set, otherwise the package set currently in
+# use by the TVL depot will be used.
+#
+{ pkgs ? (import ./nixpkgs {
+    depotOverlays = false;
+    depot.third_party.sources = import ./sources { };
+  })
+, ...
+}:
+
+pkgs.mkShell {
+  name = "tvix-rust-dev-env";
+  packages = [
+    pkgs.buf-language-server
+    pkgs.cargo
+    pkgs.clippy
+    pkgs.rust-analyzer
+    pkgs.rustc
+    pkgs.rustfmt
+    pkgs.protobuf
+    pkgs.evans
+  ];
+}
diff --git a/views/tvix/workspace.josh b/views/tvix/workspace.josh
new file mode 100644
index 000000000000..e0b15c7f30b5
--- /dev/null
+++ b/views/tvix/workspace.josh
@@ -0,0 +1,5 @@
+:/third_party:[
+    ::nixpkgs/
+    ::sources/
+]
+:/tvix