Opened 5 years ago

Closed 5 years ago

#59455 closed defect (fixed)

py37-pyobjc-cocoa: ValueError: invalid literal for int() with base 10: ''

Reported by: pietvo (Pieter van Oostrum) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jmroot (Joshua Root)
Port: py-pyobjc-cocoa

Description (last modified by ryandesign (Ryan Carsten Schmidt))

py37-pyobjc-cocoa fails to build on my system. It gives an error message similar to ticket:59425, but the cause its slightly different. Error message:

File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-pyobjc-cocoa/py37-pyobjc-cocoa/work/pyobjc-framework-Cocoa-5.3/pyobjc_setup.py", line 408, in Extension
:info:build     cflags.append("-DPyObjC_BUILD_RELEASE=%02d%02d"%(tuple(map(int, os.path.basename(data)[6:-4].split('.')))))
:info:build ValueError: invalid literal for int() with base 10: ''

The variable data in this statement is the SDK root, obtained by the command

/usr/bin/xcrun -sdk macosx --show-sdk-path

It appears inside the setup script this generates

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

i.e. without a version number to be extracted, whereas in a terminal session it generates:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

In the py-pyobjc port it uses get_sdk_level(self.sdk_root) to get the version numbers and this works correctly with commit a8e89f36dd6. However the corresponding commit b6d4b3fe8aa doesn't solve the problem for py-pyobjc-cocoa.

Attachments (1)

main.log (37.8 KB) - added by pietvo (Pieter van Oostrum) 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by pietvo (Pieter van Oostrum)

Attachment: main.log added

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Summary: Failed to build py37-pyobjc-cocoa: command execution failedpy37-pyobjc-cocoa: ValueError: invalid literal for int() with base 10: ''

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

That must mean it's not honouring the SDKROOT we're setting. Not sure why.

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

Ah, actually, we're setting SDKROOT='/', which would also break this code.

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

So there are two things wrong: it's not recognising the -isysroot flag we use, and it's assuming that the SDK returned by xcrun will always have a version number in its name.

comment:5 Changed 5 years ago by pietvo (Pieter van Oostrum)

Probably because it is given as -isysroot/ and the check is for -isysroot. It should be given as -isysroot / for the test to work.

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

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 0bf799b15a1670f73f334b94fa58120fad566ba5/macports-ports (master):

py-pyobjc-*: fix SDK detection

Closes: #59455

Note: See TracTickets for help on using tickets.