New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Info.plist created for Xcode 10.0 #46

Closed
gghose opened this Issue Oct 9, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@gghose
Copy link

gghose commented Oct 9, 2018

The install program produces a sed error but modifies the plist.

  • creating link /usr/local/bin/powerpc-apple-darwin10-gcc-4.2.1
  • creating link /Applications/Xcode.app/Contents/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1
    sed: RE error: illegal byte sequence
    *** modified MacOSX Info.plist

Sure enough when I try make a project:

could not create session: requestError(description: "unknown error while handling message: unableToInitializeCore(errors: ["/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform: error: unable to load platform: \'Info.plist\' was malformed: Couldn\'t parse property list because the input data was in an invalid format", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec \':com.apple.compilers.gcc\' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'", ": error: missing required Mac OS X platform"])")

@rsfinn

This comment has been minimized.

Copy link

rsfinn commented Nov 1, 2018

The XcodeLegacy.sh script tries to use sed to write the new minimum SDK version into the embedded property list at /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist, but in Xcode 10 the plist file is in binary format, so sed corrupts it. Fortunately the script backs up the Info.plist to Info.plist-original alongside, so you can replace the bad version with the original.

As shipped, the original version declares the minimum version as 10.11, so if you don't need an SDK older than that, you're done. Otherwise, you can use BBEdit to edit the binary plist and manually enter the desired version (the key is "MinimumSDKVersion").

@victori

This comment has been minimized.

Copy link

victori commented Nov 7, 2018

Hmm, I have the same problem on Xcode 10.1. However the reverted plist hasn't not helped. Any other insight what it might be?

@victori

This comment has been minimized.

Copy link

victori commented Nov 7, 2018

Actually I take it back my error appears to be different.

`2018-11-07 12:39:32.153 xcodebuild[13749:11389670] [MT] DVTSDK: Skipped SDK /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk; its version (10.6) is below required minimum (10.11) for the macosx platform.
2018-11-07 12:39:32.988 XCBBuildService[13751:11389704] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec ':com.apple.compilers.gcc' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec
2018-11-07 12:39:32.996 XCBBuildService[13751:11389705] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'
2018-11-07 12:39:32.996 XCBBuildService[13751:11389693] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'
--- xcodebuild: WARNING: Configuration Release-Debug is not in the project. Building default configuration.

2018-11-07 12:39:33.238 XCBBuildService[13751:11389706] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec ':com.apple.compilers.gcc' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec
2018-11-07 12:39:33.245 XCBBuildService[13751:11389693] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'
2018-11-07 12:39:33.246 XCBBuildService[13751:11389709] /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec 'Class': 'PBXCompilerSpecificationGcc3_3'
lnote: Using new build system
error: could not create session: requestError(description: "unknown error while handling message: unableToInitializeCore(errors: ["/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC Generic.xcspec: warning: spec \':com.apple.compilers.gcc\' already registered from /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Clang LLVM 1.0.xcplugin/Contents/Resources/Default Compiler.xcspec", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/GCC 4.0.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'", "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/GCC 4.2.xcplugin/Contents/Resources/GCC 4.2.xcspec: error: unknown spec \'Class\': \'PBXCompilerSpecificationGcc3_3\'"])")`

@nicolas-cellier-aka-nice

This comment has been minimized.

Copy link

nicolas-cellier-aka-nice commented Nov 11, 2018

Couldn't we detect the case when property list is binary, and then use plutil rather than sed?
See for example:
http://scriptingosx.com/2016/11/editing-property-lists/
plutil -replace otherkey -string othervalue test.plist

@nicolas-cellier-aka-nice

This comment has been minimized.

Copy link

nicolas-cellier-aka-nice commented Nov 11, 2018

I could successfully install the legacy SDKs/Compilers on Xcode 10.1 by replacing the sed command:

mv "$PLATFORMDIR/Info.plist" "$PLATFORMDIR/Info.plist-original"
sed -e '/MinimumSDKVersion/{N;d;}' < "$PLATFORMDIR/Info.plist-original" > "$PLATFORMDIR/Info.plist"

with:

cp -p "$PLATFORMDIR/Info.plist" "$PLATFORMDIR/Info.plist-original"
plutil -remove MinimumSDKVersion "$PLATFORMDIR/Info.plist"
@gghose

This comment has been minimized.

Copy link
Author

gghose commented Nov 13, 2018

Just did the plutil fix with Xcode 10.1 and it works! Thanks.

Now I've got another problem... somehow the ld links seem screwed up. I've got a project trying to link with x86_64 and for some reason the ppc directories in the toolchain are being searched:

Ld /Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Products/Development/AttendDynX.app/Contents/MacOS/AttendDynX normal x86_64
cd /Users/geoff/Desktop/Lablib/AttendDynX5
export MACOSX_DEPLOYMENT_TARGET=10.5
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.5.sdk -L/Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Products/Development -F/Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Products/Development -F../LocalFrameworks/build/Development -filelist /Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Intermediates.noindex/AttendDynX.build/Development/AttendDynX.build/Objects-normal/x86_64/AttendDynX.LinkFileList -mmacosx-version-min=10.5 -Xlinker -object_path_lto -Xlinker /Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Intermediates.noindex/AttendDynX.build/Development/AttendDynX.build/Objects-normal/x86_64/AttendDynX_lto.o -fobjc-link-runtime -framework EZAudioCompat -framework Lablib -framework Cocoa -Xlinker -dependency_info -Xlinker /Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Intermediates.noindex/AttendDynX.build/Development/AttendDynX.build/Objects-normal/x86_64/AttendDynX_dependency_info.dat -o /Users/geoff/Library/Developer/Xcode/DerivedData/AttendDynX-gbqjgpntvkhtkqcasypgoxrrrqla/Build/Products/Development/AttendDynX.app/Contents/MacOS/AttendDynX

Error: cannot find ld for x86_64 in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/../libexec/ld/ppc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/../../../libexec/ld/ppc /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/../../../../libexec/ld/ppc or /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/../../../../../libexec/ld/ppccollect2: ld returned 1 exit status

What's odd is that Xcode succeeded in making the app (It's in DerivedData) but this area is preventing it from being run "within" the Xcode environment? Any ideas?

@devernay

This comment has been minimized.

Copy link
Owner

devernay commented Feb 12, 2019

fixed by #47

@devernay devernay closed this Feb 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment