Opened 6 years ago

Closed 13 months ago

Last modified 12 months ago

#57964 closed defect (fixed)

port diagnose: could not execute xcode-select, no such file or directory

Reported by: dzhub Owned by:
Priority: Normal Milestone: MacPorts 2.9.0
Component: base Version: 2.5.4
Keywords: tiger Cc:
Port:

Description (last modified by dzhub)

Hi,

I am using MacPorts for years now. Recently I tried to install some ports (for example git, wget, perl...), but every installation stopped and gave me this error:

"Unable to determine location of a macOS SDK"

I reinstalled Xcode 2.5, reinstalled the current version of MacPorts 2.5.4 from the distribution package, but that did not help.

Then I run

sudo port diagnose
Error: process_cmd failed: could not execute "xcode-select": no such file or directory.

I cant find it in my Xcode installation. Was xcode-select introduced with a later Xcode version, and is not part of Xcode 2.5?

I have tried some symlinking from the original Xcode directory (/Developer) to the directory that current Xcode versions use, but that did not help.

What can I do, to define the SDK path in MacPorts?

Thank you for any hints.

Attachments (1)

main.log (24.3 KB) - added by dzhub 6 years ago.
main.log of broken build for readline

Download all attachments as: .zip

Change History (16)

comment:1 Changed 6 years ago by dzhub

Description: modified (diff)
Summary: could not execute xcode_select, no such file or directorycould not execute xcode-select, no such file or directory

comment:2 Changed 6 years ago by dzhub

Description: modified (diff)

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

Component: portsbase
Keywords: tiger added; SDK xcode_select configure.sdkroot removed
Summary: could not execute xcode-select, no such file or directoryport diagnose: could not execute xcode-select, no such file or directory

Yeah, xcode-select was introduced in 10.5.

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

Does /usr/include exist on your system? If not, you need to tell the Xcode installer to include the Command Line Tools. It should be a selectable option, I'm not sure exactly what it was called back then, perhaps "UNIX Development". See: https://guide.macports.org/chunked/installing.html#installing.xcode.other

comment:5 Changed 6 years ago by dzhub

Thank you for listening :-)

/usr/include is present and populated with all the header files.

Anyway, I reinstalled Xcode 2.5 including Developer Tools and MacPorts 2.5.4 once again. Although the Developer Tools lived there for years (I installed a new Bash version after ShellShock and OpenSSL after Heartbleed some time ago whithout any problems).

Still, after reinstallation I get the same errors:

port reclaim
[...]
The following ports will be rebuilt: socat @1.7.3.2
Continue? [Y/n]: 
--->  Computing dependencies for readline
--->  Configuring readline
Error: Unable to determine location of a macOS SDK.
Error: Failed to configure readline: can't read "configure.sdkroot": Unable to determine location of a macOS SDK.
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_readline/readline/main.log for details.
Error: rev-upgrade failed: Error rebuilding socat
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

And...

port diagnose
Error: process_cmd failed: couldn't execute "xcode-select": no such file or directory

On my system Xcode sits in /Developer/Applications/. I edited /opt/local/etc/macports/macports.conf and changed the variable developer_dir like so:

# Directory containing Xcode Tools (default is to ask xcode-select)
#developer_dir       /Applications/Xcode.app/Contents/Developer?
developer_dir       /Developer

This did not help either.

Last edited 6 years ago by dzhub (previous) (diff)

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

There are two separate problems here: port diagnose is broken on Tiger, which is something we need to fix, and you don't seem to have all the bits of Xcode that MacPorts needs, which is probably something you need to fix.

This is the procedure that is returning the error: https://github.com/macports/macports-base/blob/v2.5.4/src/port1.0/portconfigure.tcl#L401

It's pretty straightforward, and should be returning either an empty string if the selected SDK version is the same as the current OS version, or ${developer_dir}/SDKs/MacOSX10.4u.sdk if that exists. It only returns an error if neither of those is the case.

You aren't doing anything unusual like building for a deployment target different than the OS version you're on? Could you attach the main.log from a failed build?

Last edited 6 years ago by jmroot (Joshua Root) (previous) (diff)

Changed 6 years ago by dzhub

Attachment: main.log added

main.log of broken build for readline

comment:7 Changed 6 years ago by dzhub

No deployment for foreign targets so far... All I did was to compile dovecot and postfix from sources a while ago. Afaik, that should not interfere with macports.

I have attached the main.log from a broken install of readline. Everything looks good at start.

version:1
:debug:sysinfo Mac OS X 10.4 (darwin/8.11.0) arch powerpc
:debug:sysinfo MacPorts 2.5.4
:debug:sysinfo Xcode 2.5
:debug:sysinfo SDK 2.5
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.4

But then I get this:

:debug:configure Executing org.macports.configure (readline)
:error:configure Unable to determine location of a macOS SDK.
:error:configure Failed to configure readline: can't read "configure.sdkroot"

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

:debug:sysinfo SDK 2.5

That isn't right, it should be 10.4.

comment:9 Changed 6 years ago by dzhub

Is there a way for me to correct this?

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

It has to be coming from your macports.conf.

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

Specifically, this would happen if you set

# Don't do this
macosx_sdk_version 2.5

in macports.conf. Delete that line to allow the MacPorts default value of 10.4 on your system to be used.

comment:12 Changed 6 years ago by dzhub

Yes, that was the last culprit.

While searching for the cause of the error on my system, I tried this hint from https://trac.macports.org/ticket/57143 using Xcode 2.5 instead of 10.14:

"And just one more note, I tested that with forcing 10.14 it works:

echo macosx_sdk_version 10.14 | sudo tee -a /opt/local/etc/macports/macports.conf

"

I deleted that line, and macports works again. Thank you so much!

Now, if I only new, what caused the initial error... Anyway, it seems reinstallation of Xcode and macports did the trick.

comment:13 Changed 13 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

comment:14 Changed 13 months ago by jmroot (Joshua Root)

Milestone: MacPorts Future

comment:15 Changed 12 months ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.9.0
Note: See TracTickets for help on using tickets.