Skip to content
Merged
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ jobs:
- name: Run subscription authentication tests
run: cargo test --locked -p bitfun-ai-adapters --features subscription-auth subscription_auth

# File watching is backed by a different OS API on every platform
# (ReadDirectoryChangesW / FSEvents / inotify), so watch registration
# regressions surface per-OS. The suite is behind a non-default feature
# and would otherwise never run anywhere.
#
# macOS is excluded: this suite already fails there before any of this
# branch's changes (the debounce/atomic-rename contracts time out under
# FSEvents coalescing), which is worth fixing separately rather than
# blocking unrelated work.
- name: Run file watch contract tests
if: runner.os != 'macOS'
run: cargo test --locked -p bitfun-services-integrations --features file-watch

# Search tools resolve paths and symlinks directly, which also differs
# across platforms. Scoped to the search module: the glob tests in this
# crate fail on Windows independently of this branch (walk-root
# derivation treats separators differently) and need their own fix.
- name: Run search tool tests
run: "cargo test --locked -p tool-runtime search::"

# ── Frontend: build ────────────────────────────────────────────────
frontend-build:
name: Frontend Build
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/desktop-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ jobs:
- os: ubuntu-24.04-arm
name: linux-arm64
target: aarch64-unknown-linux-gnu
# Fat LTO exhausts the hosted ARM runner while linking bitfun-desktop.
build_command: CARGO_PROFILE_RELEASE_LTO=thin pnpm run desktop:build:linux -- --target aarch64-unknown-linux-gnu --bundles deb,rpm,appimage
# Thin LTO is now the workspace-wide [profile.release] default, so
# the previous CARGO_PROFILE_RELEASE_LTO=thin override is gone.
build_command: pnpm run desktop:build:linux -- --target aarch64-unknown-linux-gnu --bundles deb,rpm,appimage
- os: macos-15
name: macos-arm64
target: aarch64-apple-darwin
Expand Down Expand Up @@ -221,9 +222,6 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type-check web UI
run: pnpm run type-check:web

- name: Build desktop app
run: ${{ matrix.platform.build_command }}

Expand Down
12 changes: 12 additions & 0 deletions AGENTS-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ pnpm run desktop:build:nsis:fast # Windows 安装器,release-fast profile

完整脚本列表见 [`package.json`](package.json)。

### 构建逃生口

开发/构建链路以一部分灵活性换取速度,必要时可覆盖:

| 变量 / 参数 | 使用场景 |
| --- | --- |
| `CARGO_PROFILE_DEV_DEBUG=2` | 需要完整调试信息打断点。dev profile 默认 `line-tables-only`(panic 回溯仍带行号,PDB 体积大幅减小)。 |
| `BITFUN_MOBILE_WEB_FORCE_BUILD=1` 或 `node scripts/mobile-web-build.cjs --force` | 源码看起来没变但需要强制重建 mobile-web。当 `src/mobile-web/dist` 新于所有输入时构建会被跳过。 |
| `VITE_USE_POLLING=1` | Vite dev 监听不到文件变化——通常发生在网络盘或 WSL 挂载上。默认使用原生文件事件。 |

`pnpm run build:web` 会并发执行类型检查与 Vite 构建,因此类型错误与打包错误出现的先后顺序不固定;两者的输出都带前缀(`[type-check]` / `[vite-build]`)。

## 全局规则

### 国际化
Expand Down
14 changes: 14 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ pnpm run desktop:build:nsis:fast # Windows installer, release-fast profile

For the full script list, see [`package.json`](package.json).

### Build escape hatches

The dev/build pipeline trades some flexibility for speed. Override when needed:

| Variable / flag | Use when |
| --- | --- |
| `CARGO_PROFILE_DEV_DEBUG=2` | You need full debug info for breakpoints. The dev profile ships `line-tables-only` (panic backtraces keep line numbers, PDBs stay small). |
| `BITFUN_MOBILE_WEB_FORCE_BUILD=1` or `node scripts/mobile-web-build.cjs --force` | mobile-web must rebuild even though its sources look unchanged. The build is skipped when `src/mobile-web/dist` is newer than every input. |
| `VITE_USE_POLLING=1` | The Vite dev watcher misses changes — typically on a network drive or a WSL mount. Native file events are the default. |

`pnpm run build:web` runs the type-check and the Vite build concurrently, so a
type error and a bundling error can surface in either order; both are prefixed
(`[type-check]` / `[vite-build]`) in the output.

## Global rules

### Internationalization
Expand Down
16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,25 @@ tauri-runtime-wry = { git = "https://github.com/tauri-apps/tauri.git", rev = "ce
tauri-utils = { git = "https://github.com/tauri-apps/tauri.git", rev = "ce3860e84b79af0d5ee628b304399499a87328b1" }

[profile.dev]
incremental = true
# Line tables only: keeps panic backtrace line numbers while shrinking PDB/DWARF
# output dramatically, which speeds up the Windows link step the most.
# Need full debug info for a debugger session? Override per-invocation with
# CARGO_PROFILE_DEV_DEBUG=2.
debug = "line-tables-only"

[profile.release]
opt-level = 3
lto = true
# Thin LTO instead of fat LTO: 30-60% faster release codegen/link for ~0-2%
# runtime cost. This was already proven on the Linux aarch64 packaging runner.
# NOTE: needs one packaging regression round across all platforms (medium risk).
lto = "thin"
codegen-units = 1
strip = true
# NOTE: do not set `panic = "abort"` here. Several production paths rely on
# `catch_unwind` to contain third-party panics instead of taking down the app:
# `browser_api::browser_get_url` (known wry bug where WKWebView URL is nil) and
# the relay client's TLS connector construction. Aborting would turn those
# recoverable failures into process crashes.

[profile.release-fast]
inherits = "release"
Expand Down
Loading