Skip to content

Commit

Permalink
Discover a crazy swift toolchain bug.
Browse files Browse the repository at this point in the history
* It would appear that attempting to use moduleAliases on macOS with
  the vanilla non-xcode swift toolchain, specific to the module aliasing of
  the SwiftUI module; even for a product that is conditionally removed for
  this platform, it causes the compiler to suddenly throw:
  error: failed to build module 'SwiftUI'; this SDK is not supported by the compiler
  ---
  on top of that, it ballooned the build time from what typically takes 29m 11s all
  the way up to 1h 44m 58s before finally erroring!!!!?!!!?!
  • Loading branch information
furby-tm committed Mar 20, 2024
1 parent 9de9cd7 commit 35683cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// swift-tools-version: 5.9
import PackageDescription

#if os(macOS)
let crazyToolChainBug: [String: String]? = nil
#else /* os(macOS) */
let crazyToolChainBug: [String: String]? = ["SwiftCrossUI": "SwiftUI"]
#endif /* !os(macOS) */

let package = Package(
name: "Kraken",
platforms: [
Expand Down Expand Up @@ -66,7 +72,7 @@ let package = Package(
.product(
name: "SwiftCrossUI",
package: "swift-cross-ui",
moduleAliases: ["SwiftCrossUI": "SwiftUI"],
moduleAliases: crazyToolChainBug,
condition: .when(platforms: [.linux, .windows])
),
.product(
Expand Down

0 comments on commit 35683cb

Please sign in to comment.