From c56d06ef0fc02dddef4cfd866013fdf23143b1d6 Mon Sep 17 00:00:00 2001 From: zhongweili Date: Sat, 14 Dec 2024 22:24:32 +0800 Subject: [PATCH] Enhance cross-platform build configurations and dependencies - Modify build configurations to improve cross-platform compatibility for Windows and macOS. - Implement structured release process with enhanced versioning and artifact management. - Integrate ARM64 support and necessary dependencies for Windows in the `ort` crate. --- .github/workflows/build.yml | 9 ++++--- src-tauri/Cargo.lock | 51 ++++++++++++++++++++++++++++++++++--- src-tauri/Cargo.toml | 17 +++++++++++++ 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7890e8..4b6a1b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,10 +67,11 @@ jobs: build: windows os: windows-latest arch: x86_64 - - target: aarch64-pc-windows-msvc - build: windows - os: windows-latest - arch: aarch64 + # Temporarily annotate the ARM64 build + # - target: aarch64-pc-windows-msvc + # build: windows + # os: windows-latest + # arch: aarch64 runs-on: ${{ matrix.os }} steps: diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index b7c4fba..5761265 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2291,9 +2291,10 @@ dependencies = [ "futures-util", "half", "image", - "ndarray", + "ndarray 0.16.1", "num-traits", - "ort", + "ort 1.16.3", + "ort 2.0.0-rc.8", "rayon", "reqwest", "serde", @@ -2816,6 +2817,19 @@ dependencies = [ "tempfile", ] +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", +] + [[package]] name = "ndarray" version = "0.16.1" @@ -3344,6 +3358,25 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "ort" +version = "1.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "889dca4c98efa21b1ba54ddb2bde44fd4920d910f492b618351f839d8428d79d" +dependencies = [ + "flate2", + "lazy_static", + "libc", + "ndarray 0.15.6", + "tar", + "thiserror 1.0.69", + "tracing", + "ureq", + "vswhom", + "winapi", + "zip", +] + [[package]] name = "ort" version = "2.0.0-rc.8" @@ -3351,7 +3384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11826e6118cc42fea0cb2b102f7d006c1bb339cb167f8badb5fb568616438234" dependencies = [ "half", - "ndarray", + "ndarray 0.16.1", "ort-sys", "tracing", ] @@ -7026,6 +7059,18 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] + [[package]] name = "zune-core" version = "0.4.12" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e223046..75fc724 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -50,3 +50,20 @@ chrono = "0.4.38" [package.metadata.cargo-machete] ignored = ["serde_json", "serde", "num-traits", "tauri-plugin-http", "tauri-plugin-shell", "tokio"] + +[target.'cfg(target_os = "windows")'.dependencies] +ort = { version = "1.16.3", features = [ + "download-binaries", + "cuda", +], default-features = false } + +[target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies] +ort = { version = "1.16.3", features = [ + "download-binaries", + "cuda", +], default-features = false } + +[target.'cfg(all(target_os = "windows", target_arch = "aarch64"))'.dependencies] +ort = { version = "1.16.3", features = [ + "download-binaries", +], default-features = false }