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

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