Files
ops2/.workbuddy/memory/2026-04-01.md
T
2026-04-01 12:09:02 +08:00

22 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-04-01 工作日志
## 修复 SQLite CGO 启动报错 ✅ (11:20)
- **问题**fresh 启动时报 `CGO_ENABLED=0` 导致 go-sqlite3 无法工作
- **原因**fresh 不是通过 run-dev.bat 启动,没有继承 `CGO_ENABLED=1` 环境变量
- **修复**
- 更新 `run-dev.bat`:改为用 fresh 启动,并确保 `set CGO_ENABLED=1` 在 fresh 之前执行
- 更新 `start-dev.bat`:同样加上 `set CGO_ENABLED=1`
- 创建 `runner.conf`fresh 配置文件)
- **正确启动方式**:在 backend/ 目录执行 `.\run-dev.bat`,或 PowerShell 中设置 `$env:CGO_ENABLED="1"``go run .`
- **GCC 问题**:已安装 TDM-GCC v10.3.0
- **Fresh 问题**runner-build.exe 缓存损坏,已清理并改用 `go run .` 启动
## 后端入口迁移:cmd/ops-server/main.go → 根目录 main.go ✅ (11:05)
- 将新架构 `cmd/ops-server/main.go` 内容合并到根目录 `backend/main.go`
- 删除 `cmd/` 目录
- 更新 `run-dev.bat``start-dev.bat` 启动命令从 `go run ./cmd/ops-server/main.go` 改为 `go run .`
- 编译验证通过(0 errors
- 现在直接在 `backend/` 目录下运行 `go run .` 即可启动