Skip to content

Commit 3c8b37b

Browse files
committed
Makefile: set ADDITIONAL_DRIVERS=krunkit by default
For issue 4289 and issue 4290 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 7f46ac6 commit 3c8b37b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Makefile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,28 @@ bat = .bat
1818
exe = .exe
1919
endif
2020

21-
GO_BUILDTAGS ?=
2221
ifeq ($(GOOS),darwin)
2322
MACOS_SDK_VERSION = $(shell xcrun --show-sdk-version | cut -d . -f 1)
23+
# xcrun command seems to fail even when the SDK is available:
24+
# > xcrun: error: unable to lookup item 'SDKVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
25+
ifeq ($(MACOS_SDK_VERSION),)
26+
MACOS_SDK_VERSION = $(shell readlink /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk | sed -E -e "s/^MacOSX//" -e "s/\.[0-9]+\.sdk//")
27+
endif
28+
endif
29+
30+
DEFAULT_ADDITIONAL_DRIVERS :=
31+
ifeq ($(GOOS),darwin)
32+
ifeq ($(GOARCH),arm64)
33+
ifeq ($(shell test $(MACOS_SDK_VERSION) -ge 14; echo $$?),0)
34+
# krunkit needs macOS 14 or later: https://github.com/containers/libkrun/blob/main/README.md#macos-efi-variant
35+
DEFAULT_ADDITIONAL_DRIVERS += krunkit
36+
endif
37+
endif
38+
endif
39+
ADDITIONAL_DRIVERS ?= $(DEFAULT_ADDITIONAL_DRIVERS)
40+
41+
GO_BUILDTAGS ?=
42+
ifeq ($(GOOS),darwin)
2443
ifeq ($(shell test $(MACOS_SDK_VERSION) -lt 13; echo $$?),0)
2544
# The "vz" mode needs macOS 13 SDK or later
2645
GO_BUILDTAGS += no_vz

0 commit comments

Comments
 (0)