Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Th buildrelease.bat from CPython 3.14.0 alpha 3 on Windows 11 failed with error MSB8020 #128797

Open
OlexYarm opened this issue Jan 13, 2025 · 7 comments
Labels
3.14 new features, bugs and security fixes build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error

Comments

@OlexYarm
Copy link

OlexYarm commented Jan 13, 2025

Bug report

Bug description:

I updated Windows and Visual Studio Community Edition 2022 to latest version and I tried to build CPython 3.14.0 alpha 3 on windows via command `Tools/msi/buildrelease.bat buildrelease.bat -o pyinstaller -x64 --skip-doc --skip-zip'.
It failed with the following error messages (error MSB8020).

Project "F:\GitHubPy\cpython\Tools\msi\launcher\launcher.wixproj" (1) is building "F:\GitHubPy\cpython\PCbuild\pyshellext.vcxproj" (4:2) on node 1 (Build target(s)).
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for v143 (Platform Toolset = 'v143') cannot be found. To build using the v143 build tools, please install v143 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [F:\GitHubPy\cpython\PCbuild\pyshellext.vcxproj]
Done Building Project "F:\GitHubPy\cpython\PCbuild\pyshellext.vcxproj" (Build target(s)) -- FAILED.
_CleanRecordFileWrites:
Creating directory "F:\GitHubPy\cpython\PCbuild\obj\314win32_Release\msi_launcher".
Done Building Project "F:\GitHubPy\cpython\Tools\msi\launcher\launcher.wixproj" (default targets) -- FAILED.

Build FAILED.

"F:\GitHubPy\cpython\Tools\msi\launcher\launcher.wixproj" (default target) (1) ->
"F:\GitHubPy\cpython\PCbuild\pyshellext.vcxproj" (Build target) (4:2) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(456,5): error MSB8020: The build tools for v143 (Platform Toolset = 'v143') cannot be found. To build using the v143 build tools, please install v143 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [F:\GitHubPy\cpython\PCbuild\pyshellext.vcxproj]

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:04.23

CPython versions tested on:
Main branch 3.14.0 alpha 3

Operating systems tested on:
Edition Windows 11 Pro
Version 24H2
OS build 26100.2605
Experience Windows Feature Experience Pack 1000.26100.36.0

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.12.3
VisualStudio.17.Release/17.12.3+35527.113
Microsoft .NET Framework
Version 4.8.09032

Visual C++ 2022 00476-80000-00000-AA052
Microsoft Visual C++ 2022

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

@OlexYarm OlexYarm added the type-bug An unexpected behavior, bug, or error label Jan 13, 2025
@ZeroIntensity ZeroIntensity added OS-windows build The build process and cross-build 3.14 new features, bugs and security fixes labels Jan 13, 2025
@ZeroIntensity
Copy link
Member

It looks like you need to install some sort of build tool for VS.

cc @zooba as the Windows guru.

@Wulian233
Copy link
Contributor

See also #106765

I remember that have to select arm64 for installation in VS
https://github.com/python/cpython/blob/main/Tools%2Fmsi%2FREADME.txt#L74-L75

@OlexYarm
Copy link
Author

It looks like you need to install some sort of build tool for VS.

cc @zooba as the Windows guru.

The MSBuild tool is part of Visual Studio. No needs for any additional tool. And it built other projects what buildrelease.bat calls, for example this:
Using "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe" (found in the environment)
Using "F:\GitHubPy\cpython\PCbuild\..\externals\pythonx86\tools\python.exe" (found in externals directory)

F:\GitHubPy\cpython\Tools\msi>"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\msbuild.exe" "F:\GitHubPy\cpython\PCbuild\pcbuild.proj" /t:Rebuild /m /nologo /v:m /clp:summary /p:Configuration=Debug /p:Platform=x64 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:DisableGil= /p:UseTestMarker= /p:GIT="C:\Git\cmd\git.exe" /p:UseJIT= /p:UseTIER2= /p:PyStats=

_freeze_module.c
config_minimal.c
...
blob.c
Creating library F:\GitHubPy\cpython\Tools\msi....\PCbuild\amd64_sqlite3_d.lib and object F:\GitHubPy\cpython\Tools\msi....\PCbuild\amd64_sqlite3_d.exp
_sqlite3.vcxproj -> F:\GitHubPy\cpython\PCbuild\amd64_sqlite3_d.pyd
python.c
python.vcxproj -> F:\GitHubPy\cpython\PCbuild\amd64\python_d.exe
C:\WINDOWS\SYSTEM32\ucrtbased.dll is version 10.0.26100.1742
Wrote F:\GitHubPy\cpython\Tools\msi....\PCbuild\amd64\LICENSE.txt
WinMain.c
pythonw.vcxproj -> F:\GitHubPy\cpython\PCbuild\amd64\pythonw_d.exe

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:52.94

@OlexYarm
Copy link
Author

See also #106765

I remember that have to select arm64 for installation in VS https://github.com/python/cpython/blob/main/Tools%2Fmsi%2FREADME.txt#L74-L75

I looked at Visual Studio installer and could not see any options to select "MSVC v14x - VS 20xx C++ ARM64/ARM64EC build tools" (please see screenshot in attachment). What am I missing?
VS -installer-MSBuild Tools-Desktop-development-with-C++2025-01-13_18-37-33

VS -installer-Desktop-development-with-C++_2025-01-13_18-28-49

@zooba
Copy link
Member

zooba commented Jan 14, 2025

You might have to go to the full component list and search for ARM64 to find it. I'm pretty sure it hasn't been put on the front page yet.

The installer needs the ARM64 compiler for one component of the py.exe launcher package, as that package has to install for any platform. It's not a critically important component, but people reported bugs when we didn't include it (it's basically there to handle drag-dropping lots of paths and/or Unicode paths onto a .py file in Explorer and having it launch correctly).

@OlexYarm
Copy link
Author

You might have to go to the full component list and search for ARM64 to find it. I'm pretty sure it hasn't been put on the front page yet.

The installer needs the ARM64 compiler for one component of the py.exe launcher package, as that package has to install for any platform. It's not a critically important component, but people reported bugs when we didn't include it (it's basically there to handle drag-dropping lots of paths and/or Unicode paths onto a .py file in Explorer and having it launch correctly).

Thanks a lot for the hint! I enabled all build components "arm64" and "arm64EC" (it was under VS installer tab "Individual components").
The is no more MSB8020 error while running "buildrelease.bat -o pyinstaller -x64 --skip-doc --skip-zip".
Unfortunately, both "buildrelease.bat -o pyinstaller -x64 --skip-doc --skip-zip" and "build.bat -x64" failed with another errors and some new warnings:

F:\GitHubPy\cpython\Tools\msi\doc\doc.wxs(12): error LGHT0094: Unresolved reference to symbol 'WixComponentGroup:doc_html' in section 'Product:'. [F:\GitHubPy\cpython\Tools\msi\doc\doc.wixproj]
F:\GitHubPy\cpython\Tools\msi\doc\doc.wxs(27): error LGHT0094: Unresolved reference to symbol 'WixComponentGroup:doc_html' in section 'Product:
'. [F:\GitHubPy\cpython\Tools\msi\doc\doc.wixproj]
F:\GitHubPy\cpython\Tools\msi\exe\exe.wixproj(37,9): error MSB3073: The command ""F:\GitHubPy\cpython\PCbuild\..\externals\pythonx86\tools\python.exe" -m blurb merge -f "F:\GitHubPy\cpython\Tools\msi....\PCbuild\amd64\NEWS.txt"" exited with code 1.

F:\GitHubPy\cpython\Tools\msi\tcltk\tcltk.wxs(47): warning LGHT1076: ICE69: Mismatched component reference. Entry 'IDLE' of the Shortcut table belongs to component 'idle_shortcut'. However, the formatted string in column 'Arguments' references file 'Lib_idlelib_idle.pyw' which belongs to component 'Lib_idlelib_idle.pyw'. Components are in the same feature. [F:\GitHubPy\cpython\Tools\msi\tcltk\tcltk.wixproj]
F:\GitHubPy\cpython\Tools\msi\tcltk\tcltk.wxs(32): warning LGHT1076: ICE69: Mismatched component reference. Entry 'reg77D28402A0186ED8B2B0155EF0F6CA8B' of the Registry table belongs to component 'idle_reg'. However, the formatted string in column 'Value' references file 'Lib_idlelib_idle.pyw' which belongs to component 'Lib_idlelib_idle.pyw'. Components are in the same feature. [F:\GitHubPy\cpython\Tools\msi\tcltk\tcltk.wixproj]

The error looks strange because I set flag to skip building documentation (--skip-doc) in call buildrelease.bat and do not set flag -doc in call build.bat.
Also, I switched to cpython version 3.12.8 and run "buildrelease.bat -o pyinstaller -x64 --skip-doc --skip-zip" and "build.bat -x64" - both failed with the same errors as version 3.14.0 alpha3.
What am I missing now?

CPython-3.14.0-alpha-cmd-buildrelease_2025-01-15-3.txt

CPython-3.14.0-alpha-cmd-build_2025-01-15-2.txt

@zooba
Copy link
Member

zooba commented Jan 17, 2025

I guess docs can't actually be excluded from the installer, which makes sense, that's not a configuration we'd ever release. Skipping the rebuild is just to save time, so you probably need to build once without --skip-doc and then you can use it once the docs exist.

The tcltk warnings are expected. It's probably fixable, but not a real issue, so just ignore them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes build The build process and cross-build OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants