Blame SOURCES/rust-pr71782-Use-a-non-existent-test-path.patch

a43525
From fbd3fbdb24563a9d8fd3651f6bdc90bbbbd81d3e Mon Sep 17 00:00:00 2001
a43525
From: Josh Stone <jistone@redhat.com>
a43525
Date: Fri, 1 May 2020 16:50:10 -0700
a43525
Subject: [PATCH] Use a non-existent test path instead of clobbering /dev/null
a43525
a43525
---
a43525
 src/test/ui/non-ice-error-on-worker-io-fail.rs     | 10 +++++++---
a43525
 src/test/ui/non-ice-error-on-worker-io-fail.stderr |  2 +-
a43525
 2 files changed, 8 insertions(+), 4 deletions(-)
a43525
a43525
diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs
a43525
index 8af17742850d..30779fc65c0f 100644
a43525
--- a/src/test/ui/non-ice-error-on-worker-io-fail.rs
a43525
+++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs
a43525
@@ -4,8 +4,12 @@
a43525
 //
a43525
 // An attempt to `-o` into a directory we cannot write into should indeed
a43525
 // be an error; but not an ICE.
a43525
+//
a43525
+// However, some folks run tests as root, which can write `/dev/` and end
a43525
+// up clobbering `/dev/null`. Instead we'll use a non-existent path, which
a43525
+// also used to ICE, but even root can't magically write there.
a43525
 
a43525
-// compile-flags: -o /dev/null
a43525
+// compile-flags: -o /does-not-exist/output
a43525
 
a43525
 // The error-pattern check occurs *before* normalization, and the error patterns
a43525
 // are wildly different between build environments. So this is a cop-out (and we
a43525
@@ -15,10 +19,10 @@
a43525
 // error-pattern: error
a43525
 
a43525
 // On Mac OS X, we get an error like the below
a43525
-// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/"
a43525
+// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/"
a43525
 
a43525
 // On Linux, we get an error like the below
a43525
-// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/"
a43525
+// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/"
a43525
 
a43525
 // ignore-tidy-linelength
a43525
 // ignore-windows - this is a unix-specific test
a43525
diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr
a43525
index f732abc52b71..edadecf273a7 100644
a43525
--- a/src/test/ui/non-ice-error-on-worker-io-fail.stderr
a43525
+++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr
a43525
@@ -1,6 +1,6 @@
a43525
 warning: ignoring --out-dir flag due to -o flag
a43525
 
a43525
-error: io error modifying /dev/
a43525
+error: io error modifying /does-not-exist/
a43525
 
a43525
 error: aborting due to previous error
a43525
 
a43525
-- 
a43525
2.26.2
a43525