Skip to content
Merged
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ errdoc:tools/bin/errdoc-gen
.PHONY: lint
lint:tools/bin/revive
@echo "linting"
@tools/bin/revive -formatter friendly -config tools/check/revive.toml $(FILES_TIDB_TESTS)
@tools/bin/revive -formatter friendly -config tools/check/revive.toml \
-exclude pkg/util/hack/... -exclude ./pkg/util/hack/... $(FILES_TIDB_TESTS)
@tools/bin/revive -formatter friendly -config tools/check/revive.toml ./lightning/...
go run tools/dashboard-linter/main.go pkg/metrics/grafana/overview.json
go run tools/dashboard-linter/main.go pkg/metrics/grafana/performance_overview.json
Expand Down
10 changes: 5 additions & 5 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ LINUX := "Linux"
MAC := "Darwin"

PACKAGE_LIST := go list ./...
PACKAGE_LIST_TIDB_TESTS := go list ./... | grep -vE "github.com\/pingcap\/tidb\/br|github.com\/pingcap\/tidb\/cmd|github.com\/pingcap\/tidb\/dumpling"
PACKAGE_LIST_TIDB_TESTS := go list ./... | grep -vE "github.com/pingcap/tidb/br|github.com/pingcap/tidb/cmd|github.com/pingcap/tidb/dumpling"
PACKAGES ?= $$($(PACKAGE_LIST))
PACKAGES_TIDB_TESTS ?= $$($(PACKAGE_LIST_TIDB_TESTS))
PACKAGE_DIRECTORIES := $(PACKAGE_LIST) | sed 's|github.com/pingcap/$(PROJECT)/||'
PACKAGE_DIRECTORIES_TIDB_TESTS := $(PACKAGE_LIST_TIDB_TESTS) | sed 's|github.com/pingcap/$(PROJECT)/||'
FILES := $$(find $$($(PACKAGE_DIRECTORIES)) -name "*.go")
FILES_TIDB_TESTS := $$(find $$($(PACKAGE_DIRECTORIES_TIDB_TESTS)) -name "*.go")
FILES_TIDB_TESTS := $$(find $$($(PACKAGE_DIRECTORIES_TIDB_TESTS)) -name "*.go" -not -path "pkg/util/hack/*")

UNCONVERT_PACKAGES_LIST := go list ./...| grep -vE "lightning\/checkpoints|lightning\/manual|lightning\/common|tidb-binlog\/proto\/go-binlog"
UNCONVERT_PACKAGES_LIST := go list ./...| grep -vE "lightning/checkpoints|lightning/manual|lightning/common|tidb-binlog/proto/go-binlog"
UNCONVERT_PACKAGES := $$($(UNCONVERT_PACKAGES_LIST))

FAILPOINT_ENABLE := find $$PWD/ -mindepth 1 -type d | grep -vE "(\.git|\.idea|tools)" | xargs tools/bin/failpoint-ctl enable
Expand Down Expand Up @@ -114,7 +114,7 @@ ifeq ("$(WITH_CHECK)", "1")
endif

BR_PKG := github.com/pingcap/tidb/br
BR_PACKAGES := go list ./...| grep "github.com\/pingcap\/tidb\/br"
BR_PACKAGES := go list ./...| grep "github.com/pingcap/tidb/br"
BR_PACKAGE_DIRECTORIES := $(BR_PACKAGES) | sed 's|github.com/pingcap/$(PROJECT)/||'
LIGHTNING_BIN := bin/tidb-lightning
LIGHTNING_CTL_BIN := bin/tidb-lightning-ctl
Expand All @@ -123,7 +123,7 @@ TEST_DIR := /tmp/backup_restore_test


DUMPLING_PKG := github.com/pingcap/tidb/dumpling
DUMPLING_PACKAGES := go list ./... | grep 'github.com\/pingcap\/tidb\/dumpling'
DUMPLING_PACKAGES := go list ./... | grep 'github.com/pingcap/tidb/dumpling'
DUMPLING_PACKAGE_DIRECTORIES := $(DUMPLING_PACKAGES) | sed 's|github.com/pingcap/$(PROJECT)/||'
DUMPLING_BIN := bin/dumpling
DUMPLING_CHECKER := awk '{ print } END { if (NR > 0) { exit 1 } }'
Expand Down
3 changes: 3 additions & 0 deletions pkg/util/hack/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go_library(
srcs = [
"hack.go",
"map_abi.go",
"map_abi_go126.go",
],
importpath = "github.com/pingcap/tidb/pkg/util/hack",
visibility = ["//visibility:public"],
Expand All @@ -17,6 +18,8 @@ go_test(
"hack_test.go",
"main_test.go",
"map_abi_test.go",
"map_abi_test_type_go125_test.go",
"map_abi_test_type_go126_test.go",
],
embed = [":hack"],
flaky = True,
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/hack/map_abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.25 && !go1.26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the build process add go1.25 tag? I didn't find the doc related to it 😂

And seems we only need one version tag?

//go:build go1.25
//go:build go1.26

should be enough

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini says it's called ReleaseTags, golang will assign all tags <= current version, so we should use

//go:build go1.25 && !go1.26

However I didn't find the official document for it. Do you have more authorized materials for this feature?


package hack

import (
Expand Down
Loading