caoimhebyrne / localauthentication-rs

A wrapper for LocalAuthentication.framework in Rust
Apache License 2.0
14 stars 2 forks source link

Fails to compile because of swift-rs dependency when building for ios #1

Open Zack-Xb opened 1 year ago

Zack-Xb commented 1 year ago

I am using this crate in the tauri mobile framework to authenticate the users when interacting with the ios keychain via security framework. The problem here I believe lies in the crate dependency swift-rs specifically in the link function in build.rs. This is because the function is trying to build swift-lib from this crate with the swift-package-manager but the swift package manager recognises anything that is darwin as macOS and this cause the swift build to fail if when targeting the ios triple correctly and setting all other flags correctly.

If anyone has any workaround to this issue, or another way to use the localauthentication framework from rust, leave a comment please. Thanks.

caoimhebyrne commented 1 year ago

Hi!

At the moment, I don't have support for iOS. However, that's a good idea. I'll try to add support for iOS.

Zack-Xb commented 1 year ago

I'd be glad to help. I've been trying to get it to work from the side of swift-rs but no luck with the swift-package-manager, I even tried a local version to remove the macOS correlated to darwin and force iOS but still didn't work. Thread here and this is the issue with swift-rs.

Zack-Xb commented 1 year ago

I was thinking of using objective c to handle the local authentication framework and bind that directly to rust using objc crate

doroved commented 11 months ago

I was thinking of using objective c to handle the local authentication framework and bind that directly to rust using objc crate

Did you end up solving the problem?

Zack-Xb commented 11 months ago

@doroved yes take a look at https://github.com/Zack-Xb/tid-rs