Skip to content

Commit 625803d

Browse files
committed
Set SHELL = /bin/dash only if it exists
1 parent 01f5a2a commit 625803d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/run-make-fulldeps/tools.mk

+11-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@ CGREP := "$(S)/src/etc/cat-and-grep.sh"
2121
# diff with common flags for multi-platform diffs against text output
2222
DIFF := diff -u --strip-trailing-cr
2323

24-
# CI platforms use `/bin/dash`. When compiling in other environments, the
25-
# default may be different (for example, may default to `/bin/bash`), and syntax
26-
# and results could be different. Ensure Makefile `$(shell ...)` invocations
27-
# always run in `dash`.
24+
# Some of the Rust CI platforms use `/bin/dash` to run `shell` script in
25+
# Makefiles. Other platforms, including many developer platforms, default to
26+
# `/bin/bash`. (In many cases, `make` is actually using `/bin/sh`, but `sh`
27+
# is configured to execute one or the other shell binary). `dash` features
28+
# support only a small subset of `bash` features, so `dash` can be thought of as
29+
# the lowest common denominator, and tests should be validated against `dash`
30+
# whenever possible. Most developer platforms include `/bin/dash`, but to ensure
31+
# tests still work when `/bin/dash`, if not available, this `SHELL` override is
32+
# conditional:
33+
ifneq (,$(wildcard /bin/dash))
2834
SHELL := /bin/dash
35+
endif
2936

3037
# This is the name of the binary we will generate and run; use this
3138
# e.g. for `$(CC) -o $(RUN_BINFILE)`.

0 commit comments

Comments
 (0)