Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make build-capi-headless-ios error #5329

Open
JiaqiSun opened this issue Jan 9, 2025 · 5 comments
Open

make build-capi-headless-ios error #5329

JiaqiSun opened this issue Jan 9, 2025 · 5 comments

Comments

@JiaqiSun
Copy link

JiaqiSun commented Jan 9, 2025


INFORMATION

Host Target: aarch64-apple-darwin.
Enabled Compilers: cranelift, singlepass.
Testing the following compilers & engines:

  • API: cranelift-universal singlepass-universal,
  • C-API: cranelift-universal.
    Cargo features:
  • Compilers: --features cranelift,singlepass,wasmer-artifact-create,static-artifact-create,wasmer-artifact-load,static-artifact-load.
    Rust version: rustc 1.81.0 (eeb90cda1 2024-09-04) (Homebrew).
    NodeJS version: v18.13.0.

RULE EXECUTION

RUSTFLAGS=" -C panic=abort" cargo lipo --manifest-path lib/c-api/Cargo.toml --release
--no-default-features --features compiler-headless,wasi,webc_runner --target-dir target//headless
error: Found argument '--target-dir' which wasn't expected, or isn't valid in this context
Did you mean --targets?

USAGE:
cargo lipo --features --manifest-path --no-default-features --release --targets <TARGET1,TARGET2>...

For more information try --help
make: *** [build-capi-headless-ios] Error 1

@xdoardo
Copy link
Contributor

xdoardo commented Jan 9, 2025

Hello! Thanks for reporting. Yep, I can confirm this error. Do you want to work on it? We'll be glad to review a PR; if not, we can take this, but we'll need to see how it fits in with current priorities.

@JiaqiSun
Copy link
Author

JiaqiSun commented Jan 9, 2025

well,I am trying to solve this problem and would like to seek your advice. Specifically, I noticed that version 5.0 already supports iOS and I need to use WebAssembly (WASM) within an iOS project. However, I have been unable to find relevant documentation。Could you please provide any suggestions or point me toward useful resources?

@xdoardo
Copy link
Contributor

xdoardo commented Jan 9, 2025

Currently, the support for iOS is still experimental. In the 5.0 release we added support for backends that are (or use) an interpreter to execute Wasm code; accompanying this release we also added - and here is the experimental bit - a wasmer-swift library that can be used to embed the wasmer library in an XCode project, thanks to the wamr backend.

In short, cargo build --package=wasmer-swift --target=aarch64-apple-ios-sim --release should produce a libwasmer_swift.a; at the same time, the wasmer_swiftFFI.modulemap and wasmer_swift.h files should be generated (automatically, during the build step) by uniffi. These can then be used to embed your library in an XCode project.

By the way, I will keep this issue open because that make command should work as expected with the new backends. If you need more help, feel free to pop in our discord server or open a discussion here in GitHub.

@JiaqiSun
Copy link
Author

JiaqiSun commented Jan 9, 2025

I couldn’t find the wasmer_swiftFFI.modulemap and wasmer_swift.h files, even though running cargo build --package=wasmer-swift --target=aarch64-apple-ios-sim --release was supposed to generate them automatically during the build step via uniffi.

@xdoardo
Copy link
Contributor

xdoardo commented Jan 17, 2025

I think we can work out a solution using these docs: https://mozilla.github.io/uniffi-rs/latest/tutorial/foreign_language_bindings.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants