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
[SR-8738] Project doesn't compile with Incremental compilation, something about ObjC protocols #51247
Comments
Writing notes as i test things. It seems that I can delete the contents of the file that it throws this issue for compiling and it still gives a compilation error for the file. Also, if i remove the reference from Xcode and re-add it, it still results in the same compile error for that file. Deleting the file and creating a new file with the same name still results in a compilation error. Moving the file's location did not affect whether or not the compilation error occurred for that file. |
I seem to consistently get the same number of files have compilation errors if i delete derived data before building. If I don't delete derived data, that number can change, and sometimes some of those files will compile successfully. None of this makes any sense to me, hopefully it will to someone else 😛 |
That part's just how incremental builds work in Xcode 10. Files are compiled in batches, and in some cases information is emitted to all files in a batch. |
Some possibly related Radars, for Apple people picking this up: rdar://problem/40949298&41430307&43406595 |
Ah, if you download a development snapshot (for master, not 4.2) there should be a bit more info in the build log. https://swift.org/download/#snapshots |
Using that I now get a couple errors. Now it fails with: "Segmentation fault: 11" The stack trace looks like:
(FailingFileContainerViewController is one of our classes) The other error that shows up says: "Command CompileSwift failed with a nonzero exit code". No stack trace though, just the print out of what it ran. Edit: If I comment out the code in that file, when i build they all complains about a different file, and so on. All of these files so far seem to inherit from UIKit objects. (custom uiviewcontrollers, uitableviewcells, uiviews, etc) |
I get this same segmentation fault just by inheriting from a UIKit object in the attatched test project, however that error doesn't occur with the Xcode 10 toolchain, just the snapshot of master, so it may be unrelated. |
Yeah, the indexing thing sounds like a different problem. Maybe try turning off "Enable Index-While-Building Functionality" in your build settings for now? |
I turned off "Enable Index-While-Building Functionality" as you suggested, and using the "Swift Development Snapshot 2018-09-10 (a)" the project successfully compiles. |
This still fails on Xcode 10.1 beta 1 |
@belkadan , do you have any timeline as to when the fix on master could make it into an Xcode? And is there any further investigation you need? |
Well, we don't know what fixed it on master, so if it's going to get into a release sooner than Swift 5 we'd have to track that down. Even then, it might not be a safe change to cherry-pick, but maybe we'd have a workaround, at least. If you have free time, bisecting through master development snapshots to figure out when it was fixed would be helpful. Otherwise one of us will get to it at some point…unless we're close to the Swift 5 release by then. |
(Note: I'm using "Swift 5" to mean "the next release that branches from master". As last spring showed, that might not actually be called "Swift 5".) |
This seems to be fixed in Swift 5, testing with Xcode 10.2 beta 1 |
Attachment: Download
Environment
Macbook Pro (15-inch, 2017)
Xcode 10 GM Seed (happened in previous betas also)
Additional Detail from JIRA
md5: ff400f05e75867ea10fd1cf9909ccc5a
relates to:
Issue Description:
For all of the betas, we have been unable to build our project using Xcode 10. It always results in a compiler crash:
`illegal instruction: 4`
It has a stack trace like:
```
0 swift 0x00000001078a564a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x00000001078a4dfe SignalHandler(int) + 302
2 libsystem_platform.dylib 0x00007fff76a38f5a _sigtramp + 26
3 libsystem_platform.dylib 0x0000000100e4ee2f _sigtramp + 2319539951
4 swift 0x0000000103bd441a swift::irgen::ClangTypeConverter::convert(swift::irgen::IRGenModule&, swift::CanType) + 394
5 swift 0x0000000103bd69ea (anonymous namespace)::GenClangType::visitBoundGenericType(swift::CanTypeWrapper<swift::BoundGenericType>) + 650
6 swift 0x0000000103bd441a swift::irgen::ClangTypeConverter::convert(swift::irgen::IRGenModule&, swift::CanType) + 394
7 swift 0x0000000103ca1348 getObjCEncodingForTypes(swift::irgen::IRGenModule&, swift::SILType, llvm::ArrayRef<swift::SILParameterInfo>, llvm::StringRef, unsigned long long, bool) + 88
8 swift 0x0000000103ca108e getObjCEncodingForMethodType(swift::irgen::IRGenModule&, swift::CanTypeWrapper<swift::SILFunctionType>, bool) + 414
9 swift 0x0000000103ca0d4e swift::irgen::emitObjCMethodDescriptorParts(swift::irgen::IRGenModule&, swift::AbstractFunctionDecl*, bool, bool, llvm::Constant*&, llvm::Constant*&, llvm::Constant*&) + 286
10 swift 0x0000000103bdf275 (anonymous namespace)::ClassDataBuilder::buildMethodList(llvm::ArrayRef<(anonymous namespace)::ClassDataBuilder::MethodDescriptor>, llvm::StringRef) + 949
11 swift 0x0000000103be4536 swift::irgen::emitObjCProtocolData(swift::irgen::IRGenModule&, swift::ProtocolDecl*) + 1766
12 swift 0x0000000103c9fb2f swift::irgen::IRGenModule::emitLazyObjCProtocolDefinitions() + 63
13 swift 0x0000000103d13e45 swift::irgen::IRGenModule::finalize() + 325
14 swift 0x0000000103cf8658 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::_1::unique_ptr<swift::SILModule, std::_1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 1960
15 swift 0x0000000103b38a10 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 46928
16 swift 0x0000000103b29dc5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717
17 swift 0x0000000103acfa35 main + 1349
18 libdyld.dylib 0x00007fff7672a015 start + 1
```
If whole module optimization is turned on, the project seems to compile fine.
Unfortunately I cannot attach my project and have so far been unable to reproduce in a test project.
The text was updated successfully, but these errors were encountered: