Skip to content

Commit

Permalink
Set SHELL = /bin/dash only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
richkadel committed Feb 6, 2021
1 parent 57ace0d commit ca3a714
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/test/run-make-fulldeps/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ CGREP := "$(S)/src/etc/cat-and-grep.sh"
# diff with common flags for multi-platform diffs against text output
DIFF := diff -u --strip-trailing-cr

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

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

0 comments on commit ca3a714

Please sign in to comment.