Bug 259896 - lang/python39: build error on current, ModuleNotFoundError: No module named '_sysconfigdata__freebsd14_x86_64-unknown-freebsd14'
Summary: lang/python39: build error on current, ModuleNotFoundError: No module named '...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-python (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-11-17 11:37 UTC by Trond.Endrestol
Modified: 2021-11-26 18:54 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
lang/python3(6|7|8|9|10): work around unwanted multiarch detection again (4.75 KB, patch)
2021-11-17 20:06 UTC, Dimitry Andric
no flags Details | Diff
lang/python3(6|7|8|9|10|11): work around unwanted multiarch detection again (4.45 KB, patch)
2021-11-26 16:03 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond.Endrestol 2021-11-17 11:37:27 UTC
I think the issue in bug #258377 must be revisited.

On today's current, I get this error when building lang/python39:

LD_LIBRARY_PATH=/construction/xports/lang/python39/work/Python-3.9.8 CC='cc -pthread' LDSHARED='cc -pthread -shared  -L/usr/local/lib  -fstack-protector-strong   ' OPT='-DNDEBUG'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  build
Traceback (most recent call last):
  File "/construction/xports/lang/python39/work/Python-3.9.8/./setup.py", line 2507, in <module>
    class PyBuildInstallLib(install_lib):
  File "/construction/xports/lang/python39/work/Python-3.9.8/./setup.py", line 2514, in PyBuildInstallLib
    shlib_suffix = sysconfig.get_config_var("SHLIB_SUFFIX")
  File "/construction/xports/lang/python39/work/Python-3.9.8/Lib/sysconfig.py", line 615, in get_config_var
    return get_config_vars().get(name)
  File "/construction/xports/lang/python39/work/Python-3.9.8/Lib/sysconfig.py", line 564, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/construction/xports/lang/python39/work/Python-3.9.8/Lib/sysconfig.py", line 430, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata__freebsd14_x86_64-unknown-freebsd14'
*** [sharedmods] Error code 1

In ${WRKSRC}/build/lib.freebsd-14.0-CURRENT-amd64-3.9, I find the file
_sysconfigdata__freebsd14_x86_64-unknown-freebsd14.0.py, but not a file named
_sysconfigdata__freebsd14_x86_64-unknown-freebsd14.py.

lang/python38 nor lang/python310 exhibit this issue.
Comment 1 Charlie Li freebsd_committer 2021-11-17 13:03:40 UTC
Verified by pkg-fallout. Couldn't see anything obvious between the LLVM 13 import to now in base.
Comment 2 Dimitry Andric freebsd_committer 2021-11-17 14:33:34 UTC
See https://bugs.python.org/issue45405 and
https://github.com/python/cpython/commit/9c4766772cda67648184f8ddba546a5fc0167f91

They added a check for Darwin which defeats the regex. We need to adjust it.
Comment 3 Dimitry Andric freebsd_committer 2021-11-17 20:06:36 UTC
Created attachment 229557 [details]
lang/python3(6|7|8|9|10): work around unwanted multiarch detection again

Here's another patch, to make the workaround hopefully a bit more robust.
Comment 4 Trond.Endrestol 2021-11-18 07:53:45 UTC
I can confirm the patch works, although I only tried lang/python3{8,9,10}.
Comment 5 Trond.Endrestol 2021-11-26 13:37:30 UTC
(In reply to Trond.Endrestol from comment #4)
lang/python311 needs the same treatment on current as was done for lang/python310.
Comment 6 Dimitry Andric freebsd_committer 2021-11-26 16:03:34 UTC
Created attachment 229741 [details]
lang/python3(6|7|8|9|10|11): work around unwanted multiarch detection again

Unless there is any objection, I will commit this patch later today.
Comment 7 commit-hook freebsd_committer 2021-11-26 18:49:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4af982e6bea019a33ae85c6c92a3042fadccb739

commit 4af982e6bea019a33ae85c6c92a3042fadccb739
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-11-26 16:02:16 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-11-26 18:48:57 +0000

    lang/python3(6|7|8|9|10|11): work around unwanted multiarch detection again

    In ports 6bef09666460 we patched out python's erroneous multiarch
    detection using sed, but upstream changed the surrounding parts in the
    configure script to defeat the regex we were using. Update the regex to
    cope with the change.

    PR:             259896, 258377
    MFH:            2021Q4
    Approved by:    maintainer timeout (9 days)

 lang/python310/Makefile | 3 +--
 lang/python311/Makefile | 3 +--
 lang/python36/Makefile  | 3 +--
 lang/python37/Makefile  | 3 +--
 lang/python38/Makefile  | 3 +--
 lang/python39/Makefile  | 3 +--
 6 files changed, 6 insertions(+), 12 deletions(-)