Skip to content

Support of cdylib crate types on iOS in Rust 1.46 breaks usual build workflows #79373

Closed
@vimmerru

Description

@vimmerru

PR #73516 added support of cdylib crate types on iOS. This new feature in Rust 1.46 added a lot of headache for iOS builds with cdylib targets. cdylib target is near impossible to build on iOS if you are using any crate with native dependencies (ex. openssl, libsodium, zmq). You can't just find .so files for all architectures to perform correct linking and any vendored build paths don't support iOS properly. Usual workflow is the following:

  1. You build staticlib and rely that native dependencies will be linked as frameworks later
  2. You setup right cocoapods in ObjectiveC/Swift wrapper.

As cargo doesn't support platform-dependent crate types rust-lang/cargo#4881 as a result a lot of projects that require iOS support are now broken on Rust 1.46.

Also seems usual iOS tools like cargo lipo don't support crate type overrides for the moment.

It works on 1.45 well because cargo just skips unsupported crate types on iOS and Android.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-iosOperating system: iOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions