Skip to content

Commit

Permalink
goreleaser: force adding -checklinkname=0 linter flag
Browse files Browse the repository at this point in the history
Restore elements of previous commit.
  • Loading branch information
mmatczuk committed Sep 9, 2024
1 parent d7f792a commit 2530955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ builds:
- main: ./cmd/forwarder
env:
- CGO_ENABLED=0
tags:
- dnshack
flags:
- -trimpath
ldflags:
- -checklinkname=0
- -extldflags '-static'
- -X 'github.com/saucelabs/forwarder/internal/version.Version={{ .Version }}'
- -X 'github.com/saucelabs/forwarder/internal/version.Time={{ .Date }}'
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ coverage:

export BUILDAH_FORMAT=docker

GOBUILD = go build -tags dnshack -ldflags "-checklinkname=0"

.PHONY: update-devel-image
update-devel-image: CONTAINER_RUNTIME ?= docker
update-devel-image: TAG=devel
update-devel-image: TMPDIR:=$(shell mktemp -d)
update-devel-image:
@ln Containerfile LICENSE LICENSE.3RD_PARTY $(TMPDIR)
ifeq ($(shell uname),Linux)
@CGO_ENABLED=1 GOOS=linux go build -race -o $(TMPDIR)/forwarder ./cmd/forwarder
@CGO_ENABLED=1 GOOS=linux $(GOBUILD) -race -o $(TMPDIR)/forwarder ./cmd/forwarder
@$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile --build-arg BASE_IMAGE=ubuntu:latest -t saucelabs/forwarder:$(TAG) $(TMPDIR)
else
@CGO_ENABLED=0 GOOS=linux go build -o $(TMPDIR)/forwarder ./cmd/forwarder
@CGO_ENABLED=0 GOOS=linux $(GOBUILD) -o $(TMPDIR)/forwarder ./cmd/forwarder
@$(CONTAINER_RUNTIME) buildx build --network host -f Containerfile -t saucelabs/forwarder:$(TAG) $(TMPDIR)
endif
@rm -rf $(TMPDIR)
Expand Down

0 comments on commit 2530955

Please sign in to comment.