Skip to content

Commit 6d3d85b

Browse files
committed
update how additional binaries are found on macOS
so far to force macadam to use its own "installed" gvproxy/vfkit/libkrun we forced podman to look at their paths by setting the variable config.additionalHelperBinariesDir. With our own findBinary implementation this is not needed anymore as we search directly the path /opt/macadam/bin as first option Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
1 parent 1d3ba22 commit 6d3d85b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
GIT_VERSION ?= $(shell git describe --always --dirty)
44
VERSION_LDFLAGS=-X github.com/crc-org/macadam/pkg/cmdline.gitVersion=$(GIT_VERSION)
5-
MACADAM_LDFLAGS = \
6-
$(VERSION_LDFLAGS) \
7-
-X github.com/containers/common/pkg/config.additionalHelperBinariesDir=$(HELPER_BINARIES_DIR)
85
# opengpg and btrfs support are used by github.com/containers/image and
96
# github.com/containers/storage when container images are fetched.
107
# These require external C libraries and their headers, it's simpler to disable
@@ -38,15 +35,13 @@ clean:
3835

3936
bin/macadam-darwin-amd64: GOOS=darwin
4037
bin/macadam-darwin-amd64: GOARCH=amd64
41-
bin/macadam-darwin-amd64: HELPER_BINARIES_DIR=/opt/macadam/bin
4238
bin/macadam-darwin-amd64: force-build
43-
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -tags "$(BUILDTAGS)" -ldflags "$(MACADAM_LDFLAGS)" -o bin/macadam-$(GOOS)-$(GOARCH) ./cmd/macadam
39+
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -tags "$(BUILDTAGS)" -ldflags "$(VERSION_LDFLAGS)" -o bin/macadam-$(GOOS)-$(GOARCH) ./cmd/macadam
4440

4541
bin/macadam-darwin-arm64: GOOS=darwin
4642
bin/macadam-darwin-arm64: GOARCH=arm64
47-
bin/macadam-darwin-arm64: HELPER_BINARIES_DIR=/opt/macadam/bin
4843
bin/macadam-darwin-arm64: force-build
49-
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -tags "$(BUILDTAGS)" -ldflags "$(MACADAM_LDFLAGS)" -o bin/macadam-$(GOOS)-$(GOARCH) ./cmd/macadam
44+
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -tags "$(BUILDTAGS)" -ldflags "$(VERSION_LDFLAGS)" -o bin/macadam-$(GOOS)-$(GOARCH) ./cmd/macadam
5045

5146
bin/macadam-linux-amd64: GOOS=linux
5247
bin/macadam-linux-amd64: GOARCH=amd64

pkg/preflights/preflights_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ func checkKrunKitAvailability(provider vmconfigs.VMProvider) error {
4444
func getBinariesDirs() []string {
4545
// On Mac, Podman helper binaries dirs can be found at
4646
// https://github.com/containers/common/blob/main/pkg/config/config_darwin.go#L15-L28
47-
// We use the same to detect the binaries
47+
// We use the same to detect the binaries and add /opt/macadam/bin to the list
4848
return []string{
49+
"/opt/macadam/bin",
4950
// Relative to the binary directory
5051
"$BINDIR/../libexec/podman",
5152
// Homebrew install paths

0 commit comments

Comments
 (0)