[Bug 258377] lang/python36 lang/python37 lang/python38 lang/python39 lang/python310: disable detection of multiarch for clang 13

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 08 Sep 2021 22:14:46 +0000
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258377

            Bug ID: 258377
           Summary: lang/python36 lang/python37 lang/python38
                    lang/python39 lang/python310: disable detection of
                    multiarch for clang 13
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: python_at_FreeBSD.org
          Reporter: dim_at_FreeBSD.org
          Assignee: python_at_FreeBSD.org
             Flags: maintainer-feedback?(python_at_FreeBSD.org)

Created attachment 227773
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=227773&action=edit
Stub out multiarch detection in lang/python3X ports for clang 13

During an exp-run for llvm 13 (see bug 258209), it turned out that
lang/python3([6-9]|10) do not build with clang 13.0.0 [1][2][3][4][5]:

LD_LIBRARY_PATH=/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14 CC='cc'
LDSHARED='cc -shared  -lpthread -L/usr/local/lib  -fstack-protector-strong   '
OPT='-DNDEBUG'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py -q
build
Failed to import the site module
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/site.py", line
553, in <module>
    main()
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/site.py", line
539, in main
    known_paths = addusersitepackages(known_paths)
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/site.py", line
282, in addusersitepackages
    user_site = getusersitepackages()
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/site.py", line
258, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/site.py", line
248, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/sysconfig.py",
line 601, in get_config_var
    return get_config_vars().get(name)
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/sysconfig.py",
line 550, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/wrkdirs/usr/ports/lang/python36/work/Python-3.6.14/Lib/sysconfig.py",
line 421, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named
'_sysconfigdata_m_freebsd14_x86_64-unknown-freebsd14'
*** Error code 1

The reason this breaks with clang >= 13, is that it now started supporting the
-print-multiarch option, but in its output it adds a major.minor version
number, for example x86_64-unknown-freebsd14.0. The dot confuses Python, as it
appends the multiarch name to the sysconfig module name, and then can't load
the resulting _sysconfigdata__freebsd14_x86_64-unknown-freebsd14.0.py file:

    ModuleNotFoundError: No module named
'_sysconfigdata__freebsd14_x86_64-unknown-freebsd14'

Since we do not support multiarch, and the configure script has no way to
disable the multiarch check, I would like to propose to just stub it out during
post-patch, as per the attached diff.

[1]
http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/python36-3.6.14.log
[2]
http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/python37-3.7.11.log
[3]
http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/python38-3.8.11.log
[4]
http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/python39-3.9.7.log
[5]
http://gohan04.nyi.freebsd.org/data/mainamd64PR258209-default/2021-09-05_20h27m09s/logs/errors/python310-3.10.0.r1.log

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Wed Sep 08 2021 - 22:14:46 UTC

Original text of this message