Hi... just tried to add Box to a brand new project using Carthage (my cartfile contains `github "robrix/Box" ~> 1.2.0`) and get the following error when I run `carthage update`:
```
clang: error: invalid architecture 'aarch64' for deployment target '-mios-simulator-version-min=8.0'
```
If I manually open and build `Carthage/Checkouts/Box/Box.xcodeproj` in Xcode (6.3, if it matters) it compiles OK. The one difference that I can see between the two compilation commands are that carthage is using `Release-iphoneos`, whereas Xcode uses `Debug-iphonesimulator`.
The full transcript of the carthage build is https://gist.github.com/edwardaux/8a2319844ba00582c0b7
Any thoughts? Thanks.
Interesting. I originally discovered it because my project was was using Carthage to embed [Argo](https://github.com/thoughtbot/Argo), which has its own `Cartfile` that pulls in Box as a sub-dependency. However, after a bit of testing, I discovered that I could reproduce the error just by using Box.
For me, reproducing is literally as simple as the following:
- Create new Swift Project (doesn't matter if iOS or OS X)
- Create a `Cartfile` that contains `github "robrix/Box" ~> 1.2.0`
- Run `carthage update`
Could I trouble you to share your Carthage build log from the above steps? That might help me figure out what is different on my machine.
In case anyone is playing along at home, for reference, I'm using Xcode 6.3 (6D570) and Carthage (0.6.3).
You bet:
```
rob@Resonance ~/D/Foo /master> carthage update
*** Fetching Box
*** Checking out Box at "1.2.0"
*** xcodebuild output can be found in /var/folders/9y/f7n4rvx901nctm_5d16c1wm40000gn/T/carthage-xcodebuild.my0DyZ.log
*** Building scheme "Box-iOS" in Box.xcodeproj
*** Building scheme "Box-Mac" in Box.xcodeproj
```
- [The full contents of `/var/folders/9y/f7n4rvx901nctm_5d16c1wm40000gn/T/carthage-xcodebuild.my0DyZ.log`](https://gist3.github.com/robrix/38d0484ca79502e33d08).
- [The full project](http://cl.ly/1E410a2P181M).
Thanks Rob. Turns out that your Foo project doesn't build on my machine either, so it must be something screwy in my environment.
I think the gist you created with the log must be a private one... as I get a 404 when I access it. Once I get that, hopefully that will give me a clue as to what is wrong with my setup. Thanks.
Thanks @robrix.
FYI, I was doing some more googling and found some other reports of a similar problem in [ReactiveCocoa](https://github.com/ReactiveCocoa/ReactiveCocoa/issues/1882). Their "fix" was to uninstall Xcode 6.3 and re-install it - which I tried, but no luck.
I downloaded the source to Carthage and started poking around to see what arguments they use when they invoke `xcodebuild`. The way I read it, the Carthage script basically boils down to the following (which doesn't work on my, and also one other colleague's, machine):
```
xcodebuild -project Box.xcodeproj -configuration Release -sdk iphonesimulator -scheme Box-iOS
```
By contrast, building by specifying the target works ok:
```
xcodebuild -project Box.xcodeproj -configuration Release -sdk iphonesimulator -target Box-iOS
```
The one thing that jumped to mind in the failing log is that even though the sdk is reporting as `iphonesimulator8.3`, the first few lines of the log have somehow morphed into using `iphoneos`.
```
Build settings from command line:
SDKROOT = iphonesimulator8.3
=== BUILD TARGET Box-iOS OF PROJECT Box WITH CONFIGURATION Release ===
Check dependencies
Write auxiliary files
/bin/mkdir -p /Users/edwardsc/Library/Developer/Xcode/DerivedData/Box-bvdyjxluqbdcwqeoagemfoykznjg/
Build/Intermediates/Box.build/Release-iphoneos/Box-iOS.build/Objects-normal/arm64
write-file /Users/edwardsc/Library/Developer/Xcode/DerivedData/Box-bvdyjxluqbdcwqeoagemfoykznjg/
Build/Intermediates/Box.build/Release-iphoneos/Box-iOS.build/Objects-normal/arm64/Box.LinkFileList
...
```
Weirdly enough, I see the exact same conditions when I tried the same for [Prelude](https://github.com/robrix/Prelude).
No action required on your part... just thought I'd update this issue in case others have a similar problem. Will report more when I get to the bottom of it.
I forgot to mention, I'm seeing the same thing with https://github.com/LlamaKit/LlamaKit, I haven't used this lib specifically.
I did just add it to my project to try though, and it installed successfully. It didn't build though, I'm guessing that's because you have the `.framework` in the release?
If I force master with `github "robrix/Box" "master"`, I get a build error
As it turns out, @robrix, I don't believe that it is specifically related to Box (oh, and to answer your earlier question, scheme and target are mutually exclusive).
When using `-target`, it compiles correctly regardless of the `-sdk` value.
When using `-scheme`, it compiles correctly for the device if I pass `-sdk iphoneos` or nothing at all. If I pass `-sdk iphonesimulator` the compile log says `SDKROOT = iphonesimulator8.3`, the `-isysroot` flag gets set to the simulator SDK path, but for some reason it is using an arm architecture - which causes the compilation error.
Stepping back a little, I created a brand new iOS framework project (and also a static library project) and they both have exactly the same problem. A brand new app, however, does not exhibit the problem.
Based on this, I **think** the problem can correctly framed as:
_Using Xcode 6.3, when compiling iOS static libraries or frameworks, incorrect `xcodebuild` flags are getting set if both `-scheme XXX` and `-sdk iphonesimulator` are passed._
The weird thing is that everything compiles OK in Xcode.
At this stage, it is looking more and more like an `xcodebuild` bug. Apologies Rob for clogging up your Box issue tracker. By copy, @jspahrsummers, while I don't believe it is strictly related to Carthage, I'm curious if you'd seen anything like this in your travels?
Ooh, yes. https://github.com/Carthage/Carthage/issues/417 is on the money. If I pass in `-destination 'platform=iOS Simulator,name=iPhone 4s,OS=latest'` then it builds just fine.
I'll do a bit more digging on the `-destination` flag and see if I can't create a Carthage pull request. I'll also raise a radar against `xcodebuild`.