Trying to install cargo-binstall using cargo on windows but have hit a snag, wondering if there is a simple workaround.
The windows environmental variable CC has the value:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe
Note the spaces between Program and Files and either side of Visual and they are the problem.
I get the following error from the statement
cargo install cargo-binstall
error occurred in cc-rs: failed to find tool "C:\Program":
The error is the value of the environmental variable is truncated.
If I surround the value of the environmental variable in quotes i get the following error
error occurred in cc-rs: command `""C:\Program" "Files\Microsoft" "Visual" "Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe""
It is now parsing on the spaces.
Far to much will be broken on the windows machine by changing the directory structure to delete the spaces. 100s of projects won't work and will need work and 100's of programs would need reinstalling.
Is there a workaround?
Found it need to set up a config.toml file with these contents:
[target.x86_64-pc-windows-msvc]
linker = "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe""""