aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/cxx-big-literal.mk5
-rwxr-xr-xmk/debug-test.sh2
-rw-r--r--mk/lib.mk1
-rw-r--r--mk/libraries.mk2
-rw-r--r--mk/patterns.mk4
-rwxr-xr-xmk/run-test.sh17
6 files changed, 12 insertions, 19 deletions
diff --git a/mk/cxx-big-literal.mk b/mk/cxx-big-literal.mk
new file mode 100644
index 000000000..85365df8e
--- /dev/null
+++ b/mk/cxx-big-literal.mk
@@ -0,0 +1,5 @@
+%.gen.hh: %
+ @echo 'R"foo(' >> $@.tmp
+ $(trace-gen) cat $< >> $@.tmp
+ @echo ')foo"' >> $@.tmp
+ @mv $@.tmp $@
diff --git a/mk/debug-test.sh b/mk/debug-test.sh
index 6299e68a0..b5b628ecd 100755
--- a/mk/debug-test.sh
+++ b/mk/debug-test.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-set -eu
+set -eu -o pipefail
test=$1
diff --git a/mk/lib.mk b/mk/lib.mk
index 92f0983d5..34fa624d8 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -101,6 +101,7 @@ include mk/libraries.mk
include mk/programs.mk
include mk/patterns.mk
include mk/templates.mk
+include mk/cxx-big-literal.mk
include mk/tests.mk
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 02e4d47f9..1bc73d7f7 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -126,7 +126,7 @@ define build-library
$(1)_PATH := $$(_d)/$$($(1)_NAME).a
$$($(1)_PATH): $$($(1)_OBJS) | $$(_d)/
- +$$(trace-ld) $(LD) -Ur -o $$(_d)/$$($(1)_NAME).o $$^
+ $$(trace-ld) $(LD) $$(ifndef $(HOST_DARWIN),-U) -r -o $$(_d)/$$($(1)_NAME).o $$^
$$(trace-ar) $(AR) crs $$@ $$(_d)/$$($(1)_NAME).o
$(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
diff --git a/mk/patterns.mk b/mk/patterns.mk
index 86a724806..c81150260 100644
--- a/mk/patterns.mk
+++ b/mk/patterns.mk
@@ -1,10 +1,10 @@
$(buildprefix)%.o: %.cc
@mkdir -p "$(dir $@)"
- $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
+ $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) $(ERROR_SWITCH_ENUM) -MMD -MF $(call filename-to-dep, $@) -MP
$(buildprefix)%.o: %.cpp
@mkdir -p "$(dir $@)"
- $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) -MMD -MF $(call filename-to-dep, $@) -MP
+ $(trace-cxx) $(CXX) -o $@ -c $< $(CPPFLAGS) $(GLOBAL_CXXFLAGS_PCH) $(GLOBAL_CXXFLAGS) $(CXXFLAGS) $($@_CXXFLAGS) $(ERROR_SWITCH_ENUM) -MMD -MF $(call filename-to-dep, $@) -MP
$(buildprefix)%.o: %.c
@mkdir -p "$(dir $@)"
diff --git a/mk/run-test.sh b/mk/run-test.sh
index 219c8577f..1a1d65930 100755
--- a/mk/run-test.sh
+++ b/mk/run-test.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-set -u
+set -eu -o pipefail
red=""
green=""
@@ -22,24 +22,11 @@ fi
run_test () {
(init_test 2>/dev/null > /dev/null)
- log="$(run_test_proper 2>&1)"
- status=$?
+ log="$(run_test_proper 2>&1)" && status=0 || status=$?
}
run_test
-# Hack: Retry the test if it fails with “unexpected EOF reading a line” as these
-# appear randomly without anyone knowing why.
-# See https://github.com/NixOS/nix/issues/3605 for more info
-if [[ $status -ne 0 && $status -ne 99 && \
- "$(uname)" == "Darwin" && \
- "$log" =~ "unexpected EOF reading a line" \
-]]; then
- echo "$post_run_msg [${yellow}FAIL$normal] (possibly flaky, so will be retried)"
- echo "$log" | sed 's/^/ /'
- run_test
-fi
-
if [ $status -eq 0 ]; then
echo "$post_run_msg [${green}PASS$normal]"
elif [ $status -eq 99 ]; then