Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Cannot build DependentApp with xcodebuild #73

Open
schwa opened this issue Dec 19, 2013 · 4 comments
Open

Cannot build DependentApp with xcodebuild #73

schwa opened this issue Dec 19, 2013 · 4 comments

Comments

@schwa
Copy link

schwa commented Dec 19, 2013

DependentApp project builds fine in Xcode. Does NOT build in xcodebuild.

Looks like any file that imports <Serenity/Serenity.h> will fail.

schwa@moth ~/D/i/s/DependentApp /master> xcodebuild -version
Xcode 5.0.2
Build version 5A3005

Error:

Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, F) [F = <lambda at /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:168:73>]
Thread: <NSThread: 0x7fb7ee20ae90>{name = (null), num = 12}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
2013-12-19 13:32:00.606 xcodebuild[10913:4307] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-3575/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:78
Details: Failed to load dependencies output contents from ``/Users/schwa/Desktop/iOS-Framework/sample/DependentApp/build/DependentApp.build/Release-iphoneos/DependentApp.build/Objects-normal/armv7/AppDelegate.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “AppDelegate.d” couldn’t be opened because there is no such file." UserInfo=0x7fb7ee209da0 {NSFilePath=/Users/schwa/Desktop/iOS-Framework/sample/DependentApp/build/DependentApp.build/Release-iphoneos/DependentApp.build/Objects-normal/armv7/AppDelegate.d, NSUnderlyingError=0x7fb7ebef6b90 "The operation couldn’t be completed. No such file or directory"}. User info: {
NSFilePath = "/Users/schwa/Desktop/iOS-Framework/sample/DependentApp/build/DependentApp.build/Release-iphoneos/DependentApp.build/Objects-normal/armv7/AppDelegate.d";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 "The operation couldn\U2019t be completed. No such file or directory"";
}.

@jerryhjones
Copy link

It's worth pointing out that Xcode these days is never building with targets, always schemes, even when you are using an xcodeproj file, it's using the scheme inside.

I haven't figured out why, but it seems that the workspace/scheme combo is resolving the search paths for the resulting framework/headers with no issues, the straight up target build does not.

xcodebuild still uses a project/target model if you give it no arguments. If the ultimate plan is to convince this to build from the command line, go modern and tell it to use the workspace. This goes off without a hitch:
xcodebuild -workspace DependentApp.xcodeproj/project.xcworkspace -scheme DependentApp

@jerryhjones
Copy link

Ok, I spent a little more time trying to understand why the project/target build flow is broken, and it's like I thought, it's just a search path issue.

One of the annoying things about the old target build flow is that each subproject ends up creating its own build directory at its source root. When DependentApp builds the Serenity project, the resulting framework ends up sample/Serenity/build. We're really just talking about letting the compiler know about headers.

The following does work:
xcodebuild FRAMEWORK_SEARCH_PATHS="../Serenity/build/Release-iphoneos/"

Unfortunately, things start to get a bit hairy here. We technically want to use a search path like ${SRCROOT}/../Serenity/build/${CONFIGURATION}-${PLATFORM_NAME}/. If the framework search paths were set in a build configuration, these environment values would resolve. Command builds require a bit more hoop jumping.

Suddenly, you start to see all the reasons why workspaces are generally more awesome than the old way.

@schwa
Copy link
Author

schwa commented Dec 20, 2013

How much do I owe you?

Awesome stuff. Nice work.

@sahil912
Copy link

sahil912 commented Apr 5, 2014

Hey jerry,

I am using
xcodebuild -project ${WORKSPACE}/sample.xcodeproj -scheme dependentapp
and i also clean build everytime i run this, but still i am facing this problem.

Pleas help. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants