CoreStore: Build fails on Xcode 8 / macOS Sierra (both for Swift 2.3 and 3)

When trying to build CoreStore via Carthage (for use in one of my iOS apps) I’m running into this compiler crash:

Stored value type does not match pointer operand type!
  store %C9CoreStore21CSBaseDataTransaction* %23, %C9CoreStore28CSSynchronousDataTransaction** %0, align 8, !dbg !2529
 %C9CoreStore28CSSynchronousDataTransaction*LLVM ERROR: Broken function found, compilation aborted!
2016-10-20 13:46:56.454 xcodebuild[69083:526859]  DVTAssertions: Warning I in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-11246/IDEFoundation/Playgrounds/IDEPlaygroundAuxiliarySourceCompilerOperation.m:386
Details:  Unable to read diagnostics from file "/Users/shirk/Library/Developer/Xcode/DerivedData/CoreStore-dibsnzstxqdaakfnrpbesflgtiep/Build/Intermediates/CoreStore.build/Release/CoreStore OSX.build/Objects-normal/x86_64/CSListMonitor.dia" (Invalid File): Invalid diagnostics signature
Function: void XCGenerateDiagnosticsFromFile(NSString *__strong, NSString *__strong, NSDictionary *__strong, NSDictionary *__strong, IDEActivityLogSectionRecorder *__strong, BOOL (^__strong)(IDEActivityLogMessage *__strong))
Thread:   <NSThread: 0x7fbbc7b16f40>{number = 15, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

Command /Applications/Xcode.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swiftc failed with exit code 1
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal x86_64
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

Looking around the net this seems to be an issue with the swift compiler itself, but one that can be worked around be the code that triggers it.

I know it’s not the fault of CoreStore but as it is I can’t build the framework in any version (master / 2.1.0 / swift_3) and there is no saying when a fixed swift compiler will be included in a new Xcode release.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 32 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you to everyone who helped debug the problem here and over at the slack channel! I turned off whole-module-optimization for the develop and swift3_develop branch. Please try if it works for you (make sure to delete Carthage’s cache)

If the develop branch works fine I’ll merge to the master branch and update the version tags.

@JohnEstropia just confirmed with @netbe (sitting next to me) that on develop (Swift 2.3, Xcode8, ElCapitan 10.11.6) the fix works building with carthage.

@Shirk @pointspy Apologies for the late reply (Asian timezone…)

I’ve tried different configurations on my machine and the only time I’ve seen this error is when the Swift toolchain doesn’t match the CoreStore branch

Your logs both seem to be using the swift3_develop branch so I am assuming your app project satisfies:

  • minimum deployment version of iOS 8.0
  • built with Swift 3

If this is correct, please check that your Xcode->Preferences->Locations->Command Line Tools is set to Xcode 8.0

If you still have problems, please tell your app’s Swift version and minimum deployment version.

I had a similar problem and resolved it by removing whole module optimisation. The error appeared after updating from Swift 3.0 to 3.1

Thank you