-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors #89383
Comments
I've started to notice that CPython's builds on Windows now simetimes fail with something like this: (both Azure and Github Actions are affected)
Links: |
It also fails on the 3.9 and 3.10 on the Windows jobs of GitHub Action. |
This is more likely to relate to bpo-45188, "De-couple the Windows builds from freezing modules.", for which the PR was merged yesterday: New changeset 09b4ad1 by Steve Dower in branch 'main': (#28322) |
Of course, it might also be unrelated. |
Let's split it into sub-parts:
RCxxxx errors are generated by the resource compiler
What is the code at line 253?
What is this error?
Is this a directory with a generated name, or is it an error code?
What is this error? -- Python contains the following .rc files: PC/pylauncher.rc None of these files include winnt.h. In fact, "winnt.h" cannot be found in any file of the Python source code. PC/python_nt.rc includes PC/python_ver_rc.h which contains 3 includes:
I'm not sure why modsupport.h is included. -- I found one page mentioning RC2188 *and* RC1116 error codes together: "RCxxxx errors are generated by the resource compiler. One of your .rc files includes directly or indirectly headers that RC can't understand so you'll have to check that and remove the #includes." |
Maybe the resource compiler needs a header file which is not generated yet, and so the build fails. In msg401948 logs, I don't see when header files are generated. This build step seems to be fully quiet. |
This issue is serious: it prevents to merge many pull requests, it blocks the Python development workflow. |
The build order change was not backported (and should not be), so it's unrelated to the failures on 3.9 and 3.10. More likely this is either a problematic compiler update, or some additional data leaking into the build information (e.g. I could see this happening if someone added a UTF-8 copyright symbol somewhere instead of an escaped version). |
This appears to be the Windows 11 preview SDK, so most likely it's a bug in that. We'll obviously need some logic to not automatically upgrade to this SDK on build. |
Steve, instead of manually defining RT_MANIFEST, try including "winresrc.h" in the resource definition files. This SDK header includes "winuser.rh" (note the ".rh" extension), which, among other things, includes the following RC_INVOKED definitions from "winuser.h": #ifdef RC_INVOKED
#define RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
#define ISOLATIONPOLICY_MANIFEST_RESOURCE_ID 4
#define ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID 5
#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID 1 /* inclusive */
#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID 16 /* inclusive */
|
Also, I suggest using CREATEPROCESS_MANIFEST_RESOURCE_ID (1) and ISOLATIONAWARE_MANIFEST_RESOURCE_ID (2) instead of hard-coded resource IDs. |
I just wish it were documented... we can keep it in mind if another one of these pops up. |
Compiling Python3.8.9 from source on Windows 10 with VS2019. Running PCBuild\build.bat, I'm getting the following issue: C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\winnt.h(253): error RC2188: C:\Python-3.8.9\PCbuild\obj\38amd64_Release\pythoncore\RCa09752(53) : fatal error RC1116: RC terminating after preprocessor errors [C:\Python-3.8.9\PCbuild\pythoncore.vcxproj] I noticed this issue is closed but it doesn't seem to be resolved. |
It was not backported to 3.8 because that's in security fix only mode. |
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: