Skip to content
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

Add documentation about fixing crashes when upgrading to Xcode 7 #239

Closed
gfontenot opened this issue Sep 1, 2015 · 24 comments
Closed

Add documentation about fixing crashes when upgrading to Xcode 7 #239

gfontenot opened this issue Sep 1, 2015 · 24 comments
Milestone

Comments

@gfontenot
Copy link
Member

Creating a project with liftoff and then opening it in Xcode 7 beta 6 is resulting in a crash, for some reason. I'm unclear on if this is our fault (I don't feel like it should be), but maybe we're doing something slightly wrong?

@MrAlek
Copy link

MrAlek commented Sep 1, 2015

Might be CocoaPods. I've never had a CocoaPods project work in Xcode 7 beta 6.

@gfontenot
Copy link
Member Author

I'd bet that it's actually something with our shared dependency: Xcodeproj. Using the --no-cocoapods flag still results in a crash for me.

@gfontenot
Copy link
Member Author

fwiw, this was an "issue" with the Xcode 6 betas as well, and it worked itself out. My hope is that the same will happen here. Projects open fine in Xcode 6 right now.

@marcelofabri
Copy link
Contributor

Is this the exception you're getting?

ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-8181.3/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/TargetSnapshots/XCBuildFileRefDGSnapshot.m:474
Details:  Cannot call addBuildFileRef: when file refs are frozen
Object:   <XCBuildFileRefArrayDGSnapshot: 0x7f88ffbb7190>
Method:   -addBuildFileRef:
Thread:   <NSThread: 0x7f89004053a0>{number = 16, name = (null)}
Hints:   None
Backtrace:
  0  0x0000000110737574 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit)
  1  0x000000010f2ff08a _DVTAssertionHandler (in DVTFoundation)
  2  0x000000010f2ff2a1 _DVTAssertionFailureHandler (in DVTFoundation)
  3  0x0000000117b610b4 -[XCBuildFileRefArrayDGSnapshot addBuildFileRef:] (in DevToolsCore)
  4  0x0000000117b3dadf -[XCBuildPhaseDGSnapshot(DependencyGraphCreation) groupDependencyNode:ifNecessaryForLaterProcessingWithMacroExpansionScope:] (in DevToolsCore)
  5  0x0000000117b51ce4 -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) _processOutputNodes:forRegionVariantName:processedPaths:originalBuildRule:withMacroExpansionScope:] (in DevToolsCore)
  6  0x0000000117b504e7 -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) _computeDependenciesForBuildFileReference:usingBuildRule:withMacroExpansionScope:processedPaths:] (in DevToolsCore)
  7  0x0000000117b5299e -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForBuildFileReference:usingBuildRule:withMacroExpansionScope:] (in DevToolsCore)
  8  0x0000000117b52e4b -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForBuildFileReference:withMacroExpansionScope:] (in DevToolsCore)
  9  0x0000000117b3e514 -[XCBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForAllBuildFileReferencesWithMacroExpansionScope:] (in DevToolsCore)
 10  0x0000000117b55a2f -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForAllBuildFileReferencesWithMacroExpansionScope:] (in DevToolsCore)
 11  0x0000000117b56e15 -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 12  0x0000000117a8d535 -[XCProductTypeSpecification computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 13  0x0000000117b36e80 -[XCNativeTargetDGSnapshot(DependencyGraphCreation) computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 14  0x0000000117a0a2d5 -[PBXTargetBuildContext createDependencyGraphWithTargetDGSnapshot:] (in DevToolsCore)
 15  0x0000000117a264f7 -[PBXTargetBuildContext(DependencyGraphEvents) dg_setTargetSnapshot:] (in DevToolsCore)
 16  0x0000000117a25bbc -[PBXTargetBuildContext(DependencyGraphEvents) processDependencyGraphEvents] (in DevToolsCore)
 17  0x0000000117a851c2 -[XCBlockQueue _processNextBlockInThreadSlotNumber:] (in DevToolsCore)
 18  0x0000000117a85444 -[XCBlockQueue _processBlocksInThreadSlotNumber:] (in DevToolsCore)
 19  0x00007fff924c5084 __NSThread__start__ (in Foundation)
 20  0x00007fff9657a9b1 _pthread_body (in libsystem_pthread.dylib)
 21  0x00007fff9657a92e _pthread_body (in libsystem_pthread.dylib)
 22  0x00007fff96578385 thread_start (in libsystem_pthread.dylib)

@gfontenot
Copy link
Member Author

That's it exactly

@marcelofabri
Copy link
Contributor

I've opened a radar about this. Let's hope it'll be fixed.

BTW, I don't think it's CocoaPods fault, as I was able to open another project using CP on Xcode 7b6.

@ghost
Copy link

ghost commented Sep 5, 2015

I'm getting the same error in my project since Xcode 7b3, I'm not using CocoaPods.

@marcelofabri
Copy link
Contributor

They closed my radar as a duplicate:

Duplicate of 22424448 (Open)

Let's hope tomorrow's GM fix this!

@gfontenot
Copy link
Member Author

Looks like this is still happening in Xcode 7 GM.

I have no idea where to go from here.

@ghost
Copy link

ghost commented Sep 9, 2015

Yep, still crashes.

@gfontenot
Copy link
Member Author

In theory, if we can figure out what's going wrong (and how to fix it), we should be able to add a liftoff repair command. Unfortunately, I don't totally know what's wrong and don't really know where to start debugging. The crash log would imply that we (or more specifically, xcodeproj) are freezing some file refs that Xcode expects to be mutable, but I have no idea how that would be indicated in the XML or what we can do to fix it.

@gfontenot
Copy link
Member Author

interestingly enough the crash does not happen in the 7.1 beta.

this is fun.

@ghost
Copy link

ghost commented Sep 9, 2015

Good news, thanks.

@marcelofabri
Copy link
Contributor

I'm seeing the same thing here, but I'm also clueless.

@mattrubin
Copy link

After experimenting with a new, empty liftoff-generated project:
It has something to do with Main.storyboard and the "Compile Sources" build phase. Remove the storyboard from the build phase and Xcode 7b6 has no trouble opening the project. Re-add the storyboard to the list of files to compile and Xcode crashes almost immediately.

It seems that Xcode is trying to pre-compile or somehow cache the storyboard, and Xcode 7b6 can't handle the storyboard for some reason.

@marcelofabri
Copy link
Contributor

@mattrubin Nice discovery! I've tested this and also worked.

Luckily, there's a pending PR (#238) to fix this. It's probably not hard to create a liftoff repair command.

@gfontenot
Copy link
Member Author

A clue!

So now the question is: is it worth it to create a repair command, especially since this seems to be fixed in 7.1 and we have a (trivial) reproducible workaround?

@jakecraige
Copy link
Contributor

@mattrubin @marcelofabri @gfontenot That PR is now MERGED.

@priteshshah1983
Copy link
Contributor

Are there instructions on how to do a local bleeding-edge build? I'd love to try this fix.

@gfontenot
Copy link
Member Author

so this is already fixed in master, what isn't fixed is providing some kind of repair command to remove and re-add the storyboard (or I guess all storyboards?). I'm still not 100% sure this is something we want to do. Maybe we can write a standalone script to do this?

@priteshshah1983
Copy link
Contributor

Pardon my ignorance, but I wanted to build the binary myself by cloning the master branch. I was hoping you could point me to that.

@gfontenot
Copy link
Member Author

There's no binary, it's just a ruby script. If you pull down master, you can run it through the bin/liftoff script

jakecraige added a commit to thoughtbot/Tropos that referenced this issue Sep 26, 2015
- Required config updates
- Remove redundant Printable protocol
- Fix custom Temperature compare function args
- Move storyboard from Sources into Resources
  More info: liftoffcli/liftoff#239
- Fix naming conflict of `describe` from Quick and Specta
  in TRTemperatureComparisonFormatterSpec.m by using Quick instead
  of Specta.
- Update Pod dependencies
- Update Carthage dependencies
jakecraige added a commit to thoughtbot/Tropos that referenced this issue Sep 26, 2015
- Required config updates
- Remove redundant Printable protocol
- Fix custom Temperature compare function args
- Move storyboard from Sources into Resources
  More info: liftoffcli/liftoff#239
- Fix naming conflict of `describe` from Quick and Specta
  in TRTemperatureComparisonFormatterSpec.m by using Quick instead
  of Specta.
- Update Pod dependencies
- Update Carthage dependencies
- Update CircleCI xcode version
jakecraige added a commit to thoughtbot/Tropos that referenced this issue Sep 26, 2015
- Required config updates
- Remove redundant Printable protocol
- Fix custom Temperature compare function args
- Move storyboard from Sources into Resources
  More info: liftoffcli/liftoff#239
- Fix naming conflict of `describe` from Quick and Specta
  in TRTemperatureComparisonFormatterSpec.m by using Quick instead
  of Specta.
- Update Pod dependencies
- Update Carthage dependencies
- Update CircleCI xcode version
@jakecraige
Copy link
Contributor

I'm definitely learning more towards either a script to do it or simply writing down how to resolve this. It's a very one off thing so adding a whole new command to handle it for this one time seems a bit much.

jakecraige added a commit to thoughtbot/Tropos that referenced this issue Sep 26, 2015
- Required config updates
- Remove redundant Printable protocol
- Fix custom Temperature compare function args
- Move storyboard from Sources into Resources
  More info: liftoffcli/liftoff#239
- Fix naming conflict of `describe` from Quick and Specta
  in TRTemperatureComparisonFormatterSpec.m by using Quick instead
  of Specta.
- Update Pod dependencies
- Update Carthage dependencies
- Update CircleCI xcode version
- Use `bin/test` in Circle since xctool is not working properly with Xcode 7

Make bin/test work again
@gfontenot
Copy link
Member Author

Agreed. I'm changing the title of this issue to reflect the actionable item.

@gfontenot gfontenot added this to the 1.6.0 milestone Sep 26, 2015
@gfontenot gfontenot changed the title Investigate crash when opening project file in Xcode 7 beta 6 Add documentation about fixing crashes when upgrading to Xcode 7 Sep 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants