UFO ET IT

Xcode 4.3을 설치 한 후 MacPort 기능을 사용할 수 없습니다.

ufoet 2020. 11. 26. 20:26
반응형

Xcode 4.3을 설치 한 후 MacPort 기능을 사용할 수 없습니다.


MacPorts가 제대로 작동하는 데 문제가 있습니다. 방금 OSX Lion 10.7.3을 설치했습니다. 먼저 MacPorts를 다운로드하여 설치 한 다음 요구 사항을 읽은 후 App Store에서 Xcode4.3을 다운로드 한 다음 설치했습니다. Xcode를 시작했는데 작동하고 작동하는 것 같습니다. 그러나 MacPorts로 포팅하려고 할 때 다음과 같은 오류 메시지가 나타납니다 (발췌).

Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.

나는 다음의 조언을 따랐다.

MacPorts가 작동 할 수 있도록 OSX Lion에 Xcode 용 추가 패키지를 설치하는 방법

Xcode의 환경 설정에서 command_line_tools_for_xcode를 설치했습니다. Xcode를 닫았고 다시 오류가 발생했습니다.

$ sudo port install libsocketsPassword:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
--->  Computing dependencies for libsockets
--->  Dependencies to be installed: openssl zlib
--->  Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error: 
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error: 
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: openssl zlib
Error: Status 1 encountered during processing.

나는 이것으로 다음에 어디로 가야할지 모르겠습니다. Xcode 및 MacPort 인터페이스 문제를 해결하려면 어떻게합니까?


이론적으로 이것은 Xcode4.3이 설치되어 있으면 작동합니다 (/ Applications에 있음).

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

(선택 사항 인 명령 줄 도구를 설치했습니다)


"Xcode 용 명령 줄 도구"패키지를 설치하면 모든 것이 잘 작동하기 시작합니다. https://developer.apple.com/downloads/index.action# 에서 다운로드 할 수 있습니다.


Xcode 4.3에 대한 MacPorts 마이그레이션 지침을 참조하십시오 .

지침은 상당히 복잡합니다. 당신은 실행하는 데 필요한 xcode-select새로운 도구 경로 업데이트 설정 developer_dir에서을 macports.conf(에 의해 설명 된대로 헹크 Poley MacPorts를 (아야)를 다시 설치하고, 마지막으로 제거하고 모든 포트 (더블 아야)를 다시 설치).

편집 : libpvx 위의 후에도 여전히 설치되지 않습니다. 두 가지 추가 단계가 필요했습니다.

  1. sudo ln -s /Developer /
  2. sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /SDKs

다른 포트가 설치된 경우 YMMV!


또한 대신에 가리키는 /opt/local/etc/macports/macports.conf줄을 변경하십시오 .developer_dir//Developer


sudo xcode-select -switch /Applications/Xcode.app

나는 또한 실행해야했다

sudo xcodebuild -license

라이센스에 동의


나를 위해 일한 솔루션은 다음과 같습니다.

  1. Xcode 용 명령 줄 도구 설치

    Xcode -> Preferences -> Downloads
    
  2. MacPorts가 올바른 Xcode 폴더를 찾도록 도와주세요.

    sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
    
  3. clang 컴파일러가 이제 다른 곳에 위치하므로 기호 링크를 만듭니다.

    sudo ln -s `which clang` /Applications/Xcode.app/Contents/Developer/usr/bin/
    sudo ln -s `which clang++` /Applications/Xcode.app/Contents/Developer/usr/bin/
    

트렁크를 사용해보십시오. 아직 Xcode 4.3을 지원하는 릴리스가 없습니다.


/opt/local/etc/macports.conf에서 개발자 경로를 설정하는 것이 저에게 효과적입니다.

developer_dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

대부분의 컴파일러가 Developer 아래에 / usr / bin 대신 저장되기 때문입니다.


이 중 어느 것도 나를 위해 작동하지 않습니다. Macports가 공식적으로 XCode 4.3 이상을 지원하는 새 버전을 출시 할 때까지 기다리십시오.


sudo mv /usr/bin/xcodebuild /usr/bin/xcodebuild.old
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild /usr/bin/xcodebuild 

Starting with Xcode 4.3, the command-line build tools are not installed by default. Launch Xcode, open the Preferences, and go to the Downloads tab. From there you should have an option to install the command-line tools.

You can also download them from the web here: https://developer.apple.com/downloads/index.action

Disclaimer: I haven't installed Xcode 4.3 yet. I have only read about it on the web.


As of 27/2/2012, the official suggestion from MacPorts seems to be to not use XCode 4.3 and instead use 4.1 through 4.2.1, which can be downloaded from Apple.

There is a bug ticket which might be useful to follow the evolution of this.

Incidentally, and as reported in my comment #11 in that bug report, I am able to build ports without warnings by using the 2 most sane-looking suggestions found in this question: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer and changing developer_dir in /opt/local/etc/macports/macports.conf to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain


I have macports installed without admin/root privileges, so I was unable to test the xcode-select answers. However, I observed that Pall Melsted's answer worked, but not initially. What I found out was that I had not accepted the Xcode 4.5 license agreement!

If you have just installed Xcode for the purposes of macports, and you haven't accepted the Xcode license yet, you might get the error presented by the original post. When I checked my Xcode version using /usr/bin/xcodebuild -version, I was given the prompt to read and accept the license. After doing so, and after having made the changes suggested by Pall to the macports.conf developer_dir, it all works now.


As alternative: you can make downgrade of Xcode to 4.2.1 version. DMG of Xcode 4.2.1 placed here: https://developer.apple.com/downloads/index.action

After this MacPorts became works fine for me.


This is fixed in MacPorts 2.0.4.

To upgrade:

  1. Download MacPorts 2.0.4 from the install site or run sudo port selfupdate.
  2. Run the MacPorts migration described here to reinstall all ports. This is painful but required to get back to a working state.

You should definitely run sudo xcode-select -switch /Applications/Xcode.app like everyone here says, that'll fix many problems, but certainly not all.

Afaik, all the remaining problems exist within the configuration information for various packages. You might simply reinstall MacPorts as described in the migration instructions, but I found another solution.


You should begin finding all effected port files using commands like grep /Developer/ ..., after executing sudo bash and cd /opt/local naturally.

You should identify all effected ports by using port provides ..., which I piped through sed and sort | uniq. You could simply reinstall all these ports using either port -n upgrade --force ... or separate port uninstall ... and port install ... commands.

I recommend using one large port -n upgrade --force ... command to avoid duplicate rebuilds of dependencies, using the separate uninstall and install commands afterwards.

There are of course various ports for which /Developer exists only inside text config files, meaning you can fix them manually with sed -i -e 's/\/Developer//g' ..., but you cannot do so with binaries obviously.

I'm afraid you must at minimum rebuild all your Python and Perl installations, making this upgrade an ideal time to clean out packages that depend upon older versions, ala python26 and perl5.8.

There are several technically effected ports I decided against rebuilding like fuse4x-kext, who contained /Developer inside Library/Extensions/fuse4x.kext/Contents/MacOS/fuse4x but hasn't prevented sshfs from working correctly.


I had initially installed xcode 3.2.2, after which I installed 4.3. When I ran the xcode-select, I still got the same error about no xcode project in /Applications. I then dug into the /usr/bin/xcodebuild script and found out that this was working correctly, and another instance of xcodebuild (the one installed with xcode 4.3, not the one in /usr/bin) was being run and returning the error:

xcodebuild: error: The directory /Applications does not contain an Xcode project.

It seems the /usr/bin/xcode-select does not work for xcode 4.3, (it's compiled so you can't really see why it's not working). Strings doesn't give any clues. Good thing osx has strace.. oh wait.

Anyways, the best I could do was modify /opt/local/etc/macports.conf and uncomment the line containing the path to the xcode installation. That seems to fix my problem for the most part.

참고URL : https://stackoverflow.com/questions/9323738/unable-to-get-macport-functionality-after-installing-xcode-4-3

반응형