@@ -327,6 +327,7 @@ FOUNDATION_SRCS = \
327327 src/foundation/limits.c \
328328 src/foundation/index_policy.c \
329329 src/foundation/subprocess.c \
330+ src/foundation/git_env.c \
330331 src/foundation/sha256.c \
331332 src/foundation/secure_random.c \
332333 src/foundation/macos_acl.c \
@@ -337,6 +338,7 @@ FOUNDATION_SRCS = \
337338EXTRACTION_SRCS = \
338339 $(CBM_DIR)/cbm.c \
339340 $(CBM_DIR)/extract_defs.c \
341+ $(CBM_DIR)/callable_sig.c \
340342 $(CBM_DIR)/extract_calls.c \
341343 $(CBM_DIR)/extract_imports.c \
342344 $(CBM_DIR)/extract_usages.c \
@@ -348,6 +350,7 @@ EXTRACTION_SRCS = \
348350 $(CBM_DIR)/extract_channels.c \
349351 $(CBM_DIR)/extract_k8s.c \
350352 $(CBM_DIR)/extract_dbt.c \
353+ $(CBM_DIR)/sql_values.c \
351354 $(CBM_DIR)/helpers.c \
352355 $(CBM_DIR)/result_compact.c \
353356 $(CBM_DIR)/result_spill.c \
@@ -434,6 +437,7 @@ PIPELINE_SRCS = \
434437 src/pipeline/lsp_surface.c \
435438 src/pipeline/pipeline_delta.c \
436439 src/pipeline/path_alias.c \
440+ src/pipeline/laravel_routing.c \
437441 src/pipeline/registry.c \
438442 src/pipeline/pipeline.c \
439443 src/pipeline/pipeline_incremental.c \
@@ -631,6 +635,7 @@ TEST_FOUNDATION_SRCS = \
631635
632636TEST_EXTRACTION_SRCS = \
633637 tests/test_extraction.c \
638+ tests/test_callable_sig.c \
634639 tests/test_extraction_inheritance.c \
635640 tests/test_extraction_imports.c \
636641 tests/test_parse_coverage.c \
@@ -830,8 +835,14 @@ BUILD_DIR = build/c
830835# ── Object file compilation (grammars need relaxed warnings) ─────
831836
832837# Grammar + tree-sitter runtime: compiled without -Werror (upstream code has warnings)
838+ # $(TEST_SEAM_DEFINE): these prod objects (grammars, ts_runtime, lsp_all) are
839+ # linked into the same binary as the CFLAGS_PROD sources, so both halves must
840+ # agree on the seam switch. lsp_all holds seam code of its own (ts_lsp.c's
841+ # budget probes, any seam counter a resolver defines): without the define a
842+ # TEST_SEAMS=1 binary silently lacks those seams, and a seam symbol that cbm.c
843+ # references fails to link. GRAMMAR_CFLAGS_TEST always carries the define.
833844GRAMMAR_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
834- $(MEMWASTE_VENDOR_CFLAGS)
845+ $(TEST_SEAM_DEFINE) $( MEMWASTE_VENDOR_CFLAGS)
835846GRAMMAR_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
836847 -DCBM_ENABLE_TEST_SEAMS=1 $(SANITIZED_DEFINE) $(SANITIZE)
837848GRAMMAR_CFLAGS_TSAN = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
@@ -939,7 +950,9 @@ $(BUILD_DIR)/sqlite3.o: $(SQLITE3_SRC) | $(BUILD_DIR)
939950$(BUILD_DIR)/tsan_sqlite3.o: $(SQLITE3_SRC) | $(BUILD_DIR)
940951 $(CC) $(SQLITE3_CFLAGS_TEST) $(TSAN_SANITIZE) -c -o $@ $<
941952
942- $(BUILD_DIR)/prod_sqlite3.o: $(SQLITE3_SRC) Makefile.cbm | $(BUILD_DIR)
953+ # .build-config: SQLITE3_CFLAGS carries MEMWASTE_VENDOR_CFLAGS (see the stamp
954+ # under "Production binary").
955+ $(BUILD_DIR)/prod_sqlite3.o: $(SQLITE3_SRC) Makefile.cbm $(BUILD_DIR)/.build-config | $(BUILD_DIR)
943956 $(CC) $(SQLITE3_CFLAGS) -c -o $@ $<
944957
945958# TRE regex (only compiled on Windows — POSIX uses system <regex.h>)
@@ -969,7 +982,7 @@ $(BUILD_DIR)/tre.o: $(TRE_SRC) | $(BUILD_DIR)
969982$(BUILD_DIR)/tsan_tre.o: $(TRE_SRC) | $(BUILD_DIR)
970983 $(CC) $(TRE_CFLAGS) $(TSAN_SANITIZE) -c -o $@ $<
971984
972- $(BUILD_DIR)/prod_tre.o: $(TRE_SRC) | $(BUILD_DIR)
985+ $(BUILD_DIR)/prod_tre.o: $(TRE_SRC) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
973986 $(CC) $(TRE_CFLAGS) -O2 $(MEMWASTE_VENDOR_CFLAGS) -c -o $@ $<
974987endif
975988
@@ -1123,28 +1136,35 @@ TS_RUNTIME_OBJ_PROD = $(BUILD_DIR)/prod_ts_runtime.o
11231136LSP_OBJ_PROD = $(BUILD_DIR)/prod_lsp_all.o
11241137PP_OBJ_PROD = $(BUILD_DIR)/prod_preprocessor.o
11251138
1126- $(BUILD_DIR)/prod_%.o: $(CBM_DIR)/%.c $(GRAMMAR_UNITY_DEPS) | $(BUILD_DIR)
1139+ # Every prod object whose flags carry a BUILD_CONFIG_SIG variable
1140+ # (TEST_SEAM_DEFINE via GRAMMAR_CFLAGS, MEMWASTE_VENDOR_CFLAGS) depends on the
1141+ # $(BUILD_DIR)/.build-config stamp. These objects are compiled once and linked
1142+ # into every later binary, so without the stamp a TEST_SEAMS or MEMWASTE flip
1143+ # relinks the PREVIOUS flavour: a release binary keeps seam code compiled into
1144+ # lsp_all, or a seams binary misses it. prod_mimalloc.o and the unixcoder blob
1145+ # take no config variable and stay off the stamp.
1146+ $(BUILD_DIR)/prod_%.o: $(CBM_DIR)/%.c $(GRAMMAR_UNITY_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11271147 $(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11281148
1129- $(BUILD_DIR)/prod_ts_runtime.o: $(TS_RUNTIME_DEPS) | $(BUILD_DIR)
1149+ $(BUILD_DIR)/prod_ts_runtime.o: $(TS_RUNTIME_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11301150 $(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11311151
1132- $(BUILD_DIR)/prod_lsp_all.o: $(LSP_UNITY_DEPS) | $(BUILD_DIR)
1152+ $(BUILD_DIR)/prod_lsp_all.o: $(LSP_UNITY_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11331153 $(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11341154
1135- $(BUILD_DIR)/prod_preprocessor.o: $(CBM_DIR)/preprocessor.cpp | $(BUILD_DIR)
1155+ $(BUILD_DIR)/prod_preprocessor.o: $(CBM_DIR)/preprocessor.cpp $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11361156 $(CXX) $(CXXFLAGS_PROD) -w -I$(CBM_DIR)/vendored -c -o $@ $<
11371157
11381158# Vendored LZ4 (compiled separately, not unity-built via lz4_store.c)
11391159LZ4_OBJ_PROD = $(BUILD_DIR)/prod_lz4.o $(BUILD_DIR)/prod_lz4hc.o
1140- $(BUILD_DIR)/prod_lz4.o: $(CBM_DIR)/vendored/lz4/lz4.c | $(BUILD_DIR)
1160+ $(BUILD_DIR)/prod_lz4.o: $(CBM_DIR)/vendored/lz4/lz4.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11411161 $(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR) -c -o $@ $<
1142- $(BUILD_DIR)/prod_lz4hc.o: $(CBM_DIR)/vendored/lz4/lz4hc.c | $(BUILD_DIR)
1162+ $(BUILD_DIR)/prod_lz4hc.o: $(CBM_DIR)/vendored/lz4/lz4hc.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11431163 $(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR)/vendored/lz4 -c -o $@ $<
11441164
11451165# Vendored zstd (compiled separately, not unity-built via zstd_store.c)
11461166ZSTD_OBJ_PROD = $(BUILD_DIR)/prod_zstd.o
1147- $(BUILD_DIR)/prod_zstd.o: $(CBM_DIR)/vendored/zstd/zstd.c | $(BUILD_DIR)
1167+ $(BUILD_DIR)/prod_zstd.o: $(CBM_DIR)/vendored/zstd/zstd.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11481168 $(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR)/vendored/zstd -c -o $@ $<
11491169
11501170OBJS_VENDORED_PROD = $(MIMALLOC_OBJ_PROD) $(SQLITE3_OBJ_PROD) $(TRE_OBJ_PROD) $(GRAMMAR_OBJS_PROD) $(TS_RUNTIME_OBJ_PROD) $(LSP_OBJ_PROD) $(PP_OBJ_PROD) $(LZ4_OBJ_PROD) $(ZSTD_OBJ_PROD) $(UNIXCODER_OBJ)
@@ -1160,7 +1180,8 @@ MAIN_SRC = src/main.c
11601180# configuration and it is rewritten only when that content changes, so ordinary
11611181# incremental builds are unaffected. (Single-quoted: the signature may contain
11621182# the escaped quotes of -DCBM_VERSION, which are literal inside '', but must not
1163- # contain a literal single quote.)
1183+ # contain a literal single quote.) The config-flavoured prod objects above
1184+ # depend on the stamp for the same reason as the binary.
11641185# SANITIZE belongs here: it changes the instrumentation compiled into every
11651186# object, so a build that only changes it MUST rebuild. Its absence made
11661187# `scripts/test.sh SANITIZE= ...` -- the documented way to get a plain build
0 commit comments