Kubilay Kocak <koobs.free...@gmail.com> added the comment:

For FreeBSD Python language ports, the change doesn't have a big negative 
impact for the Python language/interpreter ports themselves

We have the following block in lang/python3? ports:

.if ${PORT_OPTIONS:MPYMALLOC}
ABIFLAGS:=      m${ABIFLAGS}
.endif

.if ${PORT_OPTIONS:MDEBUG}
ABIFLAGS:=      d${ABIFLAGS}
.endif


We then use the variable to substitute the correct suffix into the pkg-plist 
items:

.if !empty(ABIFLAGS)
PLIST_FILES+=   bin/python${PYTHON_VER}${ABIFLAGS} \
                bin/python${PYTHON_VER}${ABIFLAGS}-config \
                libdata/pkgconfig/python-${PYTHON_VER}${ABIFLAGS}.pc
<snip>
${INSTALL_DATA} ${WRKSRC}/Tools/gdb/libpython.py \
                
${STAGEDIR}${PREFIX}/lib/libpython${PYTHON_VER}${ABIFLAGS}.so.1.0-gdb.py

One question I have is, can/does SOABI flag removal affect any third party 
package/extension builds in any way, particularly affecting the names of files 
they produce?

We have a ton of python packages/extensions in the ports tree, so anything that 
affected their builds, particularly when it comes to setuptools --record output 
changes, would be a blocker for supporting 3.8

For example, we had to produce custom ports framework code to account for 
PEP488 [1] and PEP3147 [2] filename suffixes, for these filename differences, 
which was painful at the time:

# PEP 0488 (https://www.python.org/dev/peps/pep-0488/)
.if ${PYTHON_REL} < 3500
PYTHON_PYOEXTENSION=    pyo
.else
PYTHON_PYOEXTENSION=    opt-1.pyc
.endif


.if ${PYTHON_REL} >= 3200 && defined(_PYTHON_FEATURE_PY3KPLIST)
# When Python version is 3.2+ we rewrite all the filenames
# of TMPPLIST that end with .py[co], so that they conform
# to PEP 3147 (see https://www.python.org/dev/peps/pep-3147/)
PYMAGICTAG=             ${PYTHON_CMD} -c 'import sys; 
print(sys.implementation.cache_tag)'
_USES_stage+=   935:add-plist-python
add-plist-python:
        @${AWK} '\
                /\.py[co]$$/ && !($$0 ~ "/" pc "/") {id = match($$0, 
/\/[^\/]+\.py[co]$$/); if (id != 0) {d = substr($$0, 1, RSTART - 1); dirs[d] = 
1}; sub(/\.pyc$$/,  "." mt "&"); sub(/\.pyo$$/, "." mt "." pyo); 
sub(/[^\/]+\.py[co]$$/, pc "/&"); print; next} \
                /^@dirrm / {d = substr($$0, 8); if (d in dirs) {print $$0 "/" 
pc}; print $$0; next} \
                /^@dirrmtry / {d = substr($$0, 11); if (d in dirs) {print $$0 
"/" pc}; print $$0; next} \
                {print} \
                ' \
                pc="__pycache__" mt="$$(${PYMAGICTAG})" pyo="opt-1.pyc" \
                ${TMPPLIST} > ${TMPPLIST}.pyc_tmp
        @${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST}


[1] https://www.python.org/dev/peps/pep-0488/
[2] https://www.python.org/dev/peps/pep-3147/

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36707>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to