Skip to content

Commit 1f3ba60

Browse files
Build: Enforce SWIFT_SDK_ID is set for unittest target
The default value for SWIFT_SDK_ID in the Makefile was causing confusion when developers ran `make unittest` without the env var set, leading to unexpected SDK usage.
1 parent d0e75f1 commit 1f3ba60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SWIFT_SDK_ID ?= wasm32-unknown-wasi
1+
SWIFT_SDK_ID ?=
22

33
.PHONY: bootstrap
44
bootstrap:
@@ -7,6 +7,10 @@ bootstrap:
77
.PHONY: unittest
88
unittest:
99
@echo Running unit tests
10+
@test -n "$(SWIFT_SDK_ID)" || { \
11+
echo "SWIFT_SDK_ID is not set. Run 'swift sdk list' and pass a matching SDK, e.g. 'make unittest SWIFT_SDK_ID=<id>'."; \
12+
exit 2; \
13+
}
1014
env JAVASCRIPTKIT_EXPERIMENTAL_BRIDGEJS=1 swift package --swift-sdk "$(SWIFT_SDK_ID)" \
1115
--disable-sandbox \
1216
js test --prelude ./Tests/prelude.mjs -Xnode --expose-gc

0 commit comments

Comments
 (0)