Skip to content

Commit

Permalink
build: Add "" around $(TOOLS_BINDIR)
Browse files Browse the repository at this point in the history
This is required on Windows, otherwise github actions fail with various
isssues ("GOBIN must be an absolute path", "/usr/bin/bash:
D:acrccrctoolsbin/golangci-lint: No such file or directory", ...)
  • Loading branch information
cfergeau authored and praveenkumar committed Jul 26, 2022
1 parent 1b6bf22 commit 4ecb6cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ fmt:
# Run golangci-lint against code
.PHONY: lint cross-lint
lint: $(TOOLS_BINDIR)/golangci-lint
$(TOOLS_BINDIR)/golangci-lint run
"$(TOOLS_BINDIR)"/golangci-lint run

cross-lint: $(TOOLS_BINDIR)/golangci-lint
GOOS=darwin $(TOOLS_BINDIR)/golangci-lint run
GOOS=linux $(TOOLS_BINDIR)/golangci-lint run
GOARCH=amd64 GOOS=windows $(TOOLS_BINDIR)/golangci-lint run
GOOS=darwin "$(TOOLS_BINDIR)"/golangci-lint run
GOOS=linux "$(TOOLS_BINDIR)"/golangci-lint run
GOARCH=amd64 GOOS=windows "$(TOOLS_BINDIR)"/golangci-lint run

.PHONY: gen_release_info
gen_release_info:
Expand Down Expand Up @@ -308,7 +308,7 @@ packaging/vfkit.entitlements:

macos-universal-binary: macos-release-binary $(TOOLS_BINDIR)/makefat
mkdir -p out/macos-universal
cd $(BUILD_DIR) && $(TOOLS_BINDIR)/makefat macos-universal/crc macos-amd64/crc macos-arm64/crc
cd $(BUILD_DIR) && "$(TOOLS_BINDIR)"/makefat macos-universal/crc macos-amd64/crc macos-arm64/crc

packagedir: clean embed-download macos-universal-binary packaging/vfkit.entitlements
echo -n $(CRC_VERSION) > packaging/VERSION
Expand Down Expand Up @@ -339,7 +339,7 @@ $(BUILD_DIR)/macos-universal/crc-macos-installer.tar: packagedir
cd $(@D) && sha256sum $(@F)>$(@F).sha256sum

%.spec: %.spec.in $(TOOLS_BINDIR)/gomod2rpmdeps
@$(TOOLS_BINDIR)/gomod2rpmdeps | sed -e '/__BUNDLED_PROVIDES__/r /dev/stdin' \
@"$(TOOLS_BINDIR)"/gomod2rpmdeps | sed -e '/__BUNDLED_PROVIDES__/r /dev/stdin' \
-e '/__BUNDLED_PROVIDES__/d' \
-e 's/__VERSION__/'$(CRC_VERSION)'/g' \
-e 's/__OPENSHIFT_VERSION__/'$(OPENSHIFT_VERSION)'/g' \
Expand Down
6 changes: 3 additions & 3 deletions tools/tools.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
TOOLS_BINDIR = $(realpath $(TOOLS_DIR)/bin)

$(TOOLS_BINDIR)/makefat: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/randall77/makefat
cd $(TOOLS_DIR) && GOBIN="$(TOOLS_BINDIR)" go install github.com/randall77/makefat

$(TOOLS_BINDIR)/golangci-lint: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint
cd $(TOOLS_DIR) && GOBIN="$(TOOLS_BINDIR)" go install github.com/golangci/golangci-lint/cmd/golangci-lint

$(TOOLS_BINDIR)/gomod2rpmdeps: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/cfergeau/gomod2rpmdeps/cmd/gomod2rpmdeps
cd $(TOOLS_DIR) && GOBIN="$(TOOLS_BINDIR)" go install github.com/cfergeau/gomod2rpmdeps/cmd/gomod2rpmdeps

0 comments on commit 4ecb6cc

Please sign in to comment.