cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

Consider feature gating find-msvc-tools dependency

Open werdahias opened this issue 4 months ago • 2 comments

Unless I am mistaken, find-msvc-tools is only needed on Windows. It would be great if this could be feature gated so on unix-like systems this dependency is not being pulled in.

werdahias avatar Sep 15 '25 11:09 werdahias

Unfortunately it might break users cross compiling from unix to windows, as find-msvc-tools support using env var to find msvc env.

find-msvc-tools disable most of its windows-only code on unix, so compiling should be fast, if you've found it to not be the case, I'm happy to take corrections and discuss alternative solutions to this, like optimizing find-msvc-tools, or maybe remove that for unix, though that will create duplicate code so I don't like that option.

NobodyXu avatar Sep 15 '25 14:09 NobodyXu

You can try using --timings to see which crate has blocked compilation, splitting out find-msvc-tools from cc improves compilation time since it enables find-msvc-tools codegen to be done in parallel to cc compilation (find-msvc-tools rmeta generation is relatively quick)

NobodyXu avatar Sep 15 '25 14:09 NobodyXu