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

Work around rustc bug by ignoring debug = true in Cargo.toml on x86_64-pc-windows-msvc only #2087

Closed
briansmith opened this issue Oct 27, 2015 · 4 comments

Comments

@briansmith
Copy link

The rustc bug is rust-lang/rust#29413.

My plan is to write a patch for Cargo that will skip passing the -g flag on x86_64-pc-windows-msvc release mode builds only, even when debug = true is specified, until the rustc bug is fixed. This will allow people to use debug = true in release builds in their Cargo.toml and get the expected results, except on this one platform. Right now, we just can't use debug = true in such configurations.

Does this seem reasonable, @alexcrichton? If so, I'll write the patch.

@alexcrichton
Copy link
Member

It looks like disabling LTO also causes this to link correctly, so perhaps that could be the solution for now? LTO's already off by default thankfully at least!

@briansmith
Copy link
Author

Right, that's why it probably hasn't been reported until now. But, my libraries use LTO and I don't want to turn it off LTO all platforms just to work around this bug on x86_64-pc-windows-msvc. I'd rather turn off debugging instead. But, a workaround targetted specifically to x86_64-pc-windows-msvc still seems best to me.

@alexcrichton
Copy link
Member

Due to the fact that compiles "work by default" today I'm hesitant to bake this kind of logic into Cargo at least, it seems more appropriate in the compiler. I guess debuginfo could be disabled with LTO on 64-bit msvc, or stripped somehow?

@briansmith
Copy link
Author

at least, it seems more appropriate in the compiler.

OK, that sounds reasonable to me.

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