mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 14:37:46 +00:00
buf: 0.46.0 -> 0.49.0
Dropped leaveDotGit to avoid non-determinism issues Skip test that requried .git Slight cleanup Add myself as a maintainer
This commit is contained in:
parent
e60aa92068
commit
1560fde989
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
14
pkgs/development/tools/buf/skip_test_requiring_dotgit.patch
Normal file
14
pkgs/development/tools/buf/skip_test_requiring_dotgit.patch
Normal 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(
|
Loading…
Reference in New Issue
Block a user