-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile a file in a non-utf8 directory #15890
Comments
I was able to perform the commands above successfully with both fish and bash fish /tmp $ mkdir (echo 'foo\xff')
/tmp $ touch (echo 'foo\xff')/foo.rs
/tmp $ echo "fn main() {}" > (echo 'foo\xff')/foo.rs
/tmp $ rustc (echo 'foo\xff')/foo.rs bash /tmp $ mkdir $(echo 'foo\xff')
/tmp $ touch $(echo 'foo\xff')/foo.rs
/tmp $ echo "fn main() {}" > $(echo 'foo\xff')/foo.rs
/tmp $ rustc $(echo 'foo\xff')/foo.rs |
I am able to as well. Closing! Thanks for the triage. |
Hm I'm actually quite surprised that this works. What versions of the compilers were you using? For me it continues to not work:
|
|
Oh this may be a shell thing (I'm using zsh), when running
I think that the escape syntax for bash must be different. |
I just tried zsh and got your error:
|
Reproducable in bash (note the
|
It now fails saying, "called
Accepting |
Previously, any non-Unicode argument would panic rustc: ``` $ rustc $'foo\x80bar' error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` Now it gives a clean error: ``` $ rustc $'foo\x80bar' error: Argument 1 is not valid Unicode: "foo�bar" ``` Maybe fixes rust-lang#15890, although we still can't *compile* arbitrary file names.
Give a nicer error for non-Unicode arguments to rustc and rustdoc Previously, any non-Unicode argument would panic rustc: ``` $ rustc $'foo\x80bar' error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: "foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` Now it gives a clean error: ``` $ rustc $'foo\x80bar' error: Argument 1 is not valid Unicode: "foo�bar" ``` Maybe fixes rust-lang#15890, although we still can't *compile* arbitrary file names.
The text was updated successfully, but these errors were encountered: