Skip to content

Commit

Permalink
bingo: migrate to go tool
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed Feb 12, 2025
1 parent 4a1eb68 commit 84ef5d4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 43 deletions.
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LDFLAGS := $(shell ./tools/ldflags)
TAGS := $(TAGS)
SHELL := bash
BAZEL := $(shell ./tools/which_bazel)
BINGO := go tool github.com/btwiuse/bingo/cmd/bingo

default: help

Expand Down Expand Up @@ -152,10 +153,10 @@ bazel-build: ## Build binary for current platform using bazel
# $(BAZEL) build # //:k0s # //cmd/{hub,client,agent}

build: ## Build binary for current platform
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}"
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}"

dry: ## Build binary for every supported platform
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" -dry \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" -dry \
linux/{{mips{,64},ppc64}{,le},s390x} \
{linux,android}/{armv6,armv7,arm64,amd64,386} {darwin,windows}/{386,amd64} \
freebsd/{armv7,armv6} {freebsd,openbsd}/{386,amd64}
Expand All @@ -170,42 +171,42 @@ build-all: ## Build binary for every supported platform
@ make build-darwin

build-android: ## Build android binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
android/{armv6,armv7,arm64,amd64,386}

build-bsd-arm: ## Build bsd arm binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
{netbsd,openbsd,freebsd}/{armv6,armv7,arm64}

build-bsd: ## Build bsd binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
{netbsd,openbsd,freebsd}/{amd64,386}

build-linux: ## Build linux binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
linux/{amd64,386}

build-linux-arm: ## Build linux arm binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
linux/{armv6,armv7,arm64}

build-linux-others: ## Build linux binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
linux/{{mips{,64},ppc64}{,le},s390x,{riscv,loong}64}

build-windows: ## Build windows binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
windows/{386,amd64,armv7,arm64}

build-darwin: ## Build darwin binaries
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" \
darwin/{amd64,arm64}

scratch-build: ## Build without using existing build cache
@ go run ./cmd/bingo -d releases/latest -ldflags="${LDFLAGS}" -- -a
@ $(BINGO) -d releases/latest -ldflags="${LDFLAGS}" -- -a

scratch-build-all: ## Build binary for every supported platform ignoring build cache
@ go run ./cmd/bingo -tags "$(TAGS)" -ldflags="${LDFLAGS}" -- -a\
@ $(BINGO) -tags "$(TAGS)" -ldflags="${LDFLAGS}" -- -a\
{linux,android}/{armv6,armv7,arm64,amd64,386} {darwin,windows}/{386,amd64} \
linux/{{mips{,64},ppc64}{,le},s390x}

Expand Down Expand Up @@ -260,9 +261,9 @@ buildkite: ## Generate buildkite pipeline yml definition
cd .buildkite && ./gen | tee /dev/stderr > pipeline.yml

test-build: ## Check all build tags will compile
@ go run ./cmd/bingo -tags raw # test tag raw
@ go run ./cmd/bingo -tags nhooyr # test tag nhooyr
@ go run ./cmd/bingo -tags gorilla # test tag gorilla
@ $(BINGO) -tags raw # test tag raw
@ $(BINGO) -tags nhooyr # test tag nhooyr
@ $(BINGO) -tags gorilla # test tag gorilla

test: ## Run all tests
@go clean --testcache && go test ./...
Expand Down
15 changes: 0 additions & 15 deletions cmd/bingo/BUILD.bazel

This file was deleted.

11 changes: 0 additions & 11 deletions cmd/bingo/main.go

This file was deleted.

2 changes: 0 additions & 2 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module k0s.io/cmd
go 1.24

require (
github.com/btwiuse/bingo v0.0.3
k0s.io v0.1.18-alpha.8
k0s.io/pkg/cli v0.1.18-alpha.8
k0s.io/pkg/hub v0.1.18-alpha.8
Expand Down Expand Up @@ -78,7 +77,6 @@ require (
github.com/junegunn/go-shellwords v0.0.0-20240813092932-a62c48c52e97 // indirect
github.com/kataras/basicauth v0.0.3 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lukesampson/figlet v0.0.0-20190211215653-8a3ef4a6ac42 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
Expand Down
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
module k0s.io

go 1.24

tool github.com/btwiuse/bingo/cmd/bingo

require (
github.com/btwiuse/bingo v0.0.5 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/lukesampson/figlet v0.0.0-20190211215653-8a3ef4a6ac42 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
golang.org/x/sys v0.28.0 // indirect
)

0 comments on commit 84ef5d4

Please sign in to comment.