Merge pull request #132426 from 06kellyjac/buf

buf: 0.46.0 -> 0.49.0
This commit is contained in:
Sandro 2021-08-11 12:53:19 +02:00 committed by GitHub
commit 6494a1a69c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 10 deletions

View file

@ -7,29 +7,32 @@
buildGoModule rec {
pname = "buf";
version = "0.46.0";
version = "0.49.0";
src = fetchFromGitHub {
owner = "bufbuild";
repo = pname;
rev = "v${version}";
sha256 = "sha256-5mjk31HuPNO/RhmMhIm3dAZAED/Kk33ObjC8KbPKRxk=";
leaveDotGit = true; # Required by TestWorkspaceGit
sha256 = "sha256-xP2UbcHwimN09IXrGp3zhBLL74l/8YKotqBNRTITF18=";
};
vendorSha256 = "sha256-K8UZDEhAvD292RCEDKfY9PdZGS389vLF3oukcBndUF4=";
vendorSha256 = "sha256-WgQSLe99CbOwJC8ewDcSq6PcBJdmiPRmvAonq8drQ1w=";
patches = [
# Skip a test that requires networking to be available to work.
./skip_test_requiring_network.patch
# Skip TestWorkspaceGit which requires .git and commits.
./skip_test_requiring_dotgit.patch
];
nativeBuildInputs = [ protobuf ];
# Required for TestGitCloner
checkInputs = [ git ];
ldflags = [ "-s" "-w" ];
preCheck = ''
export PATH=$PATH:$GOPATH/bin
# The tests need access to some of the built utilities
export PATH="$PATH:$GOPATH/bin"
# To skip TestCloneBranchAndRefToBucket
export CI=true
'';
@ -38,24 +41,32 @@ buildGoModule rec {
runHook preInstall
mkdir -p "$out/bin"
dir="$GOPATH/bin"
# Only install required binaries, don't install testing binaries
for file in \
for FILE in \
"buf" \
"protoc-gen-buf-breaking" \
"protoc-gen-buf-lint" \
"protoc-gen-buf-check-breaking" \
"protoc-gen-buf-check-lint"; do
cp "$dir/$file" "$out/bin/"
cp "$GOPATH/bin/$FILE" "$out/bin/"
done
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/buf --help
$out/bin/buf --version 2>&1 | grep "${version}"
runHook postInstallCheck
'';
meta = with lib; {
description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
homepage = "https://buf.build";
changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}";
description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices";
license = licenses.asl20;
maintainers = with maintainers; [ raboof ];
maintainers = with maintainers; [ raboof jk ];
};
}

View file

@ -0,0 +1,14 @@
diff --git a/internal/buf/cmd/buf/workspace_test.go b/internal/buf/cmd/buf/workspace_test.go
index e051690..8887837 100644
--- a/internal/buf/cmd/buf/workspace_test.go
+++ b/internal/buf/cmd/buf/workspace_test.go
@@ -335,6 +335,9 @@ func TestWorkspaceNestedArchive(t *testing.T) {
}
func TestWorkspaceGit(t *testing.T) {
+ // Requires .git directory which we do not retain due to
+ // `leaveDotGit` non-determinism
+ t.Skip()
// Directory paths specified as a git reference within a workspace.
t.Parallel()
testRunStdout(