swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.74k stars 1.34k forks source link

[SR-14109] Not possible to build cross-platform Swift libraries with optional assembly code #4452

Open Lukasa opened 3 years ago

Lukasa commented 3 years ago
Previous ID SR-14109
Radar rdar://problem/73742495
Original Reporter @Lukasa
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 1 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 01915d10b315e2ff379d4577b7597796

Issue Description:

Derived from SwiftNIO SSL issue #251.

Some Apple platforms require app submission using bitcode, a non-final representation of the binary artefact. Bitcode submissions have a number of constraints that don't apply to binary submission. One of these is that they must not contain any raw assembly code, either as blocks or as complete files. Importantly, the compiler will reject the mere presence of any .s/.S files in the build tree, even if those files are empty and contribute no object data to the build.

SwiftPM supports mixed C/assembly targets, and SwiftNIO SSL uses this support. This mostly works great, unless someone wants to ship a watchOS app using SwiftNIO SSL (a supported platform). Here the mixed C/assembly files cause a fatal build error.

We need a way to exclude assembly files using SwiftPM depending on the deployment target that does not rely on kicking those files out to a separate target.

Lukasa commented 3 years ago

@swift-ci create

swift-ci commented 2 years ago

Comment by David E. Weekly (JIRA)

AFAICT this being unresolved means that watchOS apps can't use gRPC, because the gRPC library requires swift-nio-ssl.

asauray commented 2 years ago

any updates on this issue ?

neonichu commented 2 years ago

I'm guessing this may become irrelevant with the deprecation of bitcode?

Lukasa commented 2 years ago

Yes, that seems likely to me.