[DNM] workarounds for regression SR-12831 on master/5.3 since Feb 7th#32484
[DNM] workarounds for regression SR-12831 on master/5.3 since Feb 7th#32484johnno1962 wants to merge 1 commit intoswiftlang:masterfrom
Conversation
…compiling on master/5.3 toolchain.
| bool error = readLegacyTypeInfo(*fs, path); | ||
| if (error) | ||
| llvm::report_fatal_error("Cannot read '" + path + "'"); | ||
| // avoids error: "<unknown>:1:1: Cannot read '/usr/lib/swift/layouts-x86_64.yaml'" |
There was a problem hiding this comment.
The proper way to "work around" these is to ensure that your resource directory is properly formed. If you have built a custom toolchain, you will need to verify that these layout back-compat files are present under My-Custom-Toolchain.xctoolchain/usr/lib/swift.
There was a problem hiding this comment.
Please also note that these paths are subject to VFS remapping, and are sensitive to the -resource-dir flag.
There was a problem hiding this comment.
Your original crash is in Clang. I suspect you are having trouble with the coherency of a generated clang module if the AST reader is unable to parse something. You could try removing the module cache and rebuilding. But turning off huge portions of the deserialization code is not the right answer.
|
Thanks for triaging this @CodaFi, I’ve downloaded the Xcode 12 beta and cannot reproduce this problem. I’ll keep an eye on it and file a radar if it makes it into Xcode 12. Sorry for the noise |
Hi Apple,
OK, so it’s a busy week but I thought I’d file a quick workaround I’ve had to use to get one of my repos johnno1962/SwiftTrace to be able to compile with a toolchain built from master & 5.3 branch. At the moment you get a
Segmentation fault: 11during module merge due to dereferencing a nullptr as detailed in the ticket. I've bisected the various recent downloadable toolchains and this dates back to commits on February 7th and looking at where it crashes it seems to be related to this new functionality cc: @rjmccall.The problem declaration is this which is
@convention(c)but actually a SwiftDecl:If I remove the
@convention(c)it will compile but give an error at runtime. I need to store a pointer to a C function in a static. This has been compiling fine previously.Works around SR-12831.