Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit b1691cf

Browse files
committed
fix: remove sqlx macros to fix AUR build
- Remove sqlx `macros` and `migrate` features to avoid linking system SQLite during proc-macro compilation - Replace compile-time `sqlx::migrate!` with runtime migrations - Add pre-push hook for Cargo.lock sync check
1 parent 08c350b commit b1691cf

7 files changed

Lines changed: 168 additions & 500 deletions

File tree

.githooks/pre-push

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Pre-push hook: Sync Cargo.lock when pushing version tags
4+
# Prevents AUR build failures due to --locked flag
5+
6+
while read local_ref local_sha remote_ref remote_sha; do
7+
if [[ "$local_ref" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
8+
tag_name="${local_ref#refs/tags/}"
9+
echo "Detected version tag: $tag_name"
10+
echo "Checking Cargo.lock sync..."
11+
12+
cargo update --workspace 2>/dev/null
13+
14+
if ! git diff --quiet Cargo.lock 2>/dev/null; then
15+
echo "ERROR: Cargo.lock is out of sync with workspace versions"
16+
echo ""
17+
echo "Run the following commands to fix:"
18+
echo " git tag -d $tag_name"
19+
echo " cargo update --workspace"
20+
echo " git add Cargo.lock"
21+
echo " git commit --amend --no-edit"
22+
echo " git tag $tag_name"
23+
echo " git push origin main --tags"
24+
echo ""
25+
exit 1
26+
fi
27+
28+
echo "Cargo.lock is in sync"
29+
fi
30+
done
31+
32+
exit 0

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
## [Unreleased]
99

10+
## [0.2.3] - 2025-12-06
11+
12+
### Fixed
13+
14+
- 修复 AUR 构建时 sqlx-macros 链接系统 SQLite 导致的编译错误
15+
- 移除 sqlx 的 `macros``migrate` feature 依赖
16+
- 改用运行时迁移替代编译时 `sqlx::migrate!`
17+
1018
## [0.2.2] - 2025-12-06
1119

1220
### Added

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- 项目要求符合UNIX哲学: 只做一件事,并且做好它。简单优于复杂,可组合性强(但要注意保持长期简单)。
2+
- 保持TDD, 确保代码有良好的测试覆盖率。写新代码前先写测试。

0 commit comments

Comments
 (0)