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
Python does not support standalone MSVC v143 (VS 2022) Build Tools #89974
Comments
Python does not support building with Visual Studio 2022, which is the latest officially released stable version [1]. [1] https://devblogs.microsoft.com/visualstudio/visual-studio-2022-now-available/ |
Rephrasing: Python does not support building with standalone MSVC v143 Build Tools, which is the version of MS Build Tools under Visual Studio 2022 (version 17.0). Visual Studio 2022 is the latest stable release of Visual Studio [1]. [1] https://devblogs.microsoft.com/visualstudio/visual-studio-2022-now-available/ |
There are 5 link errors when building the PGO build. |
Could you post the errors? |
They are LNK1268 error: LINK : fatal error LNK1268: inconsistent option 'pdbthreads:5' specified with /USEPROFILE but not with /GENPROFILE [e:\dev\cpython\PCbuild\_queue.vcx LINK : fatal error LNK1268: inconsistent option 'pdbthreads:1' specified with /USEPROFILE but not with /GENPROFILE [e:\dev\cpython\PCbuild\_asyncio.v LINK : fatal error LNK1268: inconsistent option 'pdbthreads:5' specified with /USEPROFILE but not with /GENPROFILE [e:\dev\cpython\PCbuild\_elementtr LINK : fatal error LNK1268: inconsistent option 'cgthreads:8' specified with /USEPROFILE but not with /GENPROFILE [e:\dev\cpython\PCbuild\_hashlib.vc ... |
Looks like the fix for those errors is to specify the arguments to the linker in PCbuild/pyproject.props <AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF /CGTHREADS:1 /PDBTHREADS:1 %(AdditionalOptions)</AdditionalOptions> I don't particularly know what a good number of threads is for this. One seems safe, but maybe we can get faster builds with more? |
I have installed VS 2022 with v143 of MSVC. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.ta
rgets(436,5): error MSB8020: The build tools for Visual Studio 2019 (Platform Toolset = 'v142') cannot
be found. To build using the v142 build tools, please install Visual Studio 2019 build tools. Alternat
ively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click
the solution, and then selecting "Retarget solution". [D:\cpython\PCbuild\_freeze_module.vcxproj]
0 Warning(s)
1 Error(s) |
An easy workaround for people encountering this is to set the PlatformToolset environment variable to v143 before building: $env:PlatformToolset = "v143" (or in CMD: set PlatformToolset=v143) Alternatively, you should be able to install the v142 toolset through VS 2022. For now, it's still the official toolset, though we'll definitely move to v143 before 3.11. |
Thanks Steve, installing v142 is indeed my current workaround but would be On Tue, Nov 30, 2021, 21:09 Steve Dower <report@bugs.python.org> wrote:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: