# Bug: Compiler gets stuck on Release build

**URL:** <https://forums.swift.org/t/bug-compiler-gets-stuck-on-release-build/76244>\
**Category:** Compiler\
**Tags:** bug, swiftpm\
**Created:** [November 27, 2024, 2:29pm UTC](https://forums.swift.org/t/bug-compiler-gets-stuck-on-release-build/76244 "2024-11-27T14:29:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christoph](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/christoph/32/3805_2.png) [@Christoph](https://forums.swift.org/u/Christoph)\
**Post date:** [November 27, 2024, 2:29pm UTC](https://forums.swift.org/t/bug-compiler-gets-stuck-on-release-build/76244/1 "2024-11-27T14:29:46Z")

</div>

Hi,

I have a weird bug with Swift 6.0.2 and XCode 16.1. I have a package that compiles well a Debug build, but a Release build never finishes.  
It does compile with the flag -no-whole-module-optimization in Terminal  
`swift build -c release -Xswiftc -no-whole-module-optimization`  
But with that flag if I compile the full project and not just the package I get an error that dependencies are missing.  
My Package is mostly generated code as it represents the data of an XML file. I split the package up to isolate the problem. The problem that is causing the compiler to stall is simply files that give a compliance to a few protocols (to allow me to represent the structs content on screen).  
The weirdest thing to me is, I have multiple packages that are generated with the same generator and only this one is causing a problem It is the one with the most structures, but it's still just 116.  
You can download the package here: [https://www.TheKeptPromise.com/Packages/CompileProblem.zip](https://www.TheKeptPromise.com/Packages/CompileProblem.zip)  
`swift build -c release`  
does hang for me.

I hope you can instantly reproduce the bug and with a little luck it's easy to fix.

All the best  
Christoph

---

<div class="post-metadata">

**Author:** ![al45tair](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/al45tair/32/17985_2.png) [@al45tair](https://forums.swift.org/u/al45tair)\
**Post date:** [November 27, 2024, 2:56pm UTC](https://forums.swift.org/t/bug-compiler-gets-stuck-on-release-build/76244/2 "2024-11-27T14:56:16Z")

</div>

Please can you [file a Github Issue](https://github.com/swiftlang/swift/issues); talking about problems here is fine, but without filing an actual bug report we risk losing track of it.
