From ea1383682df4d308c21e11baed9b4172865a68e0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 25 Apr 2023 03:08:41 +0300 Subject: feat(ops/yandex-cloud-rs): generated gRPC clients for Yandex Cloud This uses tonic to generate the full set of gRPC clients for Yandex Cloud. Includes some utility functions like an authentication interceptor to make these actually work. Since the upstream protos are exported regularly I've decided that the versioning will simply be date-based. The point of this is journaldriver integration, of course, hence also the log-centric example code. Change-Id: I00a615dcba80030e7f9bcfd476b2cfdb298f130d Reviewed-on: https://cl.tvl.fyi/c/depot/+/8525 Tested-by: BuildkiteCI Reviewed-by: tazjin --- ops/yandex-cloud-rs/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ops/yandex-cloud-rs/default.nix (limited to 'ops/yandex-cloud-rs/default.nix') diff --git a/ops/yandex-cloud-rs/default.nix b/ops/yandex-cloud-rs/default.nix new file mode 100644 index 000000000000..55af4b1ff349 --- /dev/null +++ b/ops/yandex-cloud-rs/default.nix @@ -0,0 +1,22 @@ +{ depot, lib, pkgs, ... }: + +let + protoSrc = pkgs.fetchFromGitHub { + owner = "yandex-cloud"; + repo = "cloudapi"; + rev = "67589e7503bd8997b7aa27af86a81fb6b9eec655"; + sha256 = "0d8w98h58xzzcjq9s3y949gv5b4z4r05vgpz3n22asyfrfx6x6kf"; + }; +in +pkgs.rustPlatform.buildRustPackage rec { + name = "yandex-cloud-rs"; + src = depot.third_party.gitignoreSource ./.; + cargoLock.lockFile = ./Cargo.lock; + YANDEX_CLOUD_PROTOS = "${protoSrc}"; + nativeBuildInputs = [ pkgs.protobuf ]; + + # The generated doc comments contain lots of things that rustc + # *thinks* are doctests, but are actually just garbage leading to + # compiler errors. + doCheck = false; +} -- cgit 1.4.1