Opened 3 years ago

Closed 3 years ago

#64352 closed defect (fixed)

python39 @3.9.9_0+universal: fails to build on Mac OS X 10.7 Lion

Reported by: johnrosshunt Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: python39

Description

python39 universal fails to build on Mac OS X 10.7 Lion. python39 non-universal builds fine. And for reference, python38 +universal & python310 +universal build fine.

Traceback (most recent call last):
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/./setup.py", line 2598, in <module>
    main()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/./setup.py", line 2568, in main
    setup(# PyPI Metadata (PEP 301)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
    return run_commands(dist)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
    dist.run_commands()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
    self.run_command(cmd)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
    cmd_obj.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
    cmd_obj.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/./setup.py", line 456, in build_extensions
    build_ext.build_extensions(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 446, in build_extensions
    self._build_extensions_parallel()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in _build_extensions_parallel
    fut.result()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/Lib/concurrent/futures/_base.py", line 445, in result
    return self.__get_result()
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/Lib/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/Lib/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9/./setup.py", line 554, in build_extension
    build_ext.build_extension(self, ext)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 117, in _compile
    self.spawn(compiler_so + cc_args + [src, '-o', obj] +
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 917, in spawn
    spawn(cmd, dry_run=self.dry_run, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_distutils/spawn.py", line 38, in spawn
    log.info(subprocess.list2cmdline(cmd))
AttributeError: module '_bootsubprocess' has no attribute 'list2cmdline'
make: *** [sharedmods] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.9" && /usr/bin/make -j2 -w all 
Exit code: 2

Attachments (1)

main.log.gz (17.9 KB) - added by johnrosshunt 3 years ago.
main.log

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by johnrosshunt

Attachment: main.log.gz added

main.log

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Keywords: lion i386 removed
Owner: set to jmroot
Status: newaccepted

Well that's interesting. It's using the distutils installed by the setuptools port while building the stdlib.

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Try this:

  • lang/python39/Portfile

    diff --git a/lang/python39/Portfile b/lang/python39/Portfile
    index 1f2689f3ab2..ce3b69da4ca 100644
    a b configure.args --enable-framework=${frameworks_dir} \ 
    7070
    7171configure.ccache    no
    7272# pkg-config removes -I flags for paths in CPATH, which confuses python.
    73 configure.env       PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
     73configure.env       PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
     74                    SETUPTOOLS_USE_DISTUTILS=stdlib
     75build.env           SETUPTOOLS_USE_DISTUTILS=stdlib
     76destroot.env        SETUPTOOLS_USE_DISTUTILS=stdlib
    7477
    7578post-patch {
    7679    reinplace "s|@@PREFIX@@|${prefix}|g" \

comment:3 Changed 3 years ago by johnrosshunt

The patch worked!

For what it's worth, I was able to build python39+universal on Lion by uninstalling everything and rebuilding everything from scratch. But, I couldn't rebuild python39 from source after everything was installed.

The patch works with either a clean or cluttered MacPorts tree. Thank you.

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Thanks for testing.

comment:5 Changed 3 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: acceptedclosed

In e2c98fb44858b32e5f7563ac2bcdfafa25a58a09/macports-ports (master):

python3{7,8,9,10,11}: fix potential build failure

If setuptools 60 or later is installed, its copy of distutils will be
used[1], apparently even when building the python stdlib. Unfortunately
it doesn't seem to be completely compatible with the stdlib's build
system (at least in some python versions). So ensure that the stdlib's
own distutils is used.

Fixes: #64352

[1] https://setuptools.pypa.io/en/latest/history.html#v60-0-0

Note: See TracTickets for help on using tickets.