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

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

Merged
merged 2 commits into from
Jul 10, 2018

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Jul 9, 2018

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
gtk-rs: Compiling on windows
bzip2-rs: Build failure at gcc level: blocksort.c not found

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

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 9, 2018
@alexcrichton
Copy link
Member

Thanks! I wonder though if perhaps we could start out with a README.txt file or something like that? If that doesn't act as enough deterrent we can go I think with the "alarming filename"

@ljedrz
Copy link
Contributor Author

ljedrz commented Jul 9, 2018

I've thought about it, but it might not be visible enough - when someone finds gcc.exe they add that location to their PATH and later, when they receive a misleading error, they are not investigating GCC, but rather the affected library. The name could be a bit less aggressive and still arising suspicion, though - maybe GCC WARNING.txt?

@alexcrichton
Copy link
Member

Ok! Although perhaps a dash in the middle as I'm not sure I trust out shell scripts to handle spaces in filenames :(

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 9, 2018

📌 Commit 232e77e has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request 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
Copy link
Contributor

bors commented Jul 10, 2018

⌛ Testing commit 232e77e with merge 77117e3...

bors added a commit that referenced this pull request 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
@bors
Copy link
Contributor

bors commented Jul 10, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 77117e3 to master...

@bors bors merged commit 232e77e into rust-lang:master Jul 10, 2018
@ljedrz ljedrz deleted the bare_gcc_warning branch July 10, 2018 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants