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

Build failure at gcc level: blocksort.c not found #30

Closed
ljedrz opened this issue Jul 6, 2018 · 6 comments
Closed

Build failure at gcc level: blocksort.c not found #30

ljedrz opened this issue Jul 6, 2018 · 6 comments

Comments

@ljedrz
Copy link

ljedrz commented Jul 6, 2018

bzip2-sys seems to refuse to build due to missing blocksort.c (it is indeed not present in the related build directory).

   Compiling bzip2-sys v0.1.6
error: failed to run custom build command for `bzip2-sys v0.1.6`
process didn't exit successfully: `c:\Local\poligon\extract_blobs\target\release\build\bzip2-sys-9937a6f77c12f052\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CC_x86_64-pc-windows-gnu = Some("C:\\Local\\poligon\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\bin\\gcc.exe")
TARGET = Some("x86_64-pc-windows-gnu")
HOST = Some("x86_64-pc-windows-gnu")
CFLAGS_x86_64-pc-windows-gnu = None
CFLAGS_x86_64_pc_windows_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "C:\\Local\\poligon\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\bin\\gcc.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "bzip2-1.0.6" "-D_WIN32" "-DBZ_EXPORT" "-DBZ_NO_STDIO" "-o" "c:\\Local\\poligon\\extract_blobs\\target\\release\\build\\bzip2-sys-f19fa19517d295e2\\out\\bzip2-1.0.6\\blocksort.o" "-c" "bzip2-1.0.6/blocksort.c"
cargo:warning=gcc.exe: error: CreateProcess: No such file or directory
exit code: 1

I'm using rustc 1.28.0-nightly-gnu-x64 with Win 7.

@alexcrichton
Copy link
Owner

Thanks for the report! It looks like gcc.exe doesn't exist though or maybe a dll is missing?

@ljedrz
Copy link
Author

ljedrz commented Jul 6, 2018

GCC is there, it's the one bundled with x86_64-pc-windows-gnu; how can I determine which dll can be missing?

@alexcrichton
Copy link
Owner

The gcc we ship that's bundled isn't able to compile C files, though, so you'll want to install a local gcc toolchain elsewehre

@ljedrz
Copy link
Author

ljedrz commented Jul 6, 2018

You're right - I once read somewhere (not an official source as far as I remember) that this GCC was supposed to work like the real deal, but I guess that person was wrong. I used the one from my cygwin installation and it worked flawlessly.

Thanks! Case closed

@ljedrz ljedrz closed this as completed Jul 6, 2018
@ljedrz
Copy link
Author

ljedrz commented Jul 6, 2018

I've tried to find that piece of information in order to comment on it, but instead I found lots of other cases where people were surprised that the bundled gcc can't be used for compilation. It might be a good idea to make this more visible, e.g. even by adding a blank file named WARNING - THIS GCC CANNOT BE USED FOR COMPILATION.txt to Windows installations under \rustlib\*\bin (as this location is probably usually found by manual browsing) or by renaming that gcc.exe to something different.

@alexcrichton
Copy link
Owner

Seems plausible to me!

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 10, 2018
…hton

Warn windows-gnu users that the bundled gcc can't compile

Add a `DO NOT USE THIS gcc.exe FOR COMPILATION.txt` file to `lib\rustlib\*-pc-windows-gnu\bin` folders in `windows-gnu` installations in order to warn against attempting to use the bundled `gcc.exe` as a C compiler. I'm pretty sure that location is usually found manually, so this should be easily noticeable.

This mistake has been made plenty of times and has lead to misunderstandings:
Rust: [Bundled gcc (windows x64) is unable to build any c file](rust-lang#24418)
gtk-rs:    [Compiling on windows](gtk-rs/gtk#625)
bzip2-rs: [Build failure at gcc level: blocksort.c not found](alexcrichton/bzip2-rs#30)

Alternatives: rename the bundled `gcc.exe` to e.g. `rustc-gcc.exe` or `gcc-linker.exe`. This might require a more comprehensive change or break crates already using it as a linker.

r? @alexcrichton
bors added a commit to rust-lang/rust that referenced this issue Jul 10, 2018
Warn windows-gnu users that the bundled gcc can't compile

Add a `DO NOT USE THIS gcc.exe FOR COMPILATION.txt` file to `lib\rustlib\*-pc-windows-gnu\bin` folders in `windows-gnu` installations in order to warn against attempting to use the bundled `gcc.exe` as a C compiler. I'm pretty sure that location is usually found manually, so this should be easily noticeable.

This mistake has been made plenty of times and has lead to misunderstandings:
Rust: [Bundled gcc (windows x64) is unable to build any c file](#24418)
gtk-rs:    [Compiling on windows](gtk-rs/gtk#625)
bzip2-rs: [Build failure at gcc level: blocksort.c not found](alexcrichton/bzip2-rs#30)

Alternatives: rename the bundled `gcc.exe` to e.g. `rustc-gcc.exe` or `gcc-linker.exe`. This might require a more comprehensive change or break crates already using it as a linker.

r? @alexcrichton
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