about summary refs log tree commit diff
path: root/third_party/default.nix
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2020-06-14T11·23+0100
committerlukegb <lukegb@tvl.fyi>2020-06-14T16·35+0000
commita73ca3f43dbf6b179509d6e5e3933be4cf99d989 (patch)
tree97ceb6d378513cb0d7274d94b15edcc8925f40a6 /third_party/default.nix
parent02adb10a96eb06a7c7a2c80b7c9f3e385004ec61 (diff)
feat(gerrit): Create Gerrit derivation. r/948
This uses the actual Bazel build, using a variety of tricks and hacks to
make it actually work.

Bazel really wants to download linux binaries from the internet and run
them. In lieu of trying to fix the build system to not do this, we
instead put bazel inside an FHS environment, which allows the binaries
to find their dependencies.

We also have to patch a few things:

* We use build --nobuild instead of fetch, so we only fetch the
  dependencies we actually need for the build and not, say, Windows
  binaries.
* We don't remove rules_cc, because we need it as an external
  dependency, not bundled.
* We do some manual fixes on the cache before packing, because we need
  to remove some in-tree sources (so they don't cause the hash to break,
  since the hashes differ each time they're generated), and also remove
  some extraneous files.
* We explicitly turn off the repository and disk caches, because the
  .bazelrc at the root of the Gerrit tree turns them on, with paths
  pointing into the user's home directory.
* detzip is used instead of the zip binary for packing bower_components
  into an archive. detzip doesn't create entries for directories, and
  also doesn't store most metadata (timestamps, etc.), and uses store
  (i.e. uncompressed) compression only. It also sorts the file tree
  before writing them into the file.

Change-Id: I572c43f7175067ecb1b85cdf40dda13a52de1439
Reviewed-on: https://cl.tvl.fyi/c/depot/+/252
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'third_party/default.nix')
-rw-r--r--third_party/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/third_party/default.nix b/third_party/default.nix
index 52faff0279b0..a72e04adceb1 100644
--- a/third_party/default.nix
+++ b/third_party/default.nix
@@ -33,6 +33,8 @@ let
       autoreconfHook
       bashInteractive
       bat
+      buildBazelPackage
+      buildFHSUserEnv
       buildGoModule
       buildGoPackage
       buildPackages
@@ -51,6 +53,7 @@ let
       darwin
       dockerTools
       fetchFromGitHub
+      fetchgit
       fetchurl
       fetchzip
       fira
@@ -58,7 +61,6 @@ let
       fira-mono
       fontconfig
       freetype
-      gerrit
       gettext
       glibc
       gmock
@@ -70,6 +72,7 @@ let
       haskell
       iana-etc
       imagemagickBig
+      jdk
       jetbrains-mono
       jq
       kontemplate