由于信号: abort trap: 6而导致命令失败的错误尚未解决。具体的错误日志如下
2. While running pass #0 SILModuleTransform "SerializeSILPass".
3. While serializing declaration 0x112201f10 (in module 'gali')
4. failed to serialize anything
0 swift 0x00000001087eba13 PrintStackTraceSignalHandler(void*) + 51
1 swift 0x00000001087eb1e6 SignalHandler(int) + 358
2 libsystem_platform.dylib 0x00007fff6d155b1d _sigtramp + 29
3 libsystem_platform.dylib 0x00007ffeeb860ad8 _sigtramp + 2121314264
4 libsystem_c.dylib 0x00007fff6d02ba08 abort + 120
5 swift 0x00000001050ccdba swift::serialization::Serializer::writeDecl(swift::Decl const*) + 68458
6 swift 0x00000001050e342f swift::serialization::Serializer::writeAllDeclsAndTypes() + 62287
7 swift 0x00000001050f03f4 swift::serialization::Serializer::writeAST(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, bool) + 5364
8 swift 0x00000001050fd330 swift::serialization::Serializer::writeToStream(llvm::raw_ostream&, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SILModule const*, swift::SerializationOptions const&) + 6016
9 swift 0x00000001050fec0b bool llvm::function_ref<bool (llvm::raw_pwrite_stream&)>::callback_fn<swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*)::$_8>(long, llvm::raw_pwrite_stream&) + 139
10 swift 0x0000000104405729 swift::withOutputFile(swift::DiagnosticEngine&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>) + 2569
11 swift 0x00000001050fea67 swift::serialize(llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::SerializationOptions const&, swift::SILModule const*) + 311
12 swift 0x00000001044411bb std::__1::__function::__func<performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_12, std::__1::allocator<performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*)::$_12>, void ()>::operator()() + 603
13 swift 0x0000000104be8c61 SerializeSILPass::run() + 49
14 swift 0x0000000104adf129 swift::SILPassManager::execute() + 7305
15 swift 0x000000010473bc0b swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 1563
16 swift 0x0000000104437375 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 33925
17 swift 0x000000010442b6e4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
18 swift 0x00000001043b8be3 main + 1219
19 libdyld.dylib 0x00007fff6cf54405 start + 1
发布于 2019-11-26 12:20:31
我解决了这个问题,将编译模式从增量模式更改为整个模块有助于解决问题,但我也对真正的解决方案感兴趣。
发布于 2019-12-07 00:21:58
我建议查找传递到函数中的任何默认参数,并确保它们不是其他变量-因为Swift5只允许使用行值,但它会尝试编译仍然传递变量的代码。
let default = 5
// 'default' can no longer be passed in
func someFunc(_ x:Int = default) -> Int {
}
// can only be a value
func someFunc(_ x:Int = 5) -> Int {
}
https://stackoverflow.com/questions/59042594
复制相似问题