apple-m1 - 为 M1 上的所有平台构建 Tauri

标签 apple-m1 tauri

有没有办法在我的 macbook pro m1 上构建 Windows 和 Linux 版本的 Tauri?我已经用 --target 尝试过,但在构建时出现错误。

yarn run v1.22.15
$ tauri build -t x86_64-pc-windows-msvc
   Compiling proc-macro2 v1.0.36
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.86
   Compiling libc v0.2.119
   Compiling cfg-if v1.0.0
   Compiling serde_derive v1.0.136
   Compiling serde v1.0.136
   Compiling ppv-lite86 v0.2.16
   Compiling siphasher v0.3.9
   Compiling getrandom v0.1.16
   Compiling winapi v0.3.9
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-msvc` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-pc-windows-msvc`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Error running CLI: failed to build app: Result of `cargo build` operation was unsuccessful: exit status: 101
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

最佳答案

根据文档,不支持在一台机器上编译所有三个操作系统,但可以通过 VM 或 Github Actions 来完成。

来自docs :

Cross-platform compilation is not supported at this moment. If you want to produce binaries for all three operating systems, you can use Virtual Machines or a CI service like GitHub Actions.

关于apple-m1 - 为 M1 上的所有平台构建 Tauri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71502448/

相关文章:

macos - 为什么 hello world 在 ARM mac 'invalid' 的汇编中?

M1 上的 Julia 1.7.1 在 `Pkg.build()` 上失败

ios - 苹果M1。 React-native 无法为 iOS 模拟器构建

macos - M1 MAC 的 opencv 问题 - OpenCV imshow 不起作用

docker - Mac M1 上的 Apache Airflow 安装问题

rust - 从认证页面返回后是否可以保留全局变量 `window.__TAURI__`?

window-managers - 在 Tauri 中更改任务栏菜单

electron - NeutralinoJS 和 Tauri 后端服务

reactjs - 如何在 Tauri 中使用 window.location?

javascript - 我可以在 Tauri 桌面应用程序中使用 Firebase 或 Supabase 等服务吗?