Skip to content

Commit cb84f14

Browse files
committed
Use go run for msgp because it appears only once.
`go tool` is nice for managing versions in the tool.mod file, but there's no point when you have excatly one call to the tool.
1 parent d42cade commit cb84f14

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ fix: build
109109
modernize:
110110
GOTOOLCHAIN=auto go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -any=false -bloop=false -rangeint=false -fmtappendf=false -waitgroup=false -stringsbuilder=false -omitzero=false -fix ./...
111111

112-
lint: deps
113-
$(GOBIN)/golangci-lint run -c .golangci.yml
112+
lint:
113+
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.1 run -c .golangci.yml
114114

115115
expectlint:
116116
cd test/e2e-go/cli/goal/expect && python3 expect_linter.py *.exp
@@ -151,13 +151,13 @@ api:
151151
logic:
152152
make -C data/transactions/logic
153153

154-
155-
%/msgp_gen.go: deps ALWAYS
154+
MSGP := go run github.com/algorand/msgp@v1.1.61
155+
%/msgp_gen.go: ALWAYS
156156
@set +e; \
157-
printf "msgp: $(@D)..."; \
158-
$(GOBIN)/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand > ./$@.out 2>&1; \
157+
printf "$(MSGP) $(@D)..."; \
158+
$(MSGP) -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand > ./$@.out 2>&1; \
159159
if [ "$$?" != "0" ]; then \
160-
printf "failed:\n$(GOBIN)/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand\n"; \
160+
printf "failed:\n$(MSGP) -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand\n"; \
161161
cat ./$@.out; \
162162
rm ./$@.out; \
163163
exit 1; \

docs/messagepack.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ idea of the performance difference, [here are some benchmarks for Transactions](
3232

3333
## Code generation
3434

35-
Install `msgp` with [install_buildtools.sh](scripts/buildtools/install_buildtools.sh) and use it with `make msgp`.
35+
Run `make msgp`, which uses `go run` to invoke a specific version of
36+
`algorand/msgp` (usually the latest, be we hardcode the specific
37+
version).
3638

3739
The generated Marshal and Unmarshal utilities are located in `msgp_gen.go`
3840
files. Update `MSGP_GENERATE` in the Makefile to add another package.

scripts/buildtools/install_buildtools.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,4 @@ if [[ "${BUILDTOOLS_INSTALL}" != "ALL" ]]; then
8888
fi
8989

9090
install_go_module github.com/algorand/go-swagger github.com/algorand/go-swagger/cmd/swagger
91-
install_go_module github.com/algorand/msgp
9291
install_go_module gotest.tools/gotestsum
93-
install_go_module github.com/golangci/golangci-lint/v2/cmd/golangci-lint

scripts/buildtools/versions

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
golang.org/x/lint v0.0.0-20241112194109-818c5a804067
2-
golang.org/x/tools v0.27.0
3-
github.com/algorand/msgp v1.1.61
41
github.com/algorand/go-swagger v0.0.0-20251018003531-2ea7c750dcac
52
gotest.tools/gotestsum v1.13.0
6-
github.com/golangci/golangci-lint/v2/cmd/golangci-lint v2.6.0

scripts/check_deps.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ missing_dep() {
3535
}
3636

3737
GO_DEPS=(
38-
"msgp"
3938
"golangci-lint"
4039
"swagger"
4140
)

0 commit comments

Comments
 (0)