sfackler / rust-native-tls

Apache License 2.0
470 stars 195 forks source link

v0.2.9 breaks build on ios #218

Closed ijc closed 2 years ago

ijc commented 2 years ago

I think #209 in v0.2.9 may have broken the build on ios (at least x86_64-apple-ios):

error[E0433]: failed to resolve: use of undeclared crate or module `keychain`
  --> .../native-tls-0.2.9/src/imp/security_framework.rs:94:24
   |
94 |         let keychain = keychain::CreateOptions::new()
   |                        ^^^^^^^^ use of undeclared crate or module `keychain`

error[E0433]: failed to resolve: use of undeclared type `SecItems`
  --> .../native-tls-0.2.9/src/imp/security_framework.rs:98:25
   |
98 |         let mut items = SecItems::default();
   |                         ^^^^^^^^ use of undeclared type `SecItems`

error[E0433]: failed to resolve: use of undeclared type `ImportOptions`
   --> .../native-tls-0.2.9/src/imp/security_framework.rs:100:9
    |
100 |         ImportOptions::new()
    |         ^^^^^^^^^^^^^ use of undeclared type `ImportOptions`

error[E0433]: failed to resolve: use of undeclared type `ImportOptions`
   --> .../native-tls-0.2.9/src/imp/security_framework.rs:106:9
    |
106 |         ImportOptions::new()
    |         ^^^^^^^^^^^^^ use of undeclared type `ImportOptions`

error[E0599]: no function or associated item named `with_certificate` found for struct `SecIdentity` in the current scope
   --> .../native-tls-0.2.9/src/imp/security_framework.rs:116:34
    |
116 |         let ident = SecIdentity::with_certificate(&[keychain], cert)?;
    |                                  ^^^^^^^^^^^^^^^^
    |                                  |
    |                                  function or associated item not found in `SecIdentity`
    |                                  help: there is an associated function with a similar name: `certificate`

AFAICT all of the relevant use statements (from self::security_framework::os::macos::...) are under #[cfg(not(target_os = "ios"))].

Was/is it a macos specific feature or are equivalent imports for ios missing? I guess the former and some more #[cfg(not(target_os = "ios"))] are needed somewhere?

sfackler commented 2 years ago

Ah yeah, looks like we need to flag the feature off from iOS.

sfackler commented 2 years ago

Fixed in 0.2.10

ijc commented 2 years ago

I can confirm that 0.2.10 works for us, many thanks for the fast turnaround!