Skip to content

Commit 4ece99b

Browse files
authored
Rollup merge of rust-lang#81734 - richkadel:fixfordash, r=pnkfelix
Ensures `make` tests run under /bin/dash (if available), like CI, and fixes a Makefile Note: This cherrypicks rust-lang#81688 (`@pnkfelix)` Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI uses `dash` but other environments (including developer local machines) may default to `bash`. Replaces bash-specific shell command in one Makefile with a dash-compatible alternative, and re-enables the affected Makefile test. Removes apparently redundant definition of `UNAME`. Also see: [zulip discussion thread](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/how.20to.20run.2Fbless.20src.2Ftest.2Frun-make-fulldeps.2Fcoverage.20.3F) r? `@pnkfelix` FYI: `@wesleywiser` `@tmandry`
2 parents bf81b9a + ca3a714 commit 4ece99b

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/test/run-make-fulldeps/coverage-reports/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# ignore-test Broken; accidentally silently ignored on Linux CI; FIXME(#81688)
21
# needs-profiler-support
32
# ignore-windows-gnu
43
# min-llvm-version: 11.0
@@ -128,7 +127,7 @@ endif
128127
$$( \
129128
for file in $(TMPDIR)/rustdoc-$@/*/rust_out; \
130129
do \
131-
[[ -x $$file ]] && printf "%s %s " -object $$file; \
130+
[ -x "$$file" ] && printf "%s %s " -object $$file; \
132131
done \
133132
) \
134133
2> "$(TMPDIR)"/show_coverage_stderr.$@.txt \

src/test/run-make-fulldeps/coverage/coverage_tools.mk

-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@
1212
# Enabling `-C link-dead-code` is not necessary when compiling with `-Z instrument-coverage`,
1313
# due to improvements in the coverage map generation, to add unreachable functions known to Rust.
1414
# Therefore, `-C link-dead-code` is no longer automatically enabled.
15-
16-
UNAME = $(shell uname)

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

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ 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+
# 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))
34+
SHELL := /bin/dash
35+
endif
36+
2437
# This is the name of the binary we will generate and run; use this
2538
# e.g. for `$(CC) -o $(RUN_BINFILE)`.
2639
RUN_BINFILE = $(TMPDIR)/$(1)

0 commit comments

Comments
 (0)