Repository navigation
Fix Windows 3.14 pyexpat/elementtree duplicate-symbol link failure - #339
Merged
Merged
Conversation
The earlier fix on this branch appended `#include "xcs.c"` to xmlparse.c whenever the dropped-in expat tarball shipped xcs.c, on the assumption that Python's build system only compiles xmlparse.c/xmlrole.c/xmltok.c. That assumption holds for the setup.py-era Linux/macOS builds and for Python 3.10-3.13's PCbuild/pyexpat.vcxproj, but not for 3.14.9: its PCbuild/pyexpat.vcxproj and _elementtree.vcxproj already list xcs.c as ClCompile entries. The relenv-added include then defined xcslen/xcscmp/ xcsncmp twice -- once in xcs.obj (CPython's build), once in xmlparse.obj (our include) -- and the Windows link failed with LNK2005/LNK1169 on _elementtree.pyd and pyexpat.pyd. Gate the include on PCbuild/pyexpat.vcxproj not already listing xcs.c. Pre-3.14 Windows and Linux/macOS behavior is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ee60b8c, landed in 0.22.28/0.22.29) appends#include \"xcs.c\"toModules/expat/xmlparse.cwhenever the dropped-in expat tarball ships xcs.c, on the assumption that Python's build system only compilesxmlparse.c/xmlrole.c/xmltok.c. That holds for setup.py-era Linux/macOS and for Python 3.10–3.13'sPCbuild/pyexpat.vcxproj, but not for 3.14.9: itsPCbuild/pyexpat.vcxprojand_elementtree.vcxprojalready listxcs.casClCompileentries.LNK2005/LNK1169on_elementtree.pydandpyexpat.pyd—xcslen/xcscmp/xcsncmpare defined twice (once inxcs.obj, once inxmlparse.obj).PCbuild/pyexpat.vcxprojnot already listingexpat\xcs.c. Pre-3.14 Windows and Linux/macOS behavior is unchanged.Observed in https://github.com/saltstack/relenv/actions/runs/39711252360 (
Python Windows (3.14, amd64)+Python Windows (3.14, x86)).Test plan
Python Windows (3.14, amd64)andPython Windows (3.14, x86)turn greenPython Windows (3.10–3.13, amd64/x86)stay green (regression check — these rely on the include)