feat(eliminate-frontend-makefile): task 1.1 - Meson backend CGO test target

Adds a new `test('apiserver backend', ...)` in apiserver/meson.build
reusing the existing apiserver_cgo_deps-derived CGO flags (resolving
their @CURRENT_SOURCE_DIR@/@BUILD_ROOT@ placeholder tokens via
Meson's own .replace(), since this target invokes go_compiler
directly rather than through tools/go_build). Adds timeout: 300
(matching the existing controller test's convention) since a
cold-cache CGO+ASAN build exceeds Meson's 30s default.

Verified cold and warm cache; confirmed CGO_ENABLED=1 selects the
real backend/ CGO path, not the //go:build !cgo stub.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYdtrEWWZfKRRGED7raEYg
This commit is contained in:
Rongsong Shen 2026-09-03 13:17:06 +00:00
parent 5f40c3fb32
commit 6c3ff2012b
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
2 changed files with 35 additions and 1 deletions

View file

@ -1,7 +1,7 @@
# Implementation Plan
- [ ] 1. Core: CGO-backed backend test coverage via Meson
- [ ] 1.1 (P) Add a Meson test target for the apiserver CGO-backed backend suite, reusing the existing CGO flag derivation
- [x] 1.1 (P) Add a Meson test target for the apiserver CGO-backed backend suite, reusing the existing CGO flag derivation
- Resolve the `@CURRENT_SOURCE_DIR@`/`@BUILD_ROOT@` placeholder tokens already present in `apiserver_cgo_deps`'s computed CGO flags at Meson-configure time (they are otherwise only resolved by `tools/go_build`'s own runtime sed machinery, which this new target does not go through)
- Register the target with Meson's test runner (`suite: 'apiserver'`), scoped to the apiserver source directory, depending on `libxce` having already been built
- Set the same offline/hermetic Go environment `tools/go_build` already uses (`GOFLAGS=-mod=vendor`, `GOPROXY=off`) plus an explicit, build-dir-scoped `GOCACHE`/`GOPATH` (this target invokes the Go toolchain directly, not through `go_build`, so it inherits none of `go_build`'s own internal exports)