Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/android-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
OPENLESS_RELEASE_CHANNEL: ${{ (endsWith(github.ref_name, '-beta-tauri') || contains(github.ref_name, '-Beta.')) && 'beta' || 'stable' }}
steps:
- uses: actions/checkout@v4
# vendor/qwen-asr 仅 macOS 上 build.rs 会编译;Android APK 构建完全不需要
# 子模块,去掉递归拉取省一次网络 fetch + 失败点。
with:
# Android 不使用本地 Qwen3/Whisper C 子模块。
submodules: false

- name: Disable macOS-only Qwen3 MLX dependency
run: node openless-all/app/scripts/ci-disable-macos-qwen3.mjs


- name: Detect build mode
id: mode
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
working-directory: openless-all/app
steps:
- uses: actions/checkout@v4
with:
# Android 不使用任何桌面本地 ASR 子模块;macOS MLX 依赖不进入此任务。
submodules: false

# vendor/qwen-asr 仅 macOS 上 build.rs 会编译(build.rs:49 build_qwen_asr_macos);
# Android/Linux 的 cargo check 不需要,去掉递归拉取省一次网络 fetch + 失败点。
- name: Setup Android SDK + NDK
Expand Down Expand Up @@ -96,6 +100,9 @@ jobs:
- name: Check Android updater pubkey matches tauri.conf.json
run: npm run check:android-updater-pubkey

- name: Disable macOS-only Qwen3 MLX dependency
run: node scripts/ci-disable-macos-qwen3.mjs

- name: Check Tauri backend (Android target)
run: cargo check --manifest-path src-tauri/Cargo.toml --target aarch64-linux-android

Expand Down Expand Up @@ -178,11 +185,17 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
# vendor/qwen-asr 仅 macOS 上 build.rs 会编译(build.rs:49 build_qwen_asr_macos)。
# Windows/Linux 的 cargo check 不需要子模块;用矩阵条件避免非 macOS job
# 多拉一次 git submodule(省网络 fetch + 去掉一个失败点)。
# 只在 macOS 初始化 MLX 子模块;Linux 的 C 后端单独初始化 qwen-asr。
submodules: ${{ matrix.os == 'macos-latest' && 'recursive' || 'false' }}

- name: Initialize Linux C ASR submodule
if: runner.os == 'Linux'
shell: bash
run: git submodule update --init src-tauri/vendor/qwen-asr
- name: Disable macOS-only Qwen3 MLX dependency
if: runner.os != 'macOS'
run: node scripts/ci-disable-macos-qwen3.mjs

- uses: actions/setup-node@v4
with:
node-version: "22"
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
# MLX 子模块只在 macOS 发布构建需要;Linux 的 C 后端单独初始化 qwen-asr。
submodules: ${{ startsWith(matrix.platform, 'macos') && 'recursive' || 'false' }}

- name: Initialize Linux C ASR submodule
if: matrix.platform == 'ubuntu-22.04'
shell: bash
run: git submodule update --init openless-all/app/src-tauri/vendor/qwen-asr

- name: Disable macOS-only Qwen3 MLX dependency
if: ${{ !startsWith(matrix.platform, 'macos') }}
run: node openless-all/app/scripts/ci-disable-macos-qwen3.mjs
# vendor/qwen-asr 仅 macOS 上 build.rs 会编译(build.rs:49 build_qwen_asr_macos);
# Windows/Linux 的 cargo build 不需要子模块,去掉非 macOS job 的递归拉取。
submodules: ${{ startsWith(matrix.platform, 'macos') && 'recursive' || 'false' }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "openless-all/app/src-tauri/vendor/qwen-asr"]
path = openless-all/app/src-tauri/vendor/qwen-asr
url = https://github.com/Open-Less/qwen-asr.git
[submodule "openless-all/app/src-tauri/vendor/qwen3-asr-rs"]
path = openless-all/app/src-tauri/vendor/qwen3-asr-rs
url = https://github.com/jimersylee/qwen3_asr_rs.git
1 change: 1 addition & 0 deletions openless-all/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"prebuild": "node scripts/android-ipc-import-boundary.test.mjs",
"build": "tsc && vite build",
"preview": "vite preview",
"pretauri": "node scripts/check-macos-metal-toolchain.mjs",
"tauri": "tauri",
"tauri:android:init": "tauri android init",
"tauri:android:dev": "tauri android dev",
Expand Down
27 changes: 27 additions & 0 deletions openless-all/app/scripts/check-macos-metal-toolchain.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { spawnSync } from "node:child_process"

// MLX is only compiled into Apple Silicon builds. Intel macOS uses the C/CPU
// Qwen backend and Whisper, so it must not be blocked by a Metal toolchain check.
if (process.platform !== "darwin" || process.arch !== "arm64") process.exit(0)

const result = spawnSync("xcrun", ["--find", "metal"], {
encoding: "utf8",
})

if (result.status === 0 && result.stdout?.trim()) process.exit(0)

console.error(`
OpenLess 的 Qwen3-ASR MLX 后端需要 Apple MetalToolchain。
当前 Xcode 未找到 Metal 编译器,请先执行:

xcodebuild -downloadComponent MetalToolchain

完成后验证:

xcrun --find metal

然后重新运行:

pnpm tauri dev
`)
process.exit(1)
15 changes: 15 additions & 0 deletions openless-all/app/scripts/ci-disable-macos-qwen3.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { readFileSync, writeFileSync } from "node:fs"
import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"

const appRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..")
const cargoPath = resolve(appRoot, "src-tauri/Cargo.toml")
const cargo = readFileSync(cargoPath, "utf8")
const dependency = /^qwen3-asr-rs\s*=\s*\{[^\n]+\}\r?\n/m

if (!dependency.test(cargo)) {
throw new Error(`未找到 macOS-only qwen3-asr-rs 依赖:${cargoPath}`)
}

writeFileSync(cargoPath, cargo.replace(dependency, ""))
console.log("[ci] disabled macOS-only qwen3-asr-rs dependency for this target")
Loading
Loading