about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2021-02-03 16:26:25 -0800
committerRich Kadel <richkadel@google.com>2021-02-11 11:40:29 -0800
commit01f5a2a81d02f42d4ea277772d0752e80f8d32d1 (patch)
tree14f776dd90ffe4fab6b8911f3d0aff13afaaef87
parent26e5bcd22025a0d949b76766af76e92ed4434199 (diff)
downloadrust-01f5a2a81d02f42d4ea277772d0752e80f8d32d1.tar.gz
rust-01f5a2a81d02f42d4ea277772d0752e80f8d32d1.zip
Ensures `make` tests run under /bin/dash, like CI, and fixes a Makefile
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`.
-rw-r--r--src/test/run-make-fulldeps/coverage-reports/Makefile3
-rw-r--r--src/test/run-make-fulldeps/coverage/coverage_tools.mk2
-rw-r--r--src/test/run-make-fulldeps/tools.mk6
3 files changed, 7 insertions, 4 deletions
diff --git a/src/test/run-make-fulldeps/coverage-reports/Makefile b/src/test/run-make-fulldeps/coverage-reports/Makefile
index a700cf68cd9..31583eaa8fe 100644
--- a/src/test/run-make-fulldeps/coverage-reports/Makefile
+++ b/src/test/run-make-fulldeps/coverage-reports/Makefile
@@ -1,4 +1,3 @@
-# ignore-test Broken; accidentally silently ignored on Linux CI; FIXME(#81688)
 # needs-profiler-support
 # ignore-windows-gnu
 # min-llvm-version: 11.0
@@ -128,7 +127,7 @@ endif
 			$$( \
 				for file in $(TMPDIR)/rustdoc-$@/*/rust_out; \
 				do \
-				[[ -x $$file ]] && printf "%s %s " -object $$file; \
+				[ -x "$$file" ] && printf "%s %s " -object $$file; \
 				done \
 			) \
 		2> "$(TMPDIR)"/show_coverage_stderr.$@.txt \
diff --git a/src/test/run-make-fulldeps/coverage/coverage_tools.mk b/src/test/run-make-fulldeps/coverage/coverage_tools.mk
index 11fd824e527..38643aaf902 100644
--- a/src/test/run-make-fulldeps/coverage/coverage_tools.mk
+++ b/src/test/run-make-fulldeps/coverage/coverage_tools.mk
@@ -12,5 +12,3 @@
 # Enabling `-C link-dead-code` is not necessary when compiling with `-Z instrument-coverage`,
 # due to improvements in the coverage map generation, to add unreachable functions known to Rust.
 # Therefore, `-C link-dead-code` is no longer automatically enabled.
-
-UNAME = $(shell uname)
diff --git a/src/test/run-make-fulldeps/tools.mk b/src/test/run-make-fulldeps/tools.mk
index 634c9ece3f5..29ca30a7cd8 100644
--- a/src/test/run-make-fulldeps/tools.mk
+++ b/src/test/run-make-fulldeps/tools.mk
@@ -21,6 +21,12 @@ 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`.
+SHELL := /bin/dash
+
 # This is the name of the binary we will generate and run; use this
 # e.g. for `$(CC) -o $(RUN_BINFILE)`.
 RUN_BINFILE = $(TMPDIR)/$(1)