#59194 closed defect (fixed)
py37-pyobjc 5.2.0: build failed
Reported by: | teh-maxh (Max Harmony) | Owned by: | jmroot (Joshua Root) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.1 |
Keywords: | catalina | Cc: | moyang (Moyang Wang), vdoublie, andrey-popov (Andrey Popov), smeingast (Stefan Meingast) |
Port: | py-pyobjc |
Description
Port fails to build. The key bit seems to be this:
:info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-pyobjc/py37-pyobjc/work/pyobjc-core-5.2" && /opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 setup.py --no-user-cfg build
Full log attached for context.
Attachments (2)
Change History (18)
Changed 5 years ago by teh-maxh (Max Harmony)
comment:1 Changed 5 years ago by mf2k (Frank Schima)
Port: | py-pyobjc added; py37-pyobjc removed |
---|
comment:2 Changed 5 years ago by jmroot (Joshua Root)
Keywords: | catalina added |
---|
comment:3 Changed 5 years ago by jmroot (Joshua Root)
https://bitbucket.org/ronaldoussoren/pyobjc/issues/274/compile-error-on-python-38-in
Should be fixed in the upcoming release.
comment:5 Changed 5 years ago by andrey-popov (Andrey Popov)
According to the discussion in the referenced issue in pyobjc and judging from the source code, it should still be possible to build the package providing flag -DOBJC_OLD_DISPATCH_PROTOTYPES=1
. Then there is no need to wait for the next release. I don't know MacPorts well enough to test this, though. Could somebody have a look? Note that this port is an (indirect) dependency of Matplotlib, so this is a pretty important problem.
comment:6 Changed 5 years ago by pmininni (Pablo Mininni)
I can confirm that manually adding the flag "-DOBJC_OLD_DISPATCH_PROTOTYPES=1" to the list of CFLAGS in setup.py allows the port to build in Catalina with Xcode 11.1.
comment:8 follow-up: 11 Changed 5 years ago by kprussing (Keith)
I managed to get this building with the attached Portfile and patch. I had to follow the patch file instructions and drop the attached files in a local directory and update the sources.conf
according to the Local Portfile Repositories page.
Changed 5 years ago by kprussing (Keith)
Attachment: | python.tar.gz added |
---|
Patched Portfile and patch
comment:9 Changed 5 years ago by andrey-popov (Andrey Popov)
Cc: | andrey-popov added |
---|
comment:10 Changed 5 years ago by vdoublie
installed fine, added to our own personal repo until proper fix shows up .. THX a whole bunch
comment:11 Changed 5 years ago by andrey-popov (Andrey Popov)
Replying to kprussing:
I managed to get this building with the attached Portfile and patch. I had to follow the patch file instructions and drop the attached files in a local directory and update the
sources.conf
according to the Local Portfile Repositories page.
Many thanks! The patch works for me as well.
comment:12 Changed 5 years ago by smeingast (Stefan Meingast)
Cc: | smeingast added |
---|
comment:13 Changed 5 years ago by ednl (Ewoud Dronkert)
Same problem: failed to build py37-objc on Catalina. And yes, dependency of matplotlib. I want to add, I have no experience with build systems but tried to add -DOBJC_OLD_DISPATCH_PROTOTYPES=1 to CFLAGS in setup.py but either it's not the correct setup.py or I edited it in the wrong place because that didn't work. My actual error is:
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_osx_support.py", line 343, in compiler_fixup if compiler_so[index] == '-isysroot': IndexError: list index out of range
which I hadn't seen mentioned.
comment:14 Changed 5 years ago by mamoll (Mark Moll)
Modify lines 341-350 of _osx_support.py as follows:
for index in reversed(indices): try: if compiler_so[index] == '-isysroot': # Strip this argument and the next one: del compiler_so[index:index+2] else: # It's '-isysroot/some/path' in one arg del compiler_so[index:index+1] except ValueError: break
The reversed
call is the critical bit. This makes sure that the right thing happens when you have more than one -isysroot
compiler flag.
comment:15 Changed 5 years ago by jmroot (Joshua Root)
Owner: | set to jmroot |
---|---|
Resolution: | → fixed |
Status: | new → closed |
You probably need to be running Xcode 11 on 10.15.