Opened 5 years ago

Closed 18 months ago

#60317 closed defect (wontfix)

py38-tensorflow1: error: SDK "macosx10.10" cannot be located

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: emcrisostomo (Enrico Maria Crisostomo)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: cjones051073 (Chris Jones), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), chrstphrchvz (Christopher Chavez), mike142wood, mascguy (Christopher Nielsen)
Port: py-tensorflow1

Description

py38-tensorflow1 fails to build on macOS 10.13:

ERROR: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_python_py-tensorflow1/py38-tensorflow1/work/5a4a1f918df4606204d277b1398d3785/external/com_google_protobuf/BUILD:294:1: C++ compilation of rule '@com_google_protobuf//:protoc_lib' failed: Unexpected IO error: xcrun failed with code 1.
This most likely indicates that SDK version [10.10] for platform [MacOSX] is unsupported for the target version of xcode.
Process exited with status 1
stdout: stderr: xcodebuild: error: SDK "macosx10.10" cannot be located.
xcodebuild: error: SDK "macosx10.10" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx10.10'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 145.652s, Critical Path: 6.74s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

There is, of course, no macOS 10.10 SDK on macOS 10.13.

Change History (19)

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

Is the information here helpful in modifying the port to avoid this problem?

comment:2 Changed 5 years ago by cjones051073 (Chris Jones)

Looks like it, thanks for the info. Lets see if

[60f9d40164053ec0784008cf582841e953ca5c09/macports-ports]

helps. At least locally here it does no harm (macOS 1015, Xcode installed).

Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 4 years ago by blair (Blair Zajac)

I'm on

10.13 and getting a similar error. Should I open a new ticket instead?

macOS 10.13.6 17G12034
Xcode 10.1 10B61 
SUBCOMMAND: # @com_google_protobuf//:protobuf [action 'Compiling external/com_google_protobuf/src/google/protobuf/descriptor.cc [for host]']
(cd /opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_python_py-tensorflow1/py38-tensorflow1/work/79f18e4936820099642468bd7055b922/execroot/org_tensorflow && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=10.13 \
    PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin \
    XCODE_VERSION_OVERRIDE=10.1.0.10B61 \
  external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote external/com_google_protobuf -iquote bazel-out/host/bin/external/com_google_protobuf -iquote external/zlib_archive -iquote bazel-out/host/bin/external/zlib_archive -isystem external/com_google_protobuf/src -isystem bazel-out/host/bin/external/com_google_protobuf/src -isystem external/zlib_archive -isystem bazel-out/host/bin/external/zlib_archive -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf/descriptor.d '-frandom-seed=bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf/descriptor.o' -isysroot __BAZEL_XCODE_SDKROOT__ '-mmacosx-version-min=10.13' -g0 '-march=native' -g0 -DHAVE_PTHREAD -DHAVE_ZLIB -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-write-strings -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_google_protobuf/src/google/protobuf/descriptor.cc -o bazel-out/host/bin/external/com_google_protobuf/_objs/protobuf/descriptor.o)
ERROR: /opt/local/var/macports/build/_Users_blair_Code_MacPorts_macports-ports.git_python_py-tensorflow1/py38-tensorflow1/work/79f18e4936820099642468bd7055b922/external/com_google_protobuf/BUILD:148:1: C++ compilation of rule '@com_google_protobuf//:protobuf' failed: Unexpected IO error: xcrun failed with code 1.
This most likely indicates that SDK version [10.13] for platform [MacOSX] is unsupported for the target version of xcode.
Process exited with status 1
stdout: stderr: xcodebuild: error: SDK "macosx10.13" cannot be located.
xcodebuild: error: SDK "macosx10.13" cannot be located.
xcrun: error: unable to lookup item 'Path' in SDK 'macosx10.13'
Target //tensorflow/tools/pip_package:build_pip_package failed to build

comment:4 Changed 4 years ago by blair (Blair Zajac)

For some reason, if I change

        set tf_bazel_build_opts "${tf_bazel_build_opts} --macos_sdk_version=${configure.sdk_version}"

to

        set tf_bazel_build_opts "${tf_bazel_build_opts} --macos_sdk_version=10.14"

then it works.

My system has

$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
Entitlements.plist  SDKSettings.json  SDKSettings.plist  System  usr

I did a manual Xcode 10 install, maybe I picked up a wrong download?

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

Xcode 10 is fine for High Sierra, but it does not contain the High Sierra SDK; it only contains the Mojave SDK. I am not certain how MacPorts sets configure.sdk_version in this case; maybe it does not set it properly.

comment:6 Changed 4 years ago by cjones051073 (Chris Jones)

just FYI, I add this setting in

https://github.com/macports/macports-ports/commit/60f9d40164053ec0784008cf582841e953ca5c09#diff-5a1f87411d0a0e8892269d8b9308867b

to address the issue mention in the comments.

If MacPorts is then setting it in some cases to an SDK that does not exist, that would be a problem..

comment:7 Changed 4 years ago by cjones051073 (Chris Jones)

[8844a116e9682b10ac3c4893aef12d044047a4be/macports-ports]

shouldn't really be necessary, but... If that warning appears, then I would say there is a bug somewhere in base.

Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

See the code in mportinit in macports-base/src/macports1.0/macports.tcl which simply does:

    if {![info exists macports::macosx_sdk_version]} {
        set macports::macosx_sdk_version $macosx_version
    }

MacPorts assumes that an SDK exists whose version matches the macOS version. This has not been guaranteed to be the case for many years, as Apple has adopted the practice of including only the then-most-recent SDK in Xcode, even when that version of Xcode still works on the previous version of macOS.

Maybe MacPorts should be smarter about this and should set the SDK version variable to whatever SDK exists in the user's Xcode, even if that does not match the OS version.

comment:9 Changed 4 years ago by cjones051073 (Chris Jones)

The problem I guess, with trying to make this smarter, is you first have to deduce the SDK root, and if you look at what

https://github.com/macports/macports-base/blob/master/src/port1.0/portconfigure.tcl#L471

has to do to decide the correct SDK root, you can see its not completely straight forward.

b.t.w. the above is also broken, when using Xcode 10 on mac10.13 (and no CLT) with only the 10.14 SDK. The SDK root returned by the above is an empty string in this case, so ${configure.sdkroot} is also mal-formed.

comment:10 Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

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

i wrote up a ticket a year ago or so asking for it to be set to "/" if that is what we are using. for some reason this idea has not been popular, even though innumerable portfiles then have to do it.

perhaps that might get a relook.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:12 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Just a reminder that this is still happening. Here is a log from 10.12.

comment:13 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

The CI builders encountered this error for both py-tensorflow and py-tensorflow1 on PR 8203.

I notice that for py-tensorflow the use_mp_clang variable is set before xcodeversion_workaround, meaning BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 fails to be set when MacPorts' clang is supposed to be used.

py-tensorflow1 has PortGroup xcodeversion 1.0 but doesn't make use of it—was it supposed to?

Could this ticket's issue possibly be fixed/worked around by always setting BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 even when compatible Xcode clang is present? What features does MacPorts lose by using that option?

comment:14 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:15 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:16 Changed 4 years ago by mascguy (Christopher Nielsen)

Cc: mascguy removed

comment:17 Changed 19 months ago by mike142wood

Cc: mike142wood added

comment:18 Changed 18 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:19 Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: wontfix
Status: assignedclosed

Python 3.9/3.10 are currently the only supported versions for py-tensorflow, so this ticket is no longer relevant. Closing.

Note: See TracTickets for help on using tickets.