Skip to content

Commit 17b8d22

Browse files
authored
Merge pull request #3224 from crazy-max/tool-dir
tools: use new tool directive introduced in go 1.24
2 parents 6f0a8d0 + 8670079 commit 17b8d22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6608
-91
lines changed

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ RUN --mount=type=bind,target=.,rw \
4949
make bin/protoc-gen-gogoswarm && mv bin/protoc-gen-gogoswarm /usr/local/bin/
5050

5151
FROM gobase AS protobuild
52-
RUN --mount=type=bind,source=tools,target=. \
53-
--mount=target=/go/pkg/mod,type=cache \
52+
RUN --mount=type=bind,target=. \
5453
--mount=type=cache,target=/root/.cache \
55-
go install -mod=mod github.com/containerd/protobuild
54+
go install tool github.com/containerd/protobuild
5655

5756
FROM gobase AS generate-base
5857
ARG DEBIAN_FRONTEND
@@ -126,7 +125,7 @@ ENV GO111MODULE=on
126125
# install the dependencies from `make setup`
127126
# we only copy `direct.mk` to avoid busting the cache too easily
128127
COPY direct.mk .
129-
COPY tools ./tools
128+
COPY go.* .
130129
RUN make --file=direct.mk setup
131130
# now we can copy the rest
132131
COPY . .

direct.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ setup: ## install dependencies
4343
@echo "🐳 $@"
4444
# install golangci-lint to ./bin/golangci-lint
4545
@curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/v2.1.5/install.sh | sh -s v2.1.5
46-
@(cd ./tools ; GO111MODULE=on go install github.com/containerd/protobuild)
46+
@go install tool github.com/containerd/protobuild
4747

4848
.PHONY: generate
4949
generate: protos

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ require (
5353
require (
5454
github.com/beorn7/perks v1.0.1 // indirect
5555
github.com/cespare/xxhash/v2 v2.3.0 // indirect
56+
github.com/containerd/protobuild v0.3.0 // indirect
5657
github.com/coreos/go-semver v0.3.1 // indirect
5758
github.com/davecgh/go-spew v1.1.1 // indirect
5859
github.com/dustin/go-humanize v1.0.1 // indirect
@@ -68,6 +69,7 @@ require (
6869
github.com/klauspost/compress v1.17.9 // indirect
6970
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
7071
github.com/nxadm/tail v1.4.8 // indirect
72+
github.com/pelletier/go-toml v1.8.1 // indirect
7173
github.com/pmezard/go-difflib v1.0.0 // indirect
7274
github.com/prometheus/client_golang v1.20.5 // indirect
7375
github.com/prometheus/client_model v0.6.1 // indirect
@@ -91,3 +93,5 @@ require (
9193
gopkg.in/yaml.v3 v3.0.1 // indirect
9294
k8s.io/klog/v2 v2.90.1 // indirect
9395
)
96+
97+
tool github.com/containerd/protobuild

go.sum

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

tools/go.mod

Lines changed: 0 additions & 14 deletions
This file was deleted.

tools/go.sum

Lines changed: 0 additions & 65 deletions
This file was deleted.

tools/tools.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

vendor/github.com/containerd/protobuild/.gitignore

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)