mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
build: switch from protoc to buf to build protobuf
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
- name: Setup
|
||||
uses: ./.github/actions/setup
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -qqy shared-mime-info curl protobuf-compiler
|
||||
run: sudo apt-get install -qqy shared-mime-info curl
|
||||
|
||||
# Build and test
|
||||
- name: Build
|
||||
@@ -93,8 +93,6 @@ jobs:
|
||||
persist-credentials: false
|
||||
- name: Setup
|
||||
uses: ./.github/actions/setup
|
||||
- name: Install dependencies
|
||||
run: brew install protobuf
|
||||
|
||||
# Build and test
|
||||
- name: Build
|
||||
@@ -157,8 +155,6 @@ jobs:
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -qqy protobuf-compiler
|
||||
- name: Build
|
||||
run: make && ./bin/akvorado version
|
||||
- uses: actions/cache/save@v4
|
||||
|
||||
@@ -23,7 +23,7 @@ run tests:
|
||||
# past but this is a slight burden to maintain in addition to GitHub CI.
|
||||
# Check commit ceaa6ebf8ef6 for the last version supporting functional
|
||||
# tests.
|
||||
- time apk add --no-cache git make gcc musl-dev shared-mime-info npm curl protoc
|
||||
- time apk add --no-cache git make gcc musl-dev shared-mime-info npm curl
|
||||
- export GOMODCACHE=$PWD/.go-cache
|
||||
- npm config --user set cache $PWD/.npm-cache
|
||||
- time go mod download
|
||||
|
||||
7
Makefile
7
Makefile
@@ -59,17 +59,16 @@ GOIMPORTS = go tool goimports
|
||||
GOTESTSUM = go tool gotestsum
|
||||
MOCKGEN = go tool mockgen
|
||||
PIGEON = go tool pigeon
|
||||
PROTOC = protoc
|
||||
PROTOC_GEN_GO = bin/protoc-gen-go
|
||||
REVIVE = go tool revive
|
||||
WWHRD = go tool wwhrd
|
||||
BUF = go run github.com/bufbuild/buf/cmd/buf@v1.55.1
|
||||
|
||||
# Generated files
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
common/pb/rawflow.pb.go: common/pb/rawflow.proto ; $(info $(M) compiling protocol buffers definition…)
|
||||
$Q $(PROTOC) -I=. --plugin=$(PROTOC_GEN_GO) --go_out=. --go_opt=module=$(MODULE) $<
|
||||
common/pb/rawflow.pb.go: %.pb.go: buf.gen.yaml %.proto ; $(info $(M) compiling protocol buffers definition…)
|
||||
$Q $(BUF) generate --path $(@:.pb.go=.proto)
|
||||
|
||||
common/clickhousedb/mocks/mock_driver.go: go.mod ; $(info $(M) generate mocks for ClickHouse driver…)
|
||||
$Q $(MOCKGEN) -package mocks -build_constraint "!release" -destination $@ \
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
go tool protoc-gen-go "$@"
|
||||
7
buf.gen.yaml
Normal file
7
buf.gen.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
version: v2
|
||||
plugins:
|
||||
- local: [ "go", "tool", "protoc-gen-go" ]
|
||||
out: .
|
||||
opt:
|
||||
- paths=source_relative
|
||||
@@ -31,12 +31,12 @@ Currently, only a pre-built binary for Linux x86-64 is provided.
|
||||
|
||||
## Compilation from source
|
||||
|
||||
You need a proper installation of [Go](https://go.dev/doc/install) (1.24+) and
|
||||
You need a proper installation of [Go](https://go.dev/doc/install) (1.24+), and
|
||||
[NodeJS](https://nodejs.org/en/download/) (20+) with NPM (6+). For example, on
|
||||
Debian:
|
||||
|
||||
```console
|
||||
# apt install golang nodejs npm protobuf-compiler
|
||||
# apt install golang nodejs npm
|
||||
# go version
|
||||
go version go1.24.1 linux/amd64
|
||||
# node --version
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
find . -print0 | xargs -0 touch -d @0
|
||||
|
||||
make all \
|
||||
PROTOC=${pkgs.protobuf}/bin/protoc \
|
||||
BUF=${pkgs.buf}/bin/buf \
|
||||
ASNS_URL=${asn2org}/asns.csv \
|
||||
SERVICES_URL=${ianaServiceNames}
|
||||
'';
|
||||
@@ -111,7 +111,6 @@
|
||||
nodejs
|
||||
pkgs.git
|
||||
pkgs.curl
|
||||
pkgs.protobuf
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
6
go.mod
6
go.mod
@@ -3,6 +3,7 @@ module akvorado
|
||||
go 1.24
|
||||
|
||||
require (
|
||||
github.com/ClickHouse/ch-go v0.66.1
|
||||
github.com/ClickHouse/clickhouse-go/v2 v2.37.2
|
||||
github.com/IBM/sarama v1.45.2
|
||||
github.com/alecthomas/chroma v0.10.0
|
||||
@@ -26,7 +27,6 @@ require (
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1
|
||||
github.com/hashicorp/go-version v1.7.0
|
||||
github.com/itchyny/gojq v0.12.17
|
||||
github.com/jhump/protoreflect v1.17.0
|
||||
github.com/kentik/patricia v1.2.1
|
||||
github.com/kylelemons/godebug v1.1.0
|
||||
github.com/mattn/go-isatty v0.0.20
|
||||
@@ -50,7 +50,6 @@ require (
|
||||
golang.org/x/oauth2 v0.30.0
|
||||
golang.org/x/sys v0.33.0
|
||||
golang.org/x/text v0.26.0
|
||||
golang.org/x/time v0.12.0
|
||||
google.golang.org/grpc v1.72.2
|
||||
google.golang.org/protobuf v1.36.6
|
||||
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
|
||||
@@ -66,7 +65,6 @@ require (
|
||||
github.com/AlekSi/gocov-xml v1.1.0 // indirect
|
||||
github.com/AlekSi/pointer v1.2.0 // indirect
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/ClickHouse/ch-go v0.66.1 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/axw/gocov v1.2.1 // indirect
|
||||
@@ -134,6 +132,7 @@ require (
|
||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||
github.com/jellydator/ttlcache/v2 v2.11.1 // indirect
|
||||
github.com/jessevdk/go-flags v1.5.0 // indirect
|
||||
github.com/jhump/protoreflect v1.17.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/josharian/native v1.1.0 // indirect
|
||||
@@ -199,6 +198,7 @@ require (
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/term v0.32.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
golang.org/x/tools v0.33.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
||||
@@ -1 +1 @@
|
||||
sha256-TeYE1s4Yw4Ag2IbmP/bNgzP+XoOiup+gXm25nNaeTAU=
|
||||
sha256-Ejw42fH6T+qZXeR5lJ9ThmzXTWnRg1fSnh70La8LmGw=
|
||||
|
||||
Reference in New Issue
Block a user