Skip to content
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

bzip2-sys build fails on Windows when its path contains non-latin characters #7

Open
alexbool opened this issue Oct 3, 2015 · 6 comments

Comments

@alexbool
Copy link

alexbool commented Oct 3, 2015

Using up-to-date master of bzip2-rs with i686 MSVC nightly Rust.
When bzip2-rs directory is in C:\Users\Александр\:

Александр@VAIO-FZ13 MINGW64 ~/bzip2-rs (master)
$ pwd
/c/Users/Александр/bzip2-rs

Александр@VAIO-FZ13 MINGW64 ~/bzip2-rs (master)
$ rustc -vV
rustc 1.5.0-nightly (168a23ebe 2015-10-01)
binary: rustc
commit-hash: 168a23ebe1729386138fa71643382fdd64fac205
commit-date: 2015-10-01
host: i686-pc-windows-msvc
release: 1.5.0-nightly

Александр@VAIO-FZ13 MINGW64 ~/bzip2-rs (master)
$ cargo build
   Compiling winapi v0.2.4
   Compiling libc v0.1.10
   Compiling winapi-build v0.1.1
   Compiling advapi32-sys v0.1.2
   Compiling gcc v0.3.17
   Compiling bzip2-sys v0.1.3 (file:///C:/Users/%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80/bzip2-rs)

build script output was not valid utf-8

When I place bzip2-rs in C:\, the build works.

@alexcrichton
Copy link
Collaborator

This is quite odd... The bug is probably with gcc-rs of some form rather than this crate itself, but regardless it shouldn't be happening! I haven't been able to reproduce locally yet, unfortunately, however. Do you know of a way I could do so?

@alexbool
Copy link
Author

alexbool commented Oct 4, 2015

Did I understand you right, you tried non-latin characters in path and it didn't reproduce?
Anyway, this is not that critical, because I know a workaround and have already applied it.
The most unpleasant thing is that I don't have an idea how to debug this sort of bugs. AFAIK cargo runs the executable compiled from build.rs with tons of environment variables, and I have to know them all to catch it.

@alexcrichton
Copy link
Collaborator

Hm yeah I'm not 100% sure if I did the right thing or not, but I ctrl-c + ctrl-v'd the directory name from above (Александр) into a terminal and then ran cargo build inside of that with a checkout of this repo.

Perhaps you could provide a program which when run exhibits this behavior? (e.g. programatically creates a directory with an offending character)

@alexbool
Copy link
Author

alexbool commented Oct 6, 2015

Seems you're doing right things.
I tried the following: I patched gcc-rs so it dumps everything from the build script into a file and reproduced the bug. Here is the result: https://www.dropbox.com/s/9y6rmt7mqj1sbtk/build.txt?dl=1

@alexcrichton
Copy link
Collaborator

Hm it looks like that file is valid UTF-8, so it may not be precisely what Cargo is choking on. Is there a script that I could run to reproduce this?

@alexbool
Copy link
Author

alexbool commented Oct 7, 2015

I'm working on it and I'll provide it as soon as it's ready and reproducing consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants