about summary refs log tree commit diff
path: root/proto.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-13T00·08+0000
committerVincent Ambo <mail@tazj.in>2019-12-13T00·39+0000
commit369c86e0ef8a713d47c2a6b94a3f70d527b84a3c (patch)
tree82eee3a2701af9170f23577f78ecaa22bb8da4b9 /proto.nix
parent41c28cf60ec27afde7379d2389ce8b5b7d420c5e (diff)
fix(proto): Refactor gRPC dependencies to match new external layout
This is now a lot more fine-grained than before, but it actually works
fine.

This stuff is a bit annoying to write by hand. There are multiple
different options available (e.g. carrying an attribute set of all
subpackages in each `external` and only passing that, having a tool
generate this, etc.).
Diffstat (limited to 'proto.nix')
-rw-r--r--proto.nix32
1 files changed, 24 insertions, 8 deletions
diff --git a/proto.nix b/proto.nix
index dd40def0ff..2ece948ebd 100644
--- a/proto.nix
+++ b/proto.nix
@@ -19,11 +19,17 @@ in rec {
 
   xnet = external {
     path = "golang.org/x/net";
-    deps = [ xtext ];
+
     src = fetchGit {
       url = "https://go.googlesource.com/net";
       rev = "ffdde105785063a81acd95bdf89ea53f6e0aac2d";
     };
+
+    deps = map (p: p.gopkg) [
+      xtext.secure.bidirule
+      xtext.unicode.bidi
+      xtext.unicode.norm
+    ];
   };
 
   xsys = external {
@@ -48,21 +54,31 @@ in rec {
       url = "https://github.com/google/go-genproto";
       rev = "83cc0476cb11ea0da33dacd4c6354ab192de6fe6";
     };
+
+    deps = with goProto; map (p: p.gopkg) [
+      proto
+      ptypes.any
+    ];
   };
 
   goGrpc = external {
     path = "google.golang.org/grpc";
-    deps = [ goProto xnet xsys genproto ];
+    deps = map (p: p.gopkg) ([
+      xnet.trace
+      xnet.http2
+      xsys.unix
+      xnet.http2.hpack
+      genproto.googleapis.rpc.status
+    ] ++ (with goProto; [
+      proto
+      ptypes
+      ptypes.duration
+      ptypes.timestamp
+    ]));
 
     src = fetchGit {
       url = "https://github.com/grpc/grpc-go";
       rev = "d8e3da36ac481ef00e510ca119f6b68177713689";
     };
-
-    targets = [
-      "."
-      "codes"
-      "status"
-    ];
   };
 }