Visual Studio failing build

The first thing I did was pull with the GitHub client on Windows.

I’m having problem when building with VS2022. it looks like there is a some glitch where the path is wrong PCbuild\\..\externals. The problem is that there are two backslashes. I cannot find where they are both coming from after looking over the file regen.targets.

error MSB3073: The command ""C:\Users\brazg\Doc
uments\GitHub\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe" "C:\Users\brazg\Documents\GitHub\cpython\Tools\
build\generate_sbom.py"" exited with code 1. [C:\Users\brazg\Documents\GitHub\cpython\PCbuild\pythoncore.vcxproj]

There is then a second error:

"C:\Users\brazg\Documents\GitHub\cpython\PCbuild\pcbuild.sln" (default target) (1) ->
"C:\Users\brazg\Documents\GitHub\cpython\PCbuild\python.vcxproj.metaproj" (default target) (2) ->
"C:\Users\brazg\Documents\GitHub\cpython\PCbuild\xxlimited.vcxproj" (default target) (41) ->
(Link target) ->
  LINK : fatal error LNK1104: cannot open file 'python315.lib' [C:\Users\brazg\Documents\GitHub\cpython\PCbuild\xxlimit
ed.vcxproj]

This second error looks like its coming from the first error. the failure to link possibly coming from the malformed path. Cause python315.lib is built but is named python3.lib.

Windows 11 - 25H2 (OS Build 26200.7171

I have tried both in VS2022 and with the command: msbuild pcbuild.sln /t:build /p:Configuration=Release /p:Platform=x64

I also run .\get_externals.bat --no-tkinter

Lastly, there is no current Python installation on my system.

I know it’s inconvenient and requires more space. But is it possible to use VS2017 instead of 2022? Setup and building

VS2022 is fine, note that the devguide (as linked) says “VS 2017 or later”.

The doubled backslash is not an issue.

The best suggestion I have is to use the PCbuild\build.bat script rather than invoking msbuild directly. That script will download anything it needs (other than VS) to be able to build successfully. After a successful build.bat build you may have better luck with a direct invocation, but I would still recommend using the script.

1 Like