apple / swift-algorithms

Commonly used sequence and collection algorithms for Swift
Apache License 2.0
5.92k stars 440 forks source link

swift-numerics trunk just removed the RealModule product, breaking this build #163

Closed finagolfin closed 3 years ago

finagolfin commented 3 years ago

I have a daily CI that cross-compiles this package for Android along with swift-numerics trunk: it broke because of this update today.

Swift Algorithms version: main branch, but only when forced to build against swift-numerics' latest commit. Swift version: 5.4.2 and the latest 5.5 and trunk development snapshots

Checklist

Steps to Reproduce

Check out trunk of this package and swift-numerics and force this package to use that one by replacing the online checkout with .package(path: "../swift-numerics"),.

Expected behavior

Builds as normal.

Actual behavior

error: product 'RealModule' not found in package 'swift-numerics'. it is required by package 'swift-algorithms' target 'Algorithms'.

Also, the current swift-numerics checkout of 0.0.1 that's normally used is two years old, should also update that.

stephentyrone commented 3 years ago

I'll put together a PR that fixes this, unless you want to do so @buttaface.

stephentyrone commented 3 years ago

https://github.com/apple/swift-algorithms/pull/164

finagolfin commented 3 years ago

Turns out building trunk of both packages is still broken, though for a different reason now:

/home/runner/work/swift-android-sdk/swift-android-sdk/sn/Sources/Numerics/Numerics.swift:14:19: error: no such module 'IntegerUtilities'
@_exported import IntegerUtilities

This simple fix to swift-numerics appears to finally make it work on linux:

diff --git a/Package.swift b/Package.swift
index 490f133..bbcc69b 100644
--- a/Package.swift
+++ b/Package.swift
@@ -23,7 +23,7 @@ let package = Package(
     // User-facing modules
     .target(name: "ComplexModule", dependencies: ["RealModule"]),
     .target(name: "IntegerUtilities", dependencies: []),
-    .target(name: "Numerics", dependencies: ["ComplexModule", "RealModule"]),
+    .target(name: "Numerics", dependencies: ["ComplexModule", "IntegerUtilities", "RealModule"]),
     .target(name: "RealModule", dependencies: ["_NumericsShims"]),

     // Implementation details

@stephentyrone, maybe there's a better way to fix it; if not, feel free to use this patch.