Skip to content

Commit

Permalink
build: disable CGO for CRT release (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak authored Jul 15, 2024
1 parent d7d4fb3 commit a45fa59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## UNRELEASED

BUG FIXES:

* build: Removed CGO dependency accidentally introduced in 0.6.0

## 0.6.0 (July 12, 2024)

IMPROVEMENTS:
Expand Down
17 changes: 2 additions & 15 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ BIN := $(shell go env GOBIN)
ifndef BIN
BIN := $(GOPATH)/bin
endif

default: help

HELP_FORMAT=" \033[36m%-25s\033[0m %s\n"
Expand Down Expand Up @@ -54,26 +53,13 @@ clean: ## Cleanup previous build
@echo "==> Cleanup previous build"
rm -f ./build/nomad-driver-podman

pkg/%/nomad-driver-podman: GO_OUT ?= $@
pkg/%/nomad-driver-podman: ## Build the nomad-driver-podman plugin for GOOS_GOARCH, e.g. pkg/linux_amd64/nomad-driver-podman
@echo "==> Building $@ with tags $(GO_TAGS)..."
CGO_ENABLED=0 \
GOOS=$(firstword $(subst _, ,$*)) \
GOARCH=$(lastword $(subst _, ,$*)) \
go build -trimpath -o $(GO_OUT)

.PRECIOUS: pkg/%/nomad-driver-podman
pkg/%.zip: pkg/%/nomad-driver-podman ## Build and zip the nomad-driver-podman plugin for GOOS_GOARCH, e.g. pkg/linux_amd64.zip
@echo "==> Packaging for $@..."
@cp LICENSE $(dir $<)LICENSE.txt
zip -j $@ $(dir $<)*

.PHONY: dev
dev: clean build/nomad-driver-podman ## Build the nomad-driver-podman plugin

build/nomad-driver-podman:
@echo "==> Building driver plugin ..."
mkdir -p build
CGO_ENABLED=0 \
go build -o build/nomad-driver-podman .

.PHONY: test
Expand Down Expand Up @@ -102,6 +88,7 @@ endif
dist/%/nomad-driver-podman: GO_OUT ?= $@
dist/%/nomad-driver-podman:
@echo "==> RELEASE BUILD of $@ ..."
CGO_ENABLED=0 \
GOOS=linux GOARCH=$(lastword $(subst _, ,$*)) \
go build -trimpath -o $(GO_OUT)

Expand Down

0 comments on commit a45fa59

Please sign in to comment.