Closed hanna-kruppe closed 4 weeks ago
Tempfile is created using https://github.com/rust-lang/cc-rs/blob/main/src/tempfile.rs
We already make sure the directories are created before creating the file:
https://github.com/rust-lang/cc-rs/blob/3ba23569a623074748a3030f382afd22483555df/src/tool.rs#L119
I noticed that
Closing the file seems to fix it, good call. Flushing with File::sync_all
doesn't seem to make a difference. I created a patch at #1087.
With cc version 1.0.98, on a Windows machine with Visual Studio 2022, I get this warning whenever compiler family detection runs (due to my use of
flag_if_supported
, it seems):The full build script output with CC_ENABLE_DEBUG_OUTPUT=1 is:
Note that (re-)creating
detect_compiler_family.c
manually at that exact path and running the exact cl.exe command on it works just fine. So there must be something wrong with how the tempfile is created during build script execution.