Files
BlueArchiveToolkit/internal
nyaKazuhaandClaude Fable 5 962261ba12 fix(ffi): 统一 cgo 链接与 release 构建 profile
internal/ffi/ffi.go 的 cgo LDFLAGS 硬编码 -L target/debug,而 build-rust 用
--release(产物落 target/release),干净环境下 make build/test-go/ci 必然
报 cannot find -lbat_ffi。

- LDFLAGS 指向 target/release,并加 -Wl,-rpath 让产物运行时无需 LD_LIBRARY_PATH
  即可定位 libbat_ffi.so;删除指向不存在目录的无效 CFLAGS -I(C 声明本就内联)。
- 新增 build-ffi target(cargo build --release -p bat-ffi),build-go 与 test-go
  依赖它,确保链接前 release FFI 库已存在。

验证:make build-go 成功产出并可运行 bin/bat;make test-go 链接并通过;
go vet(check-go)通过。

对应 issue #18 维护清单 1-6。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 07:46:37 -07:00
..