pointfreeco / swift-custom-dump

A collection of tools for debugging, diffing, and testing your application's data structures.
MIT License
800 stars 89 forks source link

Swift crash when building on Xcode 15.3 RC #107

Closed cameroncooke closed 8 months ago

cameroncooke commented 8 months ago

Describe the bug Swift-Custom-Dump fails to build for Archive on Xcode 15.3 RC (latest version on Xcode Cloud though not publically available at time of writing 🤔, also crashed on beta 3)

To Reproduce Open the attached project in Xcode 15.3 and build for Archive. test.zip

Expected behavior Not crash 😉

Environment

Additional context Build log output:

Crash is when building the swift-custom-dump package.

Attribute 'noalias' applied to incompatible type!
  %12 = call noalias i64 @swift_allocObject(ptr %9, i64 %11, i64 7) #2, !dbg !2865
Invalid bitcast
  %13 = bitcast i64 %12 to ptr, !dbg !2865
Attribute 'noalias' applied to incompatible type!
  %12 = call noalias i64 @swift_allocObject(ptr %9, i64 %11, i64 7) #2, !dbg !2921
Invalid bitcast
  %13 = bitcast i64 %12 to ptr, !dbg !2921
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
Rename failed: /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/CoreLocation-c0f50386.o.tmp -> /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/CoreLocation.o: No such file or directory
Rename failed: /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/Speech-093762a4.o.tmp -> /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/Speech.o: No such file or directory
Rename failed: /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/Photos-3e8ea971.o.tmp -> /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/Photos.o: No such file or directory
Rename failed: /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/StoreKit-9f8e386a.o.tmp -> /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/StoreKit.o: No such file or directory
Rename failed: /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/CoreMotion-9e96eb64.o.tmp -> /Users/someuser/app/Build/Intermediates.noindex/ArchiveIntermediates/app/IntermediateBuildFilesPath/swift-custom-dump.build/Release-iphoneos/CustomDump.build/Objects-normal/arm64/CoreMotion.o: No such file or directory
0  swift-frontend           0x00000001081b3f3c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x00000001081b30f8 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x00000001081b4544 SignalHandler(int) + 360
3  libsystem_platform.dylib 0x0000000186381a24 _sigtramp + 56
4  libsystem_pthread.dylib  0x0000000186351cc0 pthread_kill + 288
5  libsystem_c.dylib        0x000000018625da40 abort + 180
6  swift-frontend           0x0000000102abd6d8 PrettyStackTraceFrontend::~PrettyStackTraceFrontend() + 0
7  swift-frontend           0x00000001080fca18 llvm::report_fatal_error(llvm::Twine const&, bool) + 280
8  swift-frontend           0x00000001080fc900 llvm::report_fatal_error(llvm::Twine const&, bool) + 0
9  swift-frontend           0x0000000102f904b8 llvm::detail::PassModel<llvm::Module, llvm::VerifierPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::printPipeline(llvm::raw_ostream&, llvm::function_ref<llvm::StringRef (llvm::StringRef)>) + 0
10 swift-frontend           0x0000000107eb3ce8 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 224
11 swift-frontend           0x0000000102f83490 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*, llvm::raw_pwrite_stream*) + 3992
12 swift-frontend           0x0000000102f84bec swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, llvm::vfs::OutputBackend&, swift::UnifiedStatsReporter*) + 2364
13 swift-frontend           0x0000000102f8ce70 (anonymous namespace)::LLVMCodeGenThreads::Thread::run() + 156
14 swift-frontend           0x0000000102f8cdc8 (anonymous namespace)::LLVMCodeGenThreads::runThread(void*) + 12
15 libsystem_pthread.dylib  0x0000000186352034 _pthread_start + 136
16 libsystem_pthread.dylib  0x000000018634ce3c thread_start + 8
Command SwiftCompile failed with a nonzero exit code
cameroncooke commented 8 months ago

What would be the solution if Apple doesn't fix the issue, this will block a lot of people and is extensively used by point-free libraries.

peteralt commented 7 months ago

Could this get made available for older custom dump versions as well? I'm still stuck on pre 1.0 TCA 😢

ThePragmaticArt commented 7 months ago

Re-echo'ing the top where we have a fairly massive project that will eventually move to TCA 1.x. This is simply not possible atm. Given the size of the fix, are there options of performing a retroactive 0.59.1 point release fix with these updates?

mbrandonw commented 7 months ago

@ThePragmaticArt this was released today as 0.11.2 https://github.com/pointfreeco/swift-custom-dump/releases/tag/0.11.2

ThePragmaticArt commented 7 months ago

@ThePragmaticArt this was released today as 0.11.2 https://github.com/pointfreeco/swift-custom-dump/releases/tag/0.11.2

Ah thank you!

I didn't see that. So 0.59.0 should auto bump the Swift Custom Dump dependency based on the package.swift definitions.

peteralt commented 7 months ago

Thank you so much!

mbrandonw commented 7 months ago

TCA 0.59 can auto-bump to custom-dump 0.11.2, but if you want to force it and make sure it never goes back to something lower, you can always add an explicit dependency on swift-custom-dump and constrain to 0.11.2+.