Merge pull request #132426 from 06kellyjac/buf

buf: 0.46.0 -> 0.49.0

authored by Sandro and committed by GitHub 6494a1a6 00689008

+35 -10
+21 -10
pkgs/development/tools/buf/default.nix
··· 7 8 buildGoModule rec { 9 pname = "buf"; 10 - version = "0.46.0"; 11 12 src = fetchFromGitHub { 13 owner = "bufbuild"; 14 repo = pname; 15 rev = "v${version}"; 16 - sha256 = "sha256-5mjk31HuPNO/RhmMhIm3dAZAED/Kk33ObjC8KbPKRxk="; 17 - leaveDotGit = true; # Required by TestWorkspaceGit 18 }; 19 - vendorSha256 = "sha256-K8UZDEhAvD292RCEDKfY9PdZGS389vLF3oukcBndUF4="; 20 21 patches = [ 22 # Skip a test that requires networking to be available to work. 23 ./skip_test_requiring_network.patch 24 ]; 25 26 nativeBuildInputs = [ protobuf ]; 27 checkInputs = [ git ]; 28 29 ldflags = [ "-s" "-w" ]; 30 31 preCheck = '' 32 - export PATH=$PATH:$GOPATH/bin 33 # To skip TestCloneBranchAndRefToBucket 34 export CI=true 35 ''; ··· 38 runHook preInstall 39 40 mkdir -p "$out/bin" 41 - dir="$GOPATH/bin" 42 # Only install required binaries, don't install testing binaries 43 - for file in \ 44 "buf" \ 45 "protoc-gen-buf-breaking" \ 46 "protoc-gen-buf-lint" \ 47 "protoc-gen-buf-check-breaking" \ 48 "protoc-gen-buf-check-lint"; do 49 - cp "$dir/$file" "$out/bin/" 50 done 51 52 runHook postInstall 53 ''; 54 55 meta = with lib; { 56 description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices"; 57 - homepage = "https://buf.build"; 58 license = licenses.asl20; 59 - maintainers = with maintainers; [ raboof ]; 60 }; 61 }
··· 7 8 buildGoModule rec { 9 pname = "buf"; 10 + version = "0.49.0"; 11 12 src = fetchFromGitHub { 13 owner = "bufbuild"; 14 repo = pname; 15 rev = "v${version}"; 16 + sha256 = "sha256-xP2UbcHwimN09IXrGp3zhBLL74l/8YKotqBNRTITF18="; 17 }; 18 + vendorSha256 = "sha256-WgQSLe99CbOwJC8ewDcSq6PcBJdmiPRmvAonq8drQ1w="; 19 20 patches = [ 21 # Skip a test that requires networking to be available to work. 22 ./skip_test_requiring_network.patch 23 + # Skip TestWorkspaceGit which requires .git and commits. 24 + ./skip_test_requiring_dotgit.patch 25 ]; 26 27 nativeBuildInputs = [ protobuf ]; 28 + # Required for TestGitCloner 29 checkInputs = [ git ]; 30 31 ldflags = [ "-s" "-w" ]; 32 33 preCheck = '' 34 + # The tests need access to some of the built utilities 35 + export PATH="$PATH:$GOPATH/bin" 36 # To skip TestCloneBranchAndRefToBucket 37 export CI=true 38 ''; ··· 41 runHook preInstall 42 43 mkdir -p "$out/bin" 44 # Only install required binaries, don't install testing binaries 45 + for FILE in \ 46 "buf" \ 47 "protoc-gen-buf-breaking" \ 48 "protoc-gen-buf-lint" \ 49 "protoc-gen-buf-check-breaking" \ 50 "protoc-gen-buf-check-lint"; do 51 + cp "$GOPATH/bin/$FILE" "$out/bin/" 52 done 53 54 runHook postInstall 55 ''; 56 57 + doInstallCheck = true; 58 + installCheckPhase = '' 59 + runHook preInstallCheck 60 + $out/bin/buf --help 61 + $out/bin/buf --version 2>&1 | grep "${version}" 62 + runHook postInstallCheck 63 + ''; 64 + 65 meta = with lib; { 66 + homepage = "https://buf.build"; 67 + changelog = "https://github.com/bufbuild/buf/releases/tag/v${version}"; 68 description = "Create consistent Protobuf APIs that preserve compatibility and comply with design best-practices"; 69 license = licenses.asl20; 70 + maintainers = with maintainers; [ raboof jk ]; 71 }; 72 }
+14
pkgs/development/tools/buf/skip_test_requiring_dotgit.patch
···
··· 1 + diff --git a/internal/buf/cmd/buf/workspace_test.go b/internal/buf/cmd/buf/workspace_test.go 2 + index e051690..8887837 100644 3 + --- a/internal/buf/cmd/buf/workspace_test.go 4 + +++ b/internal/buf/cmd/buf/workspace_test.go 5 + @@ -335,6 +335,9 @@ func TestWorkspaceNestedArchive(t *testing.T) { 6 + } 7 + 8 + func TestWorkspaceGit(t *testing.T) { 9 + + // Requires .git directory which we do not retain due to 10 + + // `leaveDotGit` non-determinism 11 + + t.Skip() 12 + // Directory paths specified as a git reference within a workspace. 13 + t.Parallel() 14 + testRunStdout(