Opened 6 years ago

Last modified 6 years ago

#56619 new defect

I ran "sudo port selfupdate" and now I cannot install any ports without an error

Reported by: JulioDavidMartinez Owned by:
Priority: Normal Milestone:
Component: base Version: 2.5.2
Keywords: Cc:
Port:

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

Here is the log:

System headers do not appear to be installed. Most ports should build correctly, but if you experience problems due to a port depending on system headers, please file a ticket at https://trac.macports.org.
Warning: You can install them as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Computing dependencies for fontforgeError: Unable to determine location of a macOS SDK.
Error: Unable to execute port: can't read "configure.sdkroot": Unable to determine location of a macOS SDK.

It always asks me to install xcode-select --install, I have installed it like 50 times. This line is new since the update:

Unable to execute port: can't read "configure.sdkroot":

I have no idea what file this is nor where to locate it. How can I fix this? Please help. Im running Yosemite. I have XCode installed and the XCode Tools. I have been running MacPorts successfully for years on this station. Ever since the selfupdate today it broke. I cannot upgrade to High Sierra because we use an XSan system over fibre and the newer versions of OS X don't support our setup. I even tried uninstalling all my ports and deleting macports all together and then re-installing from scratch. Still gives me that error about the config file.

Change History (12)

comment:1 Changed 6 years ago by raimue (Rainer Müller)

Can you attach a main.log showing the error? On which version of macOS are you? Does /usr/include exist on your system?

comment:2 Changed 6 years ago by raimue (Rainer Müller)

Ah, sorry, I did not see it at first: Mac OS X 10.10 Yosemite.

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

What result do you get from running xcrun --sdk macosx10.10 --show-sdk-path?

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

Description: modified (diff)

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

Priority: HighNormal

comment:6 Changed 6 years ago by bjax (Bruce Jackson)

I have had the same problem with macport since I guess 2.5 was released; an example is updating OpenSSL. Looks like my xcode-select is correct and command line tools are installed.

I am running MacOS 10.12.6, Xcode 9.2.

The SDK folder is at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs; it contains two files:

  • MacOSX.sdk
  • MacOSX10.13.sdk

Apparently Xcode ships with the next planned macOS SDK, "but it supports older ones" (I read somewhere while frantically searching for a fix), something I fail to comprehend.

I'm having no problems with MacPorts 2.5.2 on the home OS 10.13 machine so it appears to be related with 10.12.

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

I suggest you open the Xcode.app in the /Applications folder.

Let it do what it wants to do, install what it wants to install, agree to everything it wants you to agree with.

Then try your MacPorts stuff again, and report back if errors with a log of what you get.

comment:8 Changed 6 years ago by bjax (Bruce Jackson)

I opened Xcode 9.2, built a project or two, and closed it. Xcode seemed happy.

But again:

$ sudo port -d  install opens
DEBUG: Copying /Users/bjax/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/openssl
DEBUG: OS darwin/16.7.0 (Mac OS X 10.12) arch i386
DEBUG: Reading variant descriptions from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/variant_descriptions.conf
DEBUG: Sourcing PortGroup muniversal 1.0 from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/group/muniversal-1.0.tcl
Error: Unable to determine location of a macOS SDK.
DEBUG: Unable to determine location of a macOS SDK.
    while executing
"portconfigure::configure_get_sdkroot ${configure.sdk_version}"
    invoked from within
"set configure.sdkroot [portconfigure::configure_get_sdkroot ${configure.sdk_version}]"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 set $optionName $option_defaults($optionName)"
    (procedure "default_check" line 11)
    invoked from within
"default_check configure.sdkroot {} r"
    (read trace on "configure.sdkroot")
    invoked from within
"if {${configure.sdkroot} ne ""} {
    configure.args-append   '-isysroot ${configure.sdkroot}' \
                            -Wl,-syslibroot,${configu..."
    (file "Portfile" line 64)
    invoked from within
"source Portfile"
    invoked from within
"$workername eval {source Portfile}"
    (procedure "mportopen" line 50)
    invoked from within
"mportopen $porturl [array get options] [array get requested_variations]"
Error: Unable to open port: can't read "configure.sdkroot": Unable to determine location of a macOS SDK.
Version 0, edited 6 years ago by bjax (Bruce Jackson) (next)

comment:9 Changed 6 years ago by bjax (Bruce Jackson)

Update to above: I was able to get MacPorts working by downloading MacOSX.10.12.sdk from GitHub phracker/MacOSX-SDKs and installing in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ with proper ownership (root:wheel).

comment:10 Changed 6 years ago by MichalMMac (Michal Moravec)

Run into this problem with macOS 10.13.6 + Xcode 10.0. I was able to "fix" it by creating symlink in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

sudo ln -s MacOSX.sdk MacOSX10.13.sdk

Last edited 6 years ago by MichalMMac (Michal Moravec) (previous) (diff)

comment:11 Changed 6 years ago by fnaum (Federico Naum)

The symlink trick did the work for me. Thanks

comment:12 Changed 6 years ago by nocturne-mit

I had the same problem, on High Sierra 10.13.6, using Xcode 10.1 Build version 10B61 .

Creating Michal's symlink fixed my problem.

Note: See TracTickets for help on using tickets.