Skip to content

WIP: Native Debian packaging#1424

Draft
ottok wants to merge 5 commits intopingcap:masterfrom
ottok:native-debian-packaging
Draft

WIP: Native Debian packaging#1424
ottok wants to merge 5 commits intopingcap:masterfrom
ottok:native-debian-packaging

Conversation

@ottok
Copy link

@ottok ottok commented Feb 27, 2026

This is a draft as the protobuffer version in Debian is old and I had to downgrade it with an extra commit (same as in Debian), which is not a suitable thing to merge upstream. We need to wait for protobuffer to update in Debian unstable before merging this. In the meanwhile you can use this branch for testing.


Add subdirectory debian/ with native Debian packaging. This can be built in a Debian (unstable) container using regular commands (e.g. dpkg-buildpackage).

See commits for details.

Closes: #1416

Build log for reference:

Running 'gbp buildpackage ' to create .deb packages from git repository
followed by './debian/rules clean' to ensure source directory is clean
gbp:info: Performing the build
dpkg-buildpackage: info: source package golang-github-pingcap-kvproto
dpkg-buildpackage: info: source version 7.6.0~alpha
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Otto Kekäläinen <otto@debian.org>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --builddirectory=debian/.build/upstream --buildsystem=golang
   dh_auto_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_autoreconf_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
 dpkg-source -b .
dpkg-source: info: using source format '3.0 (native)'
dpkg-source: info: building golang-github-pingcap-kvproto in golang-github-pingcap-kvproto_7.6.0~alpha.tar.xz
dpkg-source: info: building golang-github-pingcap-kvproto in golang-github-pingcap-kvproto_7.6.0~alpha.dsc
 debian/rules binary
dh binary --builddirectory=debian/.build/upstream --buildsystem=golang
   dh_update_autotools_config -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_autoreconf -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_auto_configure -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   debian/rules override_dh_auto_build
make[1]: Entering directory '/debcraft/source'
# The grpc-gateway definitions have been removed from the proto files
# to fix the build with grpc-gateway v2.
# Remove the stale generated gateway file.
rm -f pkg/configpb/configpb.pb.gw.go
# Regenerate the main pb.go file from the patched proto file.
# The paths=source_relative option with protoc is tricky. We generate
# the file in a temporary location and move it.
# Remove rust-specific lines that break gogo
sed -i '/rustproto/d' proto/configpb.proto
# But we still need to generate rustproto itself, because other protos may depend on it.
# Use a temp dir and move to avoid creating nested directories on re-runs.
mkdir -p debian/.build/proto-gen
protoc -I. -Iinclude --gogo_out=paths=source_relative,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:debian/.build/proto-gen include/rustproto.proto
rm -f pkg/rustproto/rustproto.pb.go
mkdir -p pkg/rustproto
mv debian/.build/proto-gen/include/rustproto.pb.go pkg/rustproto/
mkdir -p debian/.build/proto-gen
protoc -I. -Iinclude --gogo_out=plugins=grpc,paths=source_relative:debian/.build/proto-gen proto/configpb.proto
mkdir -p pkg/configpb
mv debian/.build/proto-gen/proto/configpb.pb.go pkg/configpb/
dh_auto_build
	cd debian/.build/upstream && go install -trimpath -v -p 4 github.com/pingcap/kvproto/pkg/autoid github.com/pingcap/kvproto/pkg/brpb github.com/pingcap/kvproto/pkg/cdcpb github.com/pingcap/kvproto/pkg/configpb github.com/pingcap/kvproto/pkg/coprocessor github.com/pingcap/kvproto/pkg/deadlock github.com/pingcap/kvproto/pkg/debugpb github.com/pingcap/kvproto/pkg/diagnosticspb github.com/pingcap/kvproto/pkg/disaggregated github.com/pingcap/kvproto/pkg/disk_usage github.com/pingcap/kvproto/pkg/encryptionpb github.com/pingcap/kvproto/pkg/enginepb github.com/pingcap/kvproto/pkg/eraftpb github.com/pingcap/kvproto/pkg/errorpb github.com/pingcap/kvproto/pkg/gcpb github.com/pingcap/kvproto/pkg/import_kvpb github.com/pingcap/kvproto/pkg/import_sstpb github.com/pingcap/kvproto/pkg/keyspacepb github.com/pingcap/kvproto/pkg/kvrpcpb github.com/pingcap/kvproto/pkg/logbackuppb github.com/pingcap/kvproto/pkg/meta_storagepb github.com/pingcap/kvproto/pkg/metapb github.com/pingcap/kvproto/pkg/mpp github.com/pingcap/kvproto/pkg/pdpb github.com/pingcap/kvproto/pkg/raft_cmdpb github.com/pingcap/kvproto/pkg/raft_serverpb github.com/pingcap/kvproto/pkg/recoverdatapb github.com/pingcap/kvproto/pkg/replication_modepb github.com/pingcap/kvproto/pkg/resource_manager github.com/pingcap/kvproto/pkg/resource_usage_agent github.com/pingcap/kvproto/pkg/routerpb github.com/pingcap/kvproto/pkg/schedulingpb github.com/pingcap/kvproto/pkg/sharedbytes github.com/pingcap/kvproto/pkg/tikvpb github.com/pingcap/kvproto/pkg/tracepb github.com/pingcap/kvproto/pkg/tsopb
internal/byteorder
internal/goarch
internal/unsafeheader
internal/coverage/rtcov
internal/cpu
internal/abi
internal/godebugs
internal/goexperiment
internal/goos
internal/profilerecord
internal/runtime/atomic
internal/runtime/syscall/linux
internal/bytealg
internal/chacha8rand
math/bits
internal/runtime/exithook
internal/strconv
internal/runtime/gc
internal/runtime/sys
internal/asan
internal/msan
internal/runtime/math
internal/runtime/gc/scan
internal/runtime/pprof/label
internal/stringslite
internal/race
internal/trace/tracev2
internal/runtime/maps
sync/atomic
internal/synctest
cmp
internal/runtime/cgroup
math
internal/sync
unicode/utf8
unicode
encoding
unicode/utf16
log/internal
google.golang.org/protobuf/internal/flags
google.golang.org/protobuf/internal/set
internal/nettrace
container/list
runtime
crypto/internal/fips140/alias
crypto/internal/fips140deps/byteorder
crypto/internal/fips140deps/cpu
crypto/internal/constanttime
crypto/internal/boring/sig
crypto/internal/fips140/subtle
vendor/golang.org/x/crypto/cryptobyte/asn1
vendor/golang.org/x/crypto/internal/alias
crypto/subtle
google.golang.org/grpc/serviceconfig
github.com/pingcap/kvproto/pkg/sharedbytes
iter
weak
sync
internal/reflectlite
maps
slices
errors
sort
internal/bisect
internal/testlog
internal/oserror
strconv
syscall
internal/godebug
reflect
io
path
bytes
strings
encoding/base64
bufio
hash
hash/crc32
hash/fnv
time
internal/syscall/unix
internal/syscall/execenv
google.golang.org/protobuf/internal/pragma
html
regexp/syntax
unique
net/netip
regexp
context
internal/fmtsort
io/fs
internal/poll
encoding/binary
internal/filepathlite
embed
vendor/golang.org/x/net/dns/dnsmessage
google.golang.org/protobuf/internal/editiondefaults
internal/singleflight
os
fmt
io/ioutil
google.golang.org/protobuf/internal/detrand
path/filepath
crypto
crypto/internal/fips140deps/godebug
crypto/internal/impl
crypto/internal/fips140deps/time
crypto/internal/fips140
crypto/internal/entropy/v1.0.0
runtime/cgo
crypto/internal/fips140/sha256
crypto/internal/fips140/sha3
crypto/internal/fips140/sha512
encoding/json
log
compress/flate
google.golang.org/protobuf/internal/errors
google.golang.org/protobuf/encoding/protowire
go/token
google.golang.org/protobuf/reflect/protoreflect
compress/gzip
google.golang.org/protobuf/internal/version
golang.org/x/net/internal/timeseries
net/url
text/template/parse
google.golang.org/protobuf/internal/encoding/messageset
github.com/gogo/protobuf/proto
google.golang.org/protobuf/internal/strs
google.golang.org/protobuf/internal/encoding/text
google.golang.org/protobuf/internal/genid
google.golang.org/protobuf/internal/order
google.golang.org/protobuf/reflect/protoregistry
google.golang.org/protobuf/runtime/protoiface
google.golang.org/protobuf/internal/descfmt
google.golang.org/protobuf/internal/descopts
google.golang.org/protobuf/proto
google.golang.org/protobuf/internal/encoding/defval
google.golang.org/protobuf/internal/protolazy
text/template
google.golang.org/protobuf/encoding/prototext
google.golang.org/protobuf/internal/filedesc
html/template
google.golang.org/protobuf/internal/encoding/tag
google.golang.org/protobuf/internal/impl
crypto/internal/fips140/hmac
crypto/internal/fips140/check
github.com/gogo/protobuf/protoc-gen-gogo/descriptor
net
crypto/internal/fips140/aes
crypto/internal/sysrand
crypto/internal/fips140/drbg
crypto/internal/fips140/aes/gcm
crypto/fips140
crypto/internal/fips140only
crypto/cipher
crypto/internal/boring
github.com/gogo/protobuf/gogoproto
math/rand/v2
math/rand
crypto/internal/randutil
crypto/internal/rand
crypto/aes
crypto/des
math/big
crypto/internal/fips140/nistec/fiat
crypto/rand
crypto/internal/fips140/nistec
crypto/internal/fips140/edwards25519/field
crypto/internal/boring/bbig
crypto/internal/fips140/bigmod
crypto/internal/fips140cache
crypto/sha3
crypto/sha512
crypto/internal/fips140hash
internal/saferio
crypto/internal/fips140/edwards25519
encoding/asn1
google.golang.org/protobuf/internal/filetype
crypto/internal/fips140/ed25519
google.golang.org/protobuf/runtime/protoimpl
crypto/ed25519
vendor/golang.org/x/crypto/cryptobyte
google.golang.org/protobuf/types/descriptorpb
crypto/internal/fips140/hkdf
crypto/internal/fips140/ecdh
crypto/elliptic
crypto/internal/fips140/ecdsa
crypto/ecdh
crypto/hkdf
crypto/hmac
crypto/internal/fips140/mlkem
crypto/sha256
crypto/ecdsa
vendor/golang.org/x/crypto/chacha20
google.golang.org/protobuf/internal/editionssupport
google.golang.org/protobuf/types/gofeaturespb
vendor/golang.org/x/crypto/internal/poly1305
crypto/mlkem
vendor/golang.org/x/sys/cpu
crypto/internal/fips140/tls12
google.golang.org/protobuf/reflect/protodesc
crypto/internal/fips140/tls13
vendor/golang.org/x/crypto/chacha20poly1305
crypto/md5
crypto/rc4
crypto/internal/fips140/rsa
crypto/hpke
crypto/sha1
github.com/golang/protobuf/proto
crypto/rsa
crypto/tls/internal/fips140tls
crypto/dsa
encoding/hex
crypto/x509/pkix
encoding/pem
vendor/golang.org/x/text/transform
vendor/golang.org/x/text/unicode/bidi
crypto/x509
vendor/golang.org/x/text/unicode/norm
vendor/golang.org/x/text/secure/bidirule
net/textproto
vendor/golang.org/x/net/http2/hpack
mime
mime/quotedprintable
vendor/golang.org/x/net/idna
net/http/internal
net/http/internal/ascii
text/tabwriter
google.golang.org/grpc/backoff
mime/multipart
golang.org/x/sys/unix
crypto/tls
vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpproxy
google.golang.org/grpc/grpclog/internal
google.golang.org/grpc/attributes
google.golang.org/grpc/grpclog
google.golang.org/grpc/internal/envconfig
google.golang.org/protobuf/internal/encoding/json
google.golang.org/grpc/connectivity
google.golang.org/grpc/internal/grpclog
google.golang.org/protobuf/protoadapt
google.golang.org/protobuf/encoding/protojson
google.golang.org/grpc/internal/backoff
google.golang.org/protobuf/types/known/durationpb
github.com/golang/protobuf/ptypes/duration
google.golang.org/protobuf/types/known/timestamppb
google.golang.org/grpc/internal/pretty
github.com/golang/protobuf/ptypes/timestamp
google.golang.org/protobuf/types/known/anypb
google.golang.org/grpc/binarylog/grpc_binarylog_v1
google.golang.org/genproto/googleapis/rpc/status
google.golang.org/grpc/internal/buffer
google.golang.org/grpc/internal/idle
google.golang.org/grpc/internal/grpcsync
golang.org/x/text/transform
google.golang.org/grpc/internal
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
google.golang.org/grpc/experimental/stats
google.golang.org/grpc/metadata
google.golang.org/grpc/codes
google.golang.org/grpc/internal/grpcutil
google.golang.org/grpc/mem
google.golang.org/grpc/internal/balancerload
google.golang.org/grpc/internal/status
google.golang.org/grpc/encoding
google.golang.org/grpc/status
google.golang.org/grpc/encoding/proto
google.golang.org/grpc/stats
google.golang.org/grpc/internal/binarylog
google.golang.org/grpc/internal/stats
golang.org/x/text/secure/bidirule
golang.org/x/net/http2/hpack
golang.org/x/net/idna
net/http/httptrace
google.golang.org/grpc/internal/credentials
net/http/internal/httpcommon
google.golang.org/grpc/internal/syscall
google.golang.org/grpc/credentials
google.golang.org/grpc/keepalive
google.golang.org/grpc/tap
net/http
google.golang.org/grpc/internal/resolver/dns/internal
github.com/pingcap/kvproto/pkg/encryptionpb
google.golang.org/grpc/internal/channelz
google.golang.org/grpc/resolver
google.golang.org/grpc/credentials/insecure
google.golang.org/grpc/internal/metadata
google.golang.org/grpc/internal/resolver/passthrough
google.golang.org/grpc/internal/transport/networktype
google.golang.org/grpc/channelz
google.golang.org/grpc/internal/resolver/unix
google.golang.org/grpc/balancer
golang.org/x/net/http/httpguts
google.golang.org/grpc/balancer/base
google.golang.org/grpc/balancer/pickfirst
google.golang.org/grpc/internal/serviceconfig
google.golang.org/grpc/balancer/roundrobin
google.golang.org/grpc/internal/balancer/gracefulswitch
google.golang.org/grpc/internal/resolver
google.golang.org/grpc/peer
google.golang.org/grpc/balancer/grpclb/state
github.com/pingcap/kvproto/pkg/metapb
github.com/pingcap/kvproto/pkg/eraftpb
google.golang.org/grpc/internal/resolver/dns
google.golang.org/grpc/resolver/dns
github.com/pingcap/kvproto/pkg/disk_usage
github.com/pingcap/kvproto/pkg/replication_modepb
github.com/pingcap/kvproto/pkg/errorpb
net/http/httputil
golang.org/x/net/trace
golang.org/x/net/http2
google.golang.org/grpc/internal/transport
google.golang.org/grpc
github.com/pingcap/kvproto/pkg/autoid
github.com/pingcap/kvproto/pkg/tracepb
github.com/pingcap/kvproto/pkg/deadlock
github.com/pingcap/kvproto/pkg/resource_manager
github.com/pingcap/kvproto/pkg/configpb
github.com/pingcap/kvproto/pkg/diagnosticspb
github.com/pingcap/kvproto/pkg/gcpb
github.com/pingcap/kvproto/pkg/logbackuppb
github.com/pingcap/kvproto/pkg/meta_storagepb
github.com/pingcap/kvproto/pkg/recoverdatapb
github.com/pingcap/kvproto/pkg/kvrpcpb
github.com/pingcap/kvproto/pkg/resource_usage_agent
github.com/pingcap/kvproto/pkg/coprocessor
github.com/pingcap/kvproto/pkg/raft_serverpb
github.com/pingcap/kvproto/pkg/brpb
github.com/pingcap/kvproto/pkg/mpp
github.com/pingcap/kvproto/pkg/disaggregated
github.com/pingcap/kvproto/pkg/debugpb
github.com/pingcap/kvproto/pkg/pdpb
github.com/pingcap/kvproto/pkg/tikvpb
github.com/pingcap/kvproto/pkg/import_sstpb
github.com/pingcap/kvproto/pkg/import_kvpb
github.com/pingcap/kvproto/pkg/raft_cmdpb
github.com/pingcap/kvproto/pkg/enginepb
github.com/pingcap/kvproto/pkg/cdcpb
github.com/pingcap/kvproto/pkg/routerpb
github.com/pingcap/kvproto/pkg/keyspacepb
github.com/pingcap/kvproto/pkg/schedulingpb
github.com/pingcap/kvproto/pkg/tsopb
make[1]: Leaving directory '/debcraft/source'
   dh_auto_test -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
	cd debian/.build/upstream && go test -vet=off -v -p 4 github.com/pingcap/kvproto/pkg/autoid github.com/pingcap/kvproto/pkg/brpb github.com/pingcap/kvproto/pkg/cdcpb github.com/pingcap/kvproto/pkg/configpb github.com/pingcap/kvproto/pkg/coprocessor github.com/pingcap/kvproto/pkg/deadlock github.com/pingcap/kvproto/pkg/debugpb github.com/pingcap/kvproto/pkg/diagnosticspb github.com/pingcap/kvproto/pkg/disaggregated github.com/pingcap/kvproto/pkg/disk_usage github.com/pingcap/kvproto/pkg/encryptionpb github.com/pingcap/kvproto/pkg/enginepb github.com/pingcap/kvproto/pkg/eraftpb github.com/pingcap/kvproto/pkg/errorpb github.com/pingcap/kvproto/pkg/gcpb github.com/pingcap/kvproto/pkg/import_kvpb github.com/pingcap/kvproto/pkg/import_sstpb github.com/pingcap/kvproto/pkg/keyspacepb github.com/pingcap/kvproto/pkg/kvrpcpb github.com/pingcap/kvproto/pkg/logbackuppb github.com/pingcap/kvproto/pkg/meta_storagepb github.com/pingcap/kvproto/pkg/metapb github.com/pingcap/kvproto/pkg/mpp github.com/pingcap/kvproto/pkg/pdpb github.com/pingcap/kvproto/pkg/raft_cmdpb github.com/pingcap/kvproto/pkg/raft_serverpb github.com/pingcap/kvproto/pkg/recoverdatapb github.com/pingcap/kvproto/pkg/replication_modepb github.com/pingcap/kvproto/pkg/resource_manager github.com/pingcap/kvproto/pkg/resource_usage_agent github.com/pingcap/kvproto/pkg/routerpb github.com/pingcap/kvproto/pkg/schedulingpb github.com/pingcap/kvproto/pkg/sharedbytes github.com/pingcap/kvproto/pkg/tikvpb github.com/pingcap/kvproto/pkg/tracepb github.com/pingcap/kvproto/pkg/tsopb
?   	github.com/pingcap/kvproto/pkg/autoid	[no test files]
?   	github.com/pingcap/kvproto/pkg/brpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/cdcpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/configpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/coprocessor	[no test files]
?   	github.com/pingcap/kvproto/pkg/deadlock	[no test files]
?   	github.com/pingcap/kvproto/pkg/debugpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/diagnosticspb	[no test files]
?   	github.com/pingcap/kvproto/pkg/disaggregated	[no test files]
?   	github.com/pingcap/kvproto/pkg/disk_usage	[no test files]
?   	github.com/pingcap/kvproto/pkg/encryptionpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/enginepb	[no test files]
?   	github.com/pingcap/kvproto/pkg/eraftpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/errorpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/gcpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/import_kvpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/import_sstpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/keyspacepb	[no test files]
?   	github.com/pingcap/kvproto/pkg/kvrpcpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/logbackuppb	[no test files]
?   	github.com/pingcap/kvproto/pkg/meta_storagepb	[no test files]
?   	github.com/pingcap/kvproto/pkg/metapb	[no test files]
?   	github.com/pingcap/kvproto/pkg/mpp	[no test files]
?   	github.com/pingcap/kvproto/pkg/pdpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/raft_cmdpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/raft_serverpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/recoverdatapb	[no test files]
?   	github.com/pingcap/kvproto/pkg/replication_modepb	[no test files]
?   	github.com/pingcap/kvproto/pkg/resource_manager	[no test files]
?   	github.com/pingcap/kvproto/pkg/resource_usage_agent	[no test files]
?   	github.com/pingcap/kvproto/pkg/routerpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/schedulingpb	[no test files]
=== RUN   TestShardBytes
--- PASS: TestShardBytes (0.00s)
PASS
ok  	github.com/pingcap/kvproto/pkg/sharedbytes	0.002s
?   	github.com/pingcap/kvproto/pkg/tikvpb	[no test files]
?   	github.com/pingcap/kvproto/pkg/tracepb	[no test files]
?   	github.com/pingcap/kvproto/pkg/tsopb	[no test files]
   create-stamp debian/debhelper-build-stamp
   dh_testroot -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_prep -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_auto_install --destdir=debian/golang-github-pingcap-kvproto-dev/ -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_installdocs -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_installchangelogs -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_installsystemduser -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_perl -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_link -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_strip_nondeterminism -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_compress -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_fixperms -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_missing -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_installdeb -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_golang -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_gencontrol -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_md5sums -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_builddeb -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
dpkg-deb: building package 'golang-github-pingcap-kvproto-dev' in '../golang-github-pingcap-kvproto-dev_7.6.0~alpha_all.deb'.
 dpkg-genbuildinfo -O../golang-github-pingcap-kvproto_7.6.0~alpha_amd64.buildinfo
 dpkg-genchanges -O../golang-github-pingcap-kvproto_7.6.0~alpha_amd64.changes
dpkg-genchanges: info: including full source code in upload
 debian/rules clean
dh clean --builddirectory=debian/.build/upstream --buildsystem=golang
   dh_auto_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_autoreconf_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
   dh_clean -O--builddirectory=debian/.build/upstream -O--buildsystem=golang
 dpkg-source --after-build .
dpkg-buildpackage: info: full upload; Debian-native package (full source is included)

Patch grpc-gateway dependency in Debian to fix build failure:

    # github.com/pingcap/kvproto/pkg/configpb
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:45:44: cannot use &protoReq (value of type *GetRequest) as "google.golang.org/protobuf/proto".Message value in argument to runtime.PopulateQueryParameters: *GetRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:58:44: cannot use &protoReq (value of type *GetRequest) as "google.golang.org/protobuf/proto".Message value in argument to runtime.PopulateQueryParameters: *GetRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:112:44: cannot use &protoReq (value of type *DeleteRequest) as "google.golang.org/protobuf/proto".Message value in argument to runtime.PopulateQueryParameters: *DeleteRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:125:44: cannot use &protoReq (value of type *DeleteRequest) as "google.golang.org/protobuf/proto".Message value in argument to runtime.PopulateQueryParameters: *DeleteRequest does not implement protoreflect.ProtoMessage (missing method ProtoReflect)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:304:107: too many arguments in call to runtime.NewPattern
           have (number, []int, []string, string, unknown type)
           want (int, []int, []string, string)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:304:115: undefined: runtime.AssumeColonVerbOpt
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:306:110: too many arguments in call to runtime.NewPattern
       have (number, []int, []string, string, unknown type)
           want (int, []int, []string, string)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:306:118: undefined: runtime.AssumeColonVerbOpt
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:308:110: too many arguments in call to runtime.NewPattern
           have (number, []int, []string, string, unknown type)
           want (int, []int, []string, string)
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:308:118: undefined: runtime.AssumeColonVerbOpt
    src/github.com/pingcap/kvproto/pkg/configpb/configpb.pb.gw.go:125:44: too m

This can be dropped once Debian has upgraded to newer protobuffer libraries.
@pingcap-cla-assistant
Copy link

pingcap-cla-assistant bot commented Feb 27, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ dveeden
❌ ottok
You have signed the CLA already but the status is still pending? Let us recheck it.

@ti-chi-bot ti-chi-bot bot requested review from shihongzhi and wddevries February 27, 2026 13:57
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign overvenus for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ottok
Copy link
Author

ottok commented Feb 27, 2026

FYI: @dveeden

@ottok ottok marked this pull request as draft February 27, 2026 14:15
@dveeden
Copy link

dveeden commented Feb 27, 2026

Should there be a GitHub action to do the package build?

@ottok
Copy link
Author

ottok commented Feb 27, 2026

Should there be a GitHub action to do the package build?

Yes, that is a good idea. Or are you asking if there is an existing GitHub action? I am sure there are many, this is such a common thing. I am aware of at least https://github.com/centic9/debian-packages/blob/main/.github/workflows/debian-package-debcraft.yml

Most GitHub Actions run in a Ubuntu container anyway, so they just need to install dependencies and run dpkg-buildpackage -b as the minimal thing. I can research this more later after I am done with a round of updates.

@dveeden
Copy link

dveeden commented Feb 27, 2026

@ottok ottok#1

@ottok ottok force-pushed the native-debian-packaging branch 6 times, most recently from fc27c4e to e50c38f Compare March 2, 2026 03:04
@ottok ottok force-pushed the native-debian-packaging branch from e9bd428 to 4b0463b Compare March 2, 2026 03:24
@ottok
Copy link
Author

ottok commented Mar 2, 2026

This has now a CI (exampe log) that uses the GitHub runner ubuntu-latest, which is Ubuntu 24.04 at the time of writing. This will detect if the build is completely broken, but it wont provide early detection about interactions with new versions of dependencies that might break things, so I also created an alternative CI in https://github.com/ottok/tikv-kvproto/commits/native-debian-packaging-container/ that runs the CI inside a Debian unstable container (example log).

I am not sure which one is better, so I will leave this here for a while and return later to decide how to finalize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does upstream want to have Debian packaging?

2 participants