-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
When building rust on windows for use in chromium, we get the following error:
error: linker `link.exe` not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
note: VS Code is a different product, and is not sufficient.
The machine in question does have a windows toolchain installed, including link.exe, but it's not in the "normal" place. Rather than installing the SDK on our bots, we bundle all the windows tools together in a separate package, but as far as I can tell there's no way to inform the compiler of this fact.
Doing a little digging myself, it seems like the error is emitted here and the linker lookup happens here, which calls out to the find_msvc_tools crate, which then does a search based on the registry. Since our package isn't included in the registry, it doesn't get found.
It seems like the solution would be to pass a flag pointing to the location of the windows tools, e.g. something like clang's -winsysroot flag. I don't know how to go about adding that, however.