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

bug: Build::is_flag_supported /std:c++17 returns false on 1.2.1 ->1.2.5 transition (on x86_64-pc-windows-msvc) #1324

Closed
dj8yfo opened this issue Dec 19, 2024 · 4 comments · Fixed by #1336

Comments

@dj8yfo
Copy link

dj8yfo commented Dec 19, 2024

This is suppossedly a bug of https://docs.rs/cc/1.2.5/cc/struct.Build.html#method.is_flag_supported

on x86_64-pc-windows-msvc.

After applying diff near/cargo-near@4a4a772
, running build script in https://github.com/brson/wasm-opt-rs/blob/8854bd8a58d7393c7bacd950884aea521ce8e19f/components/wasm-opt-sys/build.rs#L365
fails https://github.com/near/cargo-near/actions/runs/12417889777/job/34669855813

Image
Image

Pinning cc to 1.2.1 in near/cargo-near#282 helps (build succeeds on the identical image)

@NobodyXu
Copy link
Collaborator

NobodyXu commented Dec 21, 2024

@dj8yfo I suspect it's because of f770d56

can you try forking cc and comment out that changes, and see if it fixes the problem for you please?

@BD103
Copy link

BD103 commented Dec 30, 2024

Hi! We've also managed to reproduce this when running the build script for wasm-opt-sys v0.166.0 in TheBevyFlock/bevy_cli#199. The exact error was caught by our CI in this run (Archived version).

I don't have a Windows computer anymore, so I can't reproduce this locally, but let me know if there's anything else I can do to help!

@CryZe
Copy link

CryZe commented Dec 30, 2024

This reproduces with cc 1.2.5, not with 1.2.4, which bisects the bug down to: #1322

@ChrisDenton
Copy link
Member

ChrisDenton commented Dec 30, 2024

I think this was caused by #1322 which removed the -c flag (i.e. don't invoke the linker). EDIT: ah ninja'd

It complains about msvcrt.lib not being found. Either we need to supply the lib path or else do something like:

cmd.args(["/link", "/entry:main"]);

To avoid depending on the C runtime libraries.

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

Successfully merging a pull request may close this issue.

5 participants