Opened 11 years ago

Closed 11 years ago

Last modified 6 years ago

#41138 closed defect (invalid)

xcrun: error: unable to exec Xcode native xcrun (Permission denied).

Reported by: mr.nice_365@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc:
Port:

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

seems like that happened before and some said that's not the reason for what's going wrong but after upgrading to Mavericks none of the ports I tried to install worked (bzip2, openssl, cmake), all with the same error.

I followed all steps of Migration and even http://guide.macports.org/chunked/installing.macports.uninstalling.html

One Problem I run into when following the Migration guide was when installing the Command Line Tools via xcode-select --install "Can't install ... because ... not available... from ... Software Update server." Therefore I downloaded the Command Line Tools for Mavericks manually

here's the error I get when trying to install any port (tclIndex is in the Scripts subfolder)

cat /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/main.log
version:1
:debug:main Attempting ln -sf /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/archivers/bzip2/work
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 501
:debug:main euid changed to: 503
:debug:main Executing org.macports.main (bzip2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:archivefetch archivefetch phase started at Sat Nov  2 20:12:14 CET 2013
:msg:archivefetch --->  Fetching archive for bzip2
:debug:archivefetch Executing org.macports.archivefetch (bzip2)
:debug:archivefetch Can't run archivefetch on this port without elevated privileges. Escalating privileges back to root.
:debug:archivefetch euid changed to: 0. egid changed to: 0.
:debug:archivefetch changing euid/egid - current euid: 0 - current egid: 0
:debug:archivefetch egid changed to: 501
:debug:archivefetch euid changed to: 503
:info:archivefetch --->  bzip2-1.0.6_0.darwin_13.x86_64.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
:msg:archivefetch --->  Attempting to fetch bzip2-1.0.6_0.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/bzip2
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404 Not Found
:msg:archivefetch --->  Attempting to fetch bzip2-1.0.6_0.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/bzip2
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404 Not Found
:msg:archivefetch --->  Attempting to fetch bzip2-1.0.6_0.darwin_13.x86_64.tbz2 from http://packages.macports.org/bzip2
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404 Not Found
:debug:archivefetch Privilege de-escalation not attempted as not running as root.
:debug:fetch fetch phase started at Sat Nov  2 20:12:18 CET 2013
:notice:fetch --->  Fetching distfiles for bzip2
:debug:fetch Can't run fetch on this port without elevated privileges. Escalating privileges back to root.
:debug:fetch euid changed to: 0. egid changed to: 0.
:debug:fetch changing euid/egid - current euid: 0 - current egid: 0
:debug:fetch egid changed to: 501
:debug:fetch euid changed to: 503
:debug:fetch Executing org.macports.fetch (bzip2)
:info:fetch --->  bzip2-1.0.6.tar.gz doesn't seem to exist in /opt/local/var/macports/distfiles/bzip2
:notice:fetch --->  Attempting to fetch bzip2-1.0.6.tar.gz from http://lil.fr.distfiles.macports.org/bzip2
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Sat Nov  2 20:12:21 CET 2013
:notice:checksum --->  Verifying checksums for bzip2
:debug:checksum Executing org.macports.checksum (bzip2)
:info:checksum --->  Checksumming bzip2-1.0.6.tar.gz
:debug:checksum Correct (md5) checksum for bzip2-1.0.6.tar.gz
:debug:checksum Correct (sha1) checksum for bzip2-1.0.6.tar.gz
:debug:checksum Correct (rmd160) checksum for bzip2-1.0.6.tar.gz
:debug:checksum Privilege de-escalation not attempted as not running as root.
:debug:extract extract phase started at Sat Nov  2 20:12:21 CET 2013
:notice:extract --->  Extracting bzip2
:debug:extract Executing org.macports.extract (bzip2)
:info:extract --->  Extracting bzip2-1.0.6.tar.gz
:debug:extract setting option extract.args to '/opt/local/var/macports/distfiles/bzip2/bzip2-1.0.6.tar.gz'
:debug:extract Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:extract Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/bzip2/bzip2-1.0.6.tar.gz' | /usr/bin/tar -xf -'
:debug:extract Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/bzip2/bzip2-1.0.6.tar.gz' | /usr/bin/tar -xf - 
:debug:extract euid/egid changed to: 0/0
:debug:extract chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work to macports
:debug:extract euid/egid changed to: 503/501
:debug:extract Privilege de-escalation not attempted as not running as root.
:debug:patch patch phase started at Sat Nov  2 20:12:21 CET 2013
:debug:patch Executing org.macports.patch (bzip2)
:notice:patch --->  Applying patches to bzip2
:info:patch --->  Applying patch-Makefile-man.diff
:debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0'
:debug:patch Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/archivers/bzip2/files/patch-Makefile-man.diff'
:info:patch patching file Makefile
:info:patch --->  Applying patch-Makefile-links.diff
:debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0'
:debug:patch Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/archivers/bzip2/files/patch-Makefile-links.diff'
:info:patch patching file Makefile
:info:patch --->  Applying patch-Makefile-dylib.diff
:debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0'
:debug:patch Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/archivers/bzip2/files/patch-Makefile-dylib.diff'
:info:patch patching file Makefile
:debug:patch Executing proc-post-org.macports.patch-patch-0
:debug:patch Executing reinplace: /usr/bin/sed s|__MacPorts_Version__|1.0.6|g < /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile >@ file12
:debug:patch euid/egid changed to: 0/0
:debug:patch chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile to macports
:debug:patch euid/egid changed to: 503/501
:debug:patch euid/egid changed to: 0/0
:debug:patch setting attributes on /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile
:debug:patch euid/egid changed to: 503/501
:debug:patch Executing reinplace: /usr/bin/sed s|__MacPorts_Compatibility_Version__|1.0|g < /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile >@ file12
:debug:patch euid/egid changed to: 0/0
:debug:patch chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile to macports
:debug:patch euid/egid changed to: 503/501
:debug:patch euid/egid changed to: 0/0
:debug:patch setting attributes on /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6/Makefile
:debug:patch euid/egid changed to: 503/501
:debug:patch Privilege de-escalation not attempted as not running as root.
:debug:configure configure phase started at Sat Nov  2 20:12:21 CET 2013
:notice:configure --->  Configuring bzip2
:debug:configure Using compiler 'Xcode Clang'
:debug:configure Executing org.macports.configure (bzip2)
:debug:configure Privilege de-escalation not attempted as not running as root.
:debug:build build phase started at Sat Nov  2 20:12:21 CET 2013
:notice:build --->  Building bzip2
:debug:build Executing org.macports.build (bzip2)
:debug:build Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/make -j4 -w all CC="/usr/bin/clang -arch x86_64" PREFIX=/opt/local'
:debug:build Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/make -j4 -w all CC="/usr/bin/clang -arch x86_64" PREFIX=/opt/local 
:info:build xcrun: error: unable to exec Xcode native xcrun (Permission denied).
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/work/bzip2-1.0.6" && /usr/bin/make -j4 -w all CC="/usr/bin/clang -arch x86_64" PREFIX=/opt/local 
:info:build Exit code: 1
:error:build org.macports.build for port bzip2 returned: command execution failed
:debug:build Error code: CHILDSTATUS 18689 1
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: targets not executed for bzip2: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:error:build Failed to install bzip2
:debug:build couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
    while executing
"open [file join $dir tclIndex]"
:notice:build Please see the log file for port bzip2 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_bzip2/bzip2/main.log

Change History (4)

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

Description: modified (diff)
Keywords: tclIndex removed
Summary: tclIndex Mavericks Scripts/tclIndexxcrun: error: unable to exec Xcode native xcrun (Permission denied).

What you've read before is correct: an error about tclIndex is irrelevant. See #37231.

The reason your bzip2 build is failing, according to your above log, is:

xcrun: error: unable to exec Xcode native xcrun (Permission denied).

So, why is that? What happens when you manually run xcrun?

comment:2 Changed 11 years ago by mr.nice_365@…

good question. xcrun works as expected but I've found out via

xcrun --show-sdk-path

that it used the wrong Xcode (had too many developer preview versions around)

I did a

xcode-select --reset

and now everything works fine again! thanks.

comment:3 Changed 11 years ago by mf2k (Frank Schima)

Resolution: invalid
Status: newclosed

comment:4 Changed 6 years ago by 98B

What happened in my case (same error message) turned out to be due to the location of Xcode and the permissions that the location entails: the edition I had xcode-selected is installed in ~/Applications. This directory, by default, has permissions set to drwx------. Which is not good enough for user MacPorts:

$ sudo -u macports /bin/bash
bash-3.2$ xcrun
xcrun: error: unable to exec Xcode native xcrun (Permission denied).

(Some port operations seem to be carried out by this user.) I added the user MacPorts to the list of users of ~/Applications via Finder's info dialog ⌘-I, granting Read permissions, and then everything started to work as expected. (The permissions of ~/Applications look like drwx------+ now.)

Note: See TracTickets for help on using tickets.