Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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)

main.log (32.5 KB) - added by teh-maxh (Max Harmony) 5 years ago.
python.tar.gz (2.0 KB) - added by kprussing (Keith) 5 years ago.
Patched Portfile and patch

Download all attachments as: .zip

Change History (18)

Changed 5 years ago by teh-maxh (Max Harmony)

Attachment: main.log added

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

You probably need to be running Xcode 11 on 10.15.

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

comment:4 Changed 5 years ago by mf2k (Frank Schima)

Cc: moyang added

Has duplicate #59242.

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:7 Changed 5 years ago by mf2k (Frank Schima)

Cc: vdoublie added

Has duplicate #59301.

comment:8 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 in reply to:  8 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: newclosed

In 4cc9df431f9f61f3bee09a933b2793f2032c8a2f/macports-ports (master):

py-pyobjc: update to 5.3

Fixes: #59194

comment:16 Changed 5 years ago by mdekauwe (Martin De Kauwe)

Last edited 5 years ago by mdekauwe (Martin De Kauwe) (previous) (diff)
Note: See TracTickets for help on using tickets.