tmandry / Swindler

macOS window management library for Swift
https://tmandry.github.io/Swindler/docs/main/
MIT License
695 stars 66 forks source link

Segmentation fault when building in Xcode 7.3.1 #4

Closed heptal closed 7 years ago

heptal commented 8 years ago

AXSwift build fines but Swindler fails: Command failed due to signal: Segmentation fault: 11

CompileSwift normal x86_64 /Users/michael/src/Swindler/Swindler/Successes+PromiseKit.swift
    cd /Users/michael/src/Swindler
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/michael/src/Swindler/Swindler/AXPropertyDelegate.swift /Users/michael/src/Swindler/Swindler/Window.swift /Users/michael/src/Swindler/Swindler/Log.swift /Users/michael/src/Swindler/Swindler/AXSwiftProtocols.swift /Users/michael/src/Swindler/Swindler/Property.swift /Users/michael/src/Swindler/Swindler/Screen.swift -primary-file /Users/michael/src/Swindler/Swindler/Successes+PromiseKit.swift /Users/michael/src/Swindler/Swindler/Errors.swift /Users/michael/src/Swindler/Swindler/State.swift /Users/michael/src/Swindler/Swindler/Events.swift /Users/michael/src/Swindler/Swindler/Application.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Products/Debug -I /Users/michael/src/Swindler/Swindler -F /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Products/Debug -enable-testing -g -import-underlying-module -module-cache-path /Users/michael/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -D COCOAPODS -D SWINDLER_DEBUG -serialize-debugging-options -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Swindler-generated-files.hmap -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Swindler-own-target-headers.hmap -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Swindler-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Swindler-project-headers.hmap -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Products/Debug/include -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/DerivedSources/x86_64 -Xcc -I/Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -working-directory/Users/michael/src/Swindler -emit-module-doc-path /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit~partial.swiftdoc -Onone -module-name Swindler -emit-module-path /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit~partial.swiftmodule -serialize-diagnostics-path /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit.dia -emit-dependencies-path /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit.d -emit-reference-dependencies-path /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit.swiftdeps -o /Users/michael/Library/Developer/Xcode/DerivedData/Swindler-gzxauzymqixryzcamosildqhpuio/Build/Intermediates/Swindler.build/Debug/Swindler.build/Objects-normal/x86_64/Successes+PromiseKit.o

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1:8: error: redefinition of module 'Compression'
module Compression [system] [extern_c] {
       ^
/usr/include/module.modulemap:1:8: note: previously defined here
module Compression [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:6:8: error: redefinition of module 'Darwin'
module Darwin [system] [extern_c] {
       ^
/usr/include/module.modulemap:6:8: note: previously defined here
module Darwin [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1599:8: error: redefinition of module 'os'
module os [system] [extern_c] {
       ^
/usr/include/module.modulemap:1599:8: note: previously defined here
module os [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1615:8: error: redefinition of module 'libkern'
module libkern [system] [extern_c] {
       ^
/usr/include/module.modulemap:1615:8: note: previously defined here
module libkern [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1640:8: error: redefinition of module 'ldap'
module ldap [system] [extern_c] {
       ^
/usr/include/module.modulemap:1640:8: note: previously defined here
module ldap [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1673:8: error: redefinition of module 'krb5'
module krb5 [system] [extern_c] {
       ^
/usr/include/module.modulemap:1673:8: note: previously defined here
module krb5 [system] [extern_c] {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/module.modulemap:1700:8: error: redefinition of module 'XPC'
module XPC [system] [extern_c] {
       ^
/usr/include/module.modulemap:1700:8: note: previously defined here
module XPC [system] [extern_c] {
       ^
0  swift                    0x000000010957c66b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x000000010957b956 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x000000010957cccf SignalHandler(int) + 287
3  libsystem_platform.dylib 0x00007fff9ba3752a _sigtramp + 26
4  libsystem_platform.dylib 0x00007000008002c0 _sigtramp + 1692175792
5  swift                    0x0000000107d4c5f6 clang::Preprocessor::MacroState::getModuleInfo(clang::Preprocessor&, clang::IdentifierInfo const*) const + 198
6  swift                    0x0000000107d4bfe6 clang::Preprocessor::getMacroDefinition(clang::IdentifierInfo const*) + 326
7  swift                    0x00000001086e18ca clang::Preprocessor::HandleIdentifier(clang::Token&) + 298
8  swift                    0x0000000108686b26 clang::Lexer::LexIdentifier(clang::Token&, char const*) + 262
9  swift                    0x000000010868dc08 clang::Lexer::LexTokenInternal(clang::Token&, bool) + 7864
10 swift                    0x00000001086e1f14 clang::Preprocessor::Lex(clang::Token&) + 68
11 swift                    0x00000001086b1ec7 clang::Preprocessor::ReadMacroName(clang::Token&, clang::MacroUse, bool*) + 55
12 swift                    0x00000001086b8516 clang::Preprocessor::HandleDefineDirective(clang::Token&, bool) + 54
13 swift                    0x00000001086b4362 clang::Preprocessor::HandleDirective(clang::Token&) + 1778
14 swift                    0x000000010868e6f1 clang::Lexer::LexTokenInternal(clang::Token&, bool) + 10657
15 swift                    0x00000001086e1f14 clang::Preprocessor::Lex(clang::Token&) + 68
16 swift                    0x0000000107fb5088 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 232
17 swift                    0x0000000107f35c75 clang::ParseAST(clang::Sema&, bool, bool) + 501
18 swift                    0x0000000107d75550 clang::FrontendAction::Execute() + 64
19 swift                    0x0000000107d42242 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 930
20 swift                    0x000000010951c5a0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 272
21 swift                    0x000000010951c6f0 RunSafelyOnThread_Dispatch(void*) + 48
22 swift                    0x000000010957d97d ExecuteOnThread_Dispatch(void*) + 13
23 libsystem_pthread.dylib  0x00007fff927b799d _pthread_body + 131
24 libsystem_pthread.dylib  0x00007fff927b791a _pthread_body + 0
25 libsystem_pthread.dylib  0x00007fff927b5351 thread_start + 13
Stack dump:
0.  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/_symbol_aliasing.h:35:2: current parser token 'define'```
heptal commented 8 years ago

Deleting modulemap files in the Pods directory allowed me to build after making a couple small adjustments for the new Swift syntax.

tmandry commented 8 years ago

Okay; a pull request is welcome!

BalintDezso commented 8 years ago

I do not have a modulemap in my Pods folder and still have trouble getting this to compile. Any suggestions?

flocked commented 8 years ago

Any news on it or could you heptal please explain how you solved it? Deleting the modulemap files just gives me the compiling error "missing module.map"

Edit: I tried to compile it with Xcode 7.2. Installed the pod & compiled, but If I try to integrate the framework in my project it says: dyld: Library not loaded: @rpath/PromiseKit.framework/Versions/A/PromiseKit I get a PromiseKit related error also if I try to compile the SwindlerExample: "ld: framework not found PromiseKit for architecture x86_64" Any idea what I am doing wrong? Thanks!