Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run gofmt 1.19; Fix bundle-import.sh to generate correct output #1110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ For each release candidate and final release, perform the following steps:

### Update bundle to latest librdkafka

See instructions in [kafka/librdkafka/README.md](kafka/librdkafka/README.md).
See instructions in [kafka/librdkafka_vendor/README.md](kafka/librdkafka_vendor/README.md).


### Update librdkafka version requirement
Expand Down
2 changes: 1 addition & 1 deletion kafka/build_darwin_amd64.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !dynamic
// +build !dynamic


// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

package kafka
Expand Down
2 changes: 1 addition & 1 deletion kafka/build_darwin_arm64.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !dynamic
// +build !dynamic


// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

package kafka
Expand Down
4 changes: 2 additions & 2 deletions kafka/build_glibc_linux_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !dynamic
// +build !musl
//go:build !dynamic && !musl
// +build !dynamic,!musl

// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

Expand Down
4 changes: 2 additions & 2 deletions kafka/build_glibc_linux_arm64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !dynamic
// +build !musl
//go:build !dynamic && !musl
// +build !dynamic,!musl

// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

Expand Down
4 changes: 2 additions & 2 deletions kafka/build_musl_linux_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !dynamic
// +build musl
//go:build !dynamic && musl
// +build !dynamic,musl

// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

Expand Down
4 changes: 2 additions & 2 deletions kafka/build_musl_linux_arm64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !dynamic
// +build musl
//go:build !dynamic && musl
// +build !dynamic,musl

// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

Expand Down
4 changes: 2 additions & 2 deletions kafka/build_windows.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//go:build !dynamic
// +build !dynamic


// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

package kafka

// #cgo CFLAGS: -DUSE_VENDORED_LIBRDKAFKA -DLIBRDKAFKA_STATICLIB
// #cgo LDFLAGS: ${SRCDIR}/librdkafka_vendor/librdkafka_windows.a -lws2_32 -lsecur32 -lcrypt32
// #cgo LDFLAGS: ${SRCDIR}/librdkafka_vendor/librdkafka_windows.a -lws2_32 -lsecur32 -lcrypt32
import "C"

// LibrdkafkaLinkInfo explains how librdkafka was linked to the Go client
Expand Down
17 changes: 11 additions & 6 deletions kafka/librdkafka_vendor/bundle-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,31 @@ setup_build() {
local apath=$2
local pc=$3
local srcinfo=$4
local build_tag=
# Go 1.19 gofmt requires //go:build and +build tags on one line
# See: https://pkg.go.dev/cmd/go#hdr-Build_constraints
local build_constraints="!dynamic"
local build_tags="!dynamic"
local gpath="../build_${btype}.go"
local dpath="librdkafka_${btype}.a"

if [[ $btype =~ ^glibc_linux.*$ ]]; then
build_tag="// +build !musl"
build_tags+=",!musl"
build_constraints+=" && !musl"
elif [[ $btype =~ ^musl_linux.*$ ]]; then
build_tag="// +build musl"
build_tags+=",musl"
build_constraints+=" && musl"
fi

local dynlibs=$(parse_pc_dynlibs $pc)

echo "Copying $apath to $dpath"
cp "$apath" "$dpath"

echo "Generating $gpath (extra build tag: $build_tag)"
echo "Generating $gpath (build constraints: $build_constraints; build tags: $build_tags)"

cat >$gpath <<EOF
// +build !dynamic
$build_tag
//go:build $build_constraints
// +build $build_tags

// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.

Expand Down