Closed Headline closed 4 years ago
here's a full build output from a clean python 3 installation
So I've been able to reproduce this recently and I don't think it's an AMBuild bug per se. Notice that it's dying when it calls doResource
which is where rc.exe
is being invoked. If you start the VS2015 x86 Native Tools Command Prompt and try to run rc
, you will probably find that it doesn't exist in the current path. This is the file which is not being found. This seems to be a problem when you have VS 2017 or 2019 installed along with the 2015 build tools.
Having searched the internet about rc.exe
being missing, I've found that it seems to be a fairly common problem with no satisfying solution. I've tried repairing my install as well as uninstalling and reinstalling to no avail.
The problem lies in the path to the Windows SDK. By default (on my Windows 10 machine), it assumes the SDK tools are in C:\Program Files (x86)\Windows Kits\10\bin\x86
which has no executable in it. The batch script that the VS2015 Command Prompt shortcut invokes is located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
. The first argument is the platform (x86 or x64). Then there's a second argument for the Windows SDK version. On my machine I have SDKs installed for 8.1 and other builds of 10 such as 10.0.17763.0. These SDK locations do have rc.exe
in them. The various builds of the 10 SDK can be seen in C:\Program Files (x86)\Windows Kits\10\bin
.
Possible solutions I've found so far:
1) If you specify 8.1 as the second argument to the batch script, then rc
can be run and AMBuild works nicely again. For some reason, using one of the 10.x.x versions does not.
2) Copy or make symbolic links for rc.exe
and rcdll.dll
from one of the SDK locations into C:\Program Files (x86)\Windows Kits\10\bin\x86
3) Add one of the other SDK version paths to your PATH environment variable. For example:
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86;%PATH%
Could you confirm that the above is true for you as well?
All that said, I think it would be good to have a clearer error message from AMBuild when something like this happens. An error could say that rc
couldn't be found. That's not immediately obvious from the error you get now unless you know what to look for.
While working on AMBuild's MSVC detection, I ran into this problem. Indeed the VS2015 build tools don't detect newer SDKs properly. The new detection logic will early abort if "rc.exe" is not found in path, so I think we can close this.
Since (1) MSVC 2015 is pretty old, and (2) it'll really only get used on our build machines, where we have to manually configure the environment anyway I didn't attempt to fix this further in our detection logic. But in theory we could, by enumerating the SDKs, and making sure one of them is in PATH.
I run into this a lot, but it seems only now it's interrupting my workflow. Tried a re-install of ambuild, and I'm on the latest version. Here's the stack trace I get from the console output when trying to build sourcemod on msvc 1900