From 90c75c1a5cbf088c9859a5774cb45b4959699a0e Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Thu, 3 Sep 2026 18:04:32 +0200 Subject: [PATCH] Build the refreshed surface against the prefix the same run just installed `functions/cgo.go` says `#cgo pkg-config: meos`, so cgo resolves whichever meos.pc the default search path answers with. The recipe set CGO_CFLAGS and no PKG_CONFIG_PATH, so on any machine carrying an older /usr/local install that stale meos.pc wins -- and it publishes an include path with none of the -D=1 defines the fresh one carries. Each family declaration then stays behind its `#if` and the build fails naming a symbol the installed header does declare: functions/meos_meos.go:956:2: could not determine kind of name for C.meos_initialize_pointcloud functions/meos_meos.go:556:11: could not determine kind of name for C.rtree_create_tpcbox which reads as a libmeos built without the family rather than as an environment that never named the family at all. So the documented one-command refresh cannot build the package it has just generated. CI escapes it only because it installs libmeos INTO /usr/local, where the default pkg-config path finds the fresh one. Naming PKG_CONFIG_PATH makes the build read the prefix this run installed. MEASURED: pkg-config then reads `.meos-chain/prefix/lib/pkgconfig/meos.pc` rather than `/usr/local/lib/pkgconfig/meos.pc`, and publishes 11 family defines against 0; all 13 meos headers the preamble includes resolve inside that prefix; `go build ./functions` and `go test ./tools/parity/` both exit 0 where the build previously failed. CGO_CFLAGS goes away because the same meos.pc supplies the include path and cgo.go's own `#cgo linux CFLAGS` supplies the h3 one. --- tools/refresh.conf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/refresh.conf b/tools/refresh.conf index 98f709f..a653b03 100644 --- a/tools/refresh.conf +++ b/tools/refresh.conf @@ -3,10 +3,18 @@ # BUILD_CMD runs from / with $PREFIX (the libmeos install prefix) and $CATALOG # exported; $SKIP_TESTS is set when --skip-tests is passed. tools/codegen.py reads the catalog # staged at CATALOG_DEST and regenerates the committed functions/ package. +# +# PKG_CONFIG_PATH names the prefix this run just built. functions/cgo.go says +# `#cgo pkg-config: meos`, so cgo resolves whichever meos.pc the default search path answers +# with -- an older install under /usr/local otherwise wins, and it publishes none of the +# -D=1 defines the fresh meos.pc carries. Each declaration then stays behind its +# `#if` and the build fails naming a symbol the header does declare. The include path comes +# from the same meos.pc, and the h3 one from cgo.go's own `#cgo linux CFLAGS`, so no +# CGO_CFLAGS is needed here. ENGINE=go BUILD_DIR=. BUILD_LIBMEOS=true CATALOG_DEST=tools/meos-idl.json BUILD_CMD='python3 tools/codegen.py - CGO_CFLAGS="-I$PREFIX/include -I/usr/include/h3" CGO_LDFLAGS="-L$PREFIX/lib -lmeos" LD_LIBRARY_PATH="$PREFIX/lib" go build ./functions + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" CGO_LDFLAGS="-L$PREFIX/lib -lmeos" LD_LIBRARY_PATH="$PREFIX/lib" go build ./functions [ -n "${SKIP_TESTS:-}" ] || CGO_ENABLED=0 go test ./tools/parity/'