-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #110801 - WaffleLapkin:io-tests, r=jyn514
Fix `ui/io-checks/inaccessbile-temp-dir.rs` test Fixes #110794 r? `@jyn514`
- Loading branch information
Showing
6 changed files
with
37 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# only-linux | ||
|
||
include ../tools.mk | ||
|
||
# Issue #66530: We would ICE if someone compiled with `-o /dev/null`, | ||
# because we would try to generate auxiliary files in `/dev/` (which | ||
# at least the OS X file system rejects). | ||
# | ||
# An attempt to `-Ztemps-dir` into a directory we cannot write into should | ||
# indeed be an error; but not an ICE. | ||
# | ||
# However, some folks run tests as root, which can write `/dev/` and end | ||
# up clobbering `/dev/null`. Instead we'll use an inaccessible path, which | ||
# also used to ICE, but even root can't magically write there. | ||
# | ||
# Note that `-Ztemps-dir` uses `create_dir_all` so it is not sufficient to | ||
# use a directory with non-existing parent like `/does-not-exist/output`. | ||
|
||
all: | ||
# Create an inaccessible directory | ||
mkdir $(TMPDIR)/inaccessible | ||
chmod 000 $(TMPDIR)/inaccessible | ||
|
||
# Run rustc with `-Ztemps-dir` set to a directory | ||
# *inside* the inaccessible one, so that it can't create it | ||
$(RUSTC) program.rs -Ztemps-dir=$(TMPDIR)/inaccessible/tmp 2>&1 \ | ||
| $(CGREP) "failed to find or create the directory specified by `--temps-dir`" | ||
|
||
# Make the inaccessible directory accessible, | ||
# so that compiletest can delete the temp dir | ||
chmod +rw $(TMPDIR)/inaccessible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fn main() {} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
warning: ignoring --out-dir flag due to -o flag | ||
|
||
error: io error modifying /does-not-exist/ | ||
error: io error modifying ./does-not-exist/ | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|