Opened 3 years ago

Closed 2 years ago

#65177 closed defect (fixed)

python27-bootstrap fails to build: ImportError: No module named pyexpat

Reported by: barracuda156 Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: tiger, snowleopard Cc:
Port: python27-bootstrap

Description

/opt/x86_64/bin/gcc-mp-11 -L/opt/x86_64/libexec/python27-bootstrap/lib -Wl,-headerpad_max_install_names -arch x86_64 -o "Python Launcher" FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o -framework AppKit -framework Carbon
ld: warning: directory not found for option '-L/opt/x86_64/libexec/python27-bootstrap/lib'
rm -fr "Python Launcher.app"
DYLD_FRAMEWORK_PATH=/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18 ../../python.exe ./../../Lib/plat-mac/bundlebuilder.py \
		--builddir=. \
		--name="Python Launcher" \
		--executable="Python Launcher" \
		--iconfile=./../Icons/PythonLauncher.icns \
		--bundle-id=org.python.PythonLauncher \
		--resource=./../Icons/PythonSource.icns \
		--resource=./../Icons/PythonCompiled.icns \
		--resource=./English.lproj \
		--resource=./factorySettings.plist \
		--plist Info.plist \
		build
Traceback (most recent call last):
  File "./../../Lib/plat-mac/bundlebuilder.py", line 949, in <module>
    main()
  File "./../../Lib/plat-mac/bundlebuilder.py", line 897, in main
    builder.plist = Plist.fromFile(arg)
  File "/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Lib/plistlib.py", line 345, in fromFile
    rootObject = readPlist(pathOrFile)
  File "/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Lib/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
  File "/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Lib/plistlib.py", line 401, in parse
    from xml.parsers.expat import ParserCreate
  File "/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Lib/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat
make[2]: *** [Python Launcher.app] Error 1
make[2]: Leaving directory `/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Mac/PythonLauncher'
make[1]: *** [install_PythonLauncher] Error 2
make[1]: Leaving directory `/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Mac'
make: *** [frameworkinstallapps] Error 2
make: Leaving directory `/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18'

Attachments (1)

main.log (1.9 MB) - added by barracuda156 3 years ago.

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by barracuda156

Attachment: main.log added

comment:1 Changed 3 years ago by barracuda156

Apparently has nothing to do with an arch, I got identical failure now on Tiger PPC:

  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Lib/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat
make[1]: *** [install_BuildApplet] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python27/python27-bootstrap/work/Python-2.7.18/Mac'
make: *** [frameworkinstallapps] Error 2

comment:2 Changed 3 years ago by barracuda156

Keywords: tiger added; x86_64 removed
Summary: python27-bootstrap fails to build for x86_64 with gcc11 on 10.6.8: ImportError: No module named pyexpatpython27-bootstrap fails to build: ImportError: No module named pyexpat

comment:3 Changed 2 years ago by kencu (Ken)

this seems to be happening on multiple systems I have tried.

comment:4 Changed 2 years ago by kencu (Ken)

probably broken by this commit, that removed the expat dep from python27-bootstrap and sterilized the environment, but left the configure args "-with-system-expat" and some others in place.

https://github.com/macports/macports-ports/commit/d11c2377c9cff32cd5cb6a0ed11788cc46862c1a

removing "-with-system-expat" fixes the build.

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

I was never able to repro on 10.6.

% port -v installed python27-bootstrap 
The following ports are currently installed:
  python27-bootstrap @2.7.18_10 (active) requested_variants='' platform='darwin 10' archs='x86_64' date='2022-10-22T15:51:34+1100'
% otool -L /opt/local/libexec/python27-bootstrap/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/pyexpat.so
/opt/local/libexec/python27-bootstrap/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/pyexpat.so:
	/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

comment:6 Changed 2 years ago by kencu (Ken)

It appears Tiger doesn't have libexpat.

Let me look closer at Leopard and see what is going on there.

comment:7 Changed 2 years ago by kencu (Ken)

Leopard builds through and seems fine -- it has /usr/include/expat.h and the library. Only Tiger doesn't have it.

comment:9 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 7da4ca386628281ce33938b322ba3f2d61f35fc0/macports-ports (master):

python27-bootstrap: fix missing expat/libffi on Tiger

Can't use system expat and libffi as they don't exist on Tiger.
Closes: #65177

Add notes about Tiger modules--because it builds from system roots, the
python27-bootstrap port cannot build as many modules as the full
python27 port.

Note: See TracTickets for help on using tickets.