classification
Title: expat: Restore the use of pyexpatns.h to avoid link time conflicts vs other versions
Type: compile error Stage: commit review
Components: Build, Extension Modules Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: benjamin.peterson, gregory.p.smith, miss-islington, ned.deily
Priority: deferred blocker Keywords: patch

Created on 2018-10-18 00:26 by gregory.p.smith, last changed 2018-10-18 04:54 by benjamin.peterson. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9939 merged gregory.p.smith, 2018-10-18 00:42
PR 9940 merged miss-islington, 2018-10-18 01:11
PR 9941 merged miss-islington, 2018-10-18 01:11
Messages (7)
msg327919 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-10-18 00:26
These lines used to exist in Modules/expat/expat_external.h:

/* Namespace external symbols to allow multiple libexpat version to
   co-exist. */
#include "pyexpatns.h"

https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60#diff-3afaf7274c90ce1b7405f75ad825f545

removed them during an expat upgrade.

This causes link time conflicts when embedding Python using its own expat in an application that also uses libexpat from the C/C++ side on its own.
msg327920 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-10-18 00:28
Not a release blocker as most users probably do not run into this problem, but the pyexpatns.h mechanics should be restored.
msg327921 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-10-18 00:37
This appears to not have been shipped in a release yet.  It is new in 3.6.7.  cc'ing ned daily to see if he wants to include the fix (the PR is trivial, coming ASAP).

I don't have a good feel for how this impacts the real world or not.

We noticed because we embed CPython in larger applications that use a different copy of libexpat on their own.
msg327924 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-10-18 01:10
New changeset 9d4712bc8f26bf1d7e626b53ab092fe030bcd68d by Gregory P. Smith in branch 'master':
bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939)
https://github.com/python/cpython/commit/9d4712bc8f26bf1d7e626b53ab092fe030bcd68d
msg327927 - (view) Author: miss-islington (miss-islington) Date: 2018-10-18 02:05
New changeset 4bfecb9298d447d5599ea76f3f68f772c38b8fd0 by Miss Islington (bot) in branch '3.6':
[3.6] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9941)
https://github.com/python/cpython/commit/4bfecb9298d447d5599ea76f3f68f772c38b8fd0
msg327928 - (view) Author: miss-islington (miss-islington) Date: 2018-10-18 02:06
New changeset 35ae99d7b394af0ce01460f7bccd7449a82289ad by Miss Islington (bot) in branch '3.7':
[3.7] bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939) (GH-9940)
https://github.com/python/cpython/commit/35ae99d7b394af0ce01460f7bccd7449a82289ad
msg327934 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-10-18 04:54
Sorry for breaking that, and thanks for the fix!

I'm curious, though, why are you still using the embedded expat rather than linking everything against the same expat?
History
Date User Action Args
2018-10-18 04:54:49benjamin.petersonsetmessages: + msg327934
2018-10-18 02:07:24gregory.p.smithsetstatus: open -> closed
resolution: fixed
stage: patch review -> commit review
2018-10-18 02:06:34miss-islingtonsetmessages: + msg327928
2018-10-18 02:05:52miss-islingtonsetnosy: + miss-islington
messages: + msg327927
2018-10-18 01:11:11miss-islingtonsetpull_requests: + pull_request9292
2018-10-18 01:11:03miss-islingtonsetpull_requests: + pull_request9291
2018-10-18 01:10:51gregory.p.smithsetmessages: + msg327924
2018-10-18 00:42:05gregory.p.smithsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request9290
2018-10-18 00:37:53gregory.p.smithsetpriority: normal -> deferred blocker
nosy: + ned.deily
messages: + msg327921

2018-10-18 00:28:03gregory.p.smithsetassignee: gregory.p.smith
type: compile error
components: + Build, Extension Modules
title: Update to expat removed the pyexpatns.h, causing link time symbol conflicts vs other versions in an application -> expat: Restore the use of pyexpatns.h to avoid link time conflicts vs other versions
nosy: + benjamin.peterson

messages: + msg327920
stage: needs patch
2018-10-18 00:26:15gregory.p.smithcreate