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 external tools directly #159

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

cipherboy
Copy link
Member

@cipherboy cipherboy commented Feb 27, 2024

Switch to running external tools directly

Rather than expecting them to be installed locally (via a previous
go get operation outside of the repo), use the go run ...@latest
pattern. This will download the package (the first time), but not
necessarily install it for the user on a $PATH-visible location.

This has the added side effect of ensuring everyone is on the same
version.


Also runs make fmt to fix a few blank lines.


In particular, on a fresh system with no dependencies, running make bootstrap fails for me with:

Installing/Updating golang.org/x/tools/cmd/goimports
go: modules disabled by GO111MODULE=off; see 'go help modules'
Installing/Updating github.com/golangci/revgrep/cmd/revgrep
go: modules disabled by GO111MODULE=off; see 'go help modules'
Installing/Updating mvdan.cc/gofumpt
go: modules disabled by GO111MODULE=off; see 'go help modules'
Installing/Updating honnef.co/go/tools/cmd/staticcheck
go: modules disabled by GO111MODULE=off; see 'go help modules'
make: *** [Makefile:168: .ci-bootstrap] Error 1

This is because this hack:

# bootstrap the build by downloading additional tools needed to build
ci-bootstrap: .ci-bootstrap
.ci-bootstrap:
    @for tool in  $(EXTERNAL_TOOLS_CI) ; do \
        echo "Installing/Updating $$tool" ; \
        GO111MODULE=off $(GO_CMD) get -u $$tool; \
    done
    @touch .ci-bootstrap

doesn't work on Go 1.22+ apparently: https://tip.golang.org/doc/go1.22#go-command

Rather than expecting them to be installed locally (via a previous
`go get` operation outside of the repo), use the `go run ...@latest`
pattern. This will download the package (the first time), but not
necessarily install it for the user on a $PATH-visible location.

This has the added side effect of ensuring everyone is on the same
version.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
@naphelps naphelps merged commit 7af4164 into openbao:main Feb 28, 2024
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants