feat(usable): package gui-host validation snapshot
Some checks failed
release-smoke / macos-13 / x86_64-apple-darwin (push) Has been cancelled
release-smoke / ubuntu-latest / x86_64-unknown-linux-gnu (push) Has been cancelled
release-smoke / windows-latest / x86_64-pc-windows-msvc (push) Has been cancelled

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Paperclip CTO
2026-03-31 10:21:36 +00:00
parent 19aeb7784b
commit a28dab4cd9
47 changed files with 6894 additions and 771 deletions

View File

@@ -8,20 +8,53 @@ cargo test
cargo run -p dbtool-cli -- --help
```
TUI 开发验证补充:
```bash
cargo build -p dbtool-tui
scripts/tui/smoke-tty.sh ./target/debug/dbtool-tui
scripts/tui/smoke-tty.sh ./target/debug/dbtool-tui 20 90 /tmp/dbtool-tui-small.log
```
`dbtool-tui` 需要 TTY不要用 `cargo run -p dbtool-tui -- --help` 替代交互 smoke。详细口径见 `TUI_SMOKE_RUNBOOK.md`
Git 仓库、branch、commit、push 与 agent 认证规范见 `GIT_WORKFLOW.md`
如果当前 Linux 环境没有 `cc`,改用一个 C 兼容 linker例如 `zig cc`
如果当前 Linux 环境没有 `cc` / `ar`,改用 `zig cc` + `zig ar`。对 bundled SQLite 路径linker 包装器需要兼容 Cargo 传入的 GNU target flag
```bash
cat > /tmp/zig-cc <<'EOF'
#!/bin/sh
exec zig cc "$@"
#!/usr/bin/env bash
set -euo pipefail
args=()
for arg in "$@"; do
case "$arg" in
--target=x86_64-unknown-linux-gnu)
args+=("--target=x86_64-linux-gnu")
;;
*)
args+=("$arg")
;;
esac
done
exec zig cc "${args[@]}"
EOF
chmod +x /tmp/zig-cc
cat > /tmp/zig-ar <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
exec zig ar "$@"
EOF
chmod +x /tmp/zig-cc /tmp/zig-ar
export CC=/tmp/zig-cc
export AR=/tmp/zig-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/tmp/zig-cc
cargo test
cargo run -p dbtool-cli -- --help
# 如果当前环境的 rustup 没有默认 toolchain可显式指定 stable 工具链
export RUSTC="$(rustup which --toolchain stable rustc)"
export RUSTDOC="$(rustup which --toolchain stable rustdoc)"
"$(dirname "$RUSTC")/cargo" test --workspace
"$(dirname "$RUSTC")/cargo" build --release --bin dbtool
./target/release/dbtool --help
```
## 当前 crate 责任
@@ -54,7 +87,7 @@ cargo run -p dbtool-cli -- --help
- `cargo run -p dbtool-cli -- query ... --file <sql>` 验证 SQL 文件读取入口
- `cargo run -p dbtool-cli -- export ... --format <csv|json> --output <path>` 验证导出路径
- `./examples/scripts/bootstrap-sqlite.sh` + SQLite CLI happy path 验证本地样例数据库闭环
- 无系统 linker 的 Linux 环境使用 `zig cc` 作为 host linker 验证路径
- 无系统 linker 的 Linux 环境使用兼容 Cargo target flag 的 `zig cc` 包装器与 `zig ar` 验证路径
## 发布 smoke