Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buf: init at 0.40.0 #117575

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions pkgs/development/tools/buf/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ lib
, buildGoModule
, fetchFromGitHub
, protobuf
}:

buildGoModule rec {
pname = "buf";
version = "0.40.0";

src = fetchFromGitHub {
owner = "bufbuild";
repo = pname;
rev = "v${version}";
sha256 = "sha256-N6o+1cfer8rgKJ3+CL25axJSjGV/YSG1sLIHXJzsC6o=";
};

patches = [
./skip_test_requiring_network.patch
];

preCheck = ''
export PATH=$PATH:$GOPATH/bin
'';

nativeBuildInputs = [ protobuf ];

vendorSha256 = "sha256-vl+WqtpegoAvylx/lcyfJk8DAOub8U4Lx3Pe3eW4M/E=";

meta = with lib; {
description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
homepage = "https://buf.build";
license = licenses.asl20;
maintainers = with maintainers; [ raboof ];
};
}
15 changes: 15 additions & 0 deletions pkgs/development/tools/buf/skip_test_requiring_network.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/internal/buf/internal/buftesting/buftesting.go b/internal/buf/internal/buftesting/buftesting.go
index dc8da0c..70ad299 100644
--- a/internal/buf/internal/buftesting/buftesting.go
+++ b/internal/buf/internal/buftesting/buftesting.go
@@ -100,6 +100,10 @@ func RunActualProtoc(

// GetGoogleapisDirPath gets the path to a clone of googleapis.
func GetGoogleapisDirPath(t *testing.T, buftestingDirPath string) string {
+ // Requires network access, which is not available during
+ // the nixpkgs sandboxed build
+ t.Skip()
+
googleapisDirPath := filepath.Join(buftestingDirPath, testGoogleapisDirPath)
require.NoError(
t,
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ in

breakpad = callPackage ../development/misc/breakpad { };

buf = callPackage ../development/tools/buf { };

# Zip file format only allows times after year 1980, which makes e.g. Python wheel building fail with:
# ValueError: ZIP does not support timestamps before 1980
ensureNewerSourcesForZipFilesHook = ensureNewerSourcesHook { year = "1980"; };
Expand Down