apple / swift-numerics

Advanced mathematical types and functions for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.0.7 Broke Web Assembly

SDGGiesbrecht opened this issue · comments

I tried to update from 0.0.6 to 0.0.7, but it broke the web assembly build.

In file included from [...]/.build/checkouts/swift-numerics/Sources/_NumericsShims/_NumericsShims.c:19:
[...]/.build/checkouts/swift-numerics/Sources/_NumericsShims/include/_NumericsShims.h:387:42: error: _Float16 is not supported on this target
HEADER_SHIM _Float16 _numerics_muladdf16(_Float16 a, _Float16 b, _Float16 c) {
                                         ^

Not sure if I should make a new issue or not, but I'm getting the same error while building on macOS with the swift 5.2 toolchain.

Thanks, I'll take a look.

Actually, yes, web assembly was just the first platform that my CI got to. All jobs were using Swift 5.2.4 unless otherwise specified:

  • macOS, tvOS, iOS and watchOS succeeded.
  • Windows (5.2.1), web (snapshot circa 5.2.1), CentOS, Ubuntu, Android (5.2.1) and Amazon Linux fail with the error message above.

Full CI logs are here in case there is other context information you want to fish out.

Hi, since this was reported very quickly (thanks!), I simply updated the 0.0.7 tag. It should be resolved now if you get a fresh copy.

I relaunched the CI jobs, you can watch them churn here.

And again after forcing the pins to refresh here. (I’m not sure what SwiftPM actually fetches when Package.resolved contains a version and revision that don’t match.)

Yeah, I expect a few people will have some transient hassles from shifting the tag, but it seemed like the cleaner quick fix.

The web job is now failing at a later point, but that one isn’t really swift-numeric’s fault, I don’t think. The snapshot in use is between 5.2 and 5.3, so I don’t think the #if swift(>=5.3) is doing what it is supposed to. I think the toolchain considers itself 5.3 but doesn’t have Float16 in the standard library yet. From what I can see in FloatingPointTypes.swift.gyb, only Float80 has platform restrictions, so I think the real 5.3 or a newer snapshot ought to actually contain Float16 on WASI.

The other platforms are all passing now, so I’ll close this.

Oh, and thanks for the quick fix!

Yeah, I agree with your take on the web issue. Hopefully that will flush out relatively soon.