Skip to content

Commit 6bdcfba

Browse files
committed
druntime integration tests: Fix musl detection with dash shell
As dash apparently doesn't understand the `&>` redirection, see ldc-developers/ldc#4970 (comment).
1 parent 3d3c547 commit 6bdcfba

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

druntime/test/exceptions/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
ifeq ($(OS),linux)
2-
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
3-
ifeq (1,$(shell which apk &>/dev/null && echo 1))
4-
IS_MUSL:=1
1+
ifndef IS_MUSL # LDC defines it externally
2+
ifeq ($(OS),linux)
3+
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
4+
ifeq (1,$(shell which apk >/dev/null 2>&1 && echo 1))
5+
IS_MUSL := 1
6+
endif
57
endif
68
endif
79

druntime/test/importc_compare/Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
TESTS := importc_compare
22

3+
ifndef IS_MUSL # LDC defines it externally
4+
ifeq ($(OS),linux)
5+
# FIXME: detect musl libc robustly; just checking Alpine Linux' apk tool for now
6+
ifeq (1,$(shell which apk >/dev/null 2>&1 && echo 1))
7+
IS_MUSL := 1
8+
endif
9+
endif
10+
endif
11+
312
# FIXME: fails on Alpine v3.21 with conflicting struct declarations in the C headers:
413
# /usr/include/asm-generic/fcntl.h(195): Error: struct `importc_includes.flock` conflicts with struct `importc_includes.flock` at /usr/include/fcntl.h(24)
5-
ifeq ($(OS),linux)
6-
ifeq (1,$(shell which apk &>/dev/null && echo 1))
7-
TESTS :=
8-
endif
14+
ifeq ($(IS_MUSL),1)
15+
TESTS :=
916
endif
1017

1118
include ../common.mak

0 commit comments

Comments
 (0)