Skip to content

Commit 7c29000

Browse files
authored
Merge branch 'main' into fix/issue-1171
2 parents 402dd7c + b05a68c commit 7c29000

197 files changed

Lines changed: 1126353 additions & 679560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/_lint.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ permissions:
1010

1111
jobs:
1212
lint:
13-
runs-on: ubuntu-latest
13+
# Pinned, not ubuntu-latest: the LLVM install below adds an
14+
# apt.llvm.org llvm-toolchain-NOBLE repo, which is 24.04 by name. When
15+
# GitHub moves ubuntu-latest to the next LTS this job breaks on a day
16+
# nobody chose. Pin the runner to the release the repo line already names.
17+
runs-on: ubuntu-24.04
1418
# 15 min proved too tight on a slow runner day and a timed-out lint reads
1519
# as "cancelled", which the release graph must treat as a hard stop; keep
1620
# a bound, but one only a genuine hang can hit (normal runtime ~5 min).
@@ -60,7 +64,8 @@ jobs:
6064
# provability (never suppressed — the NOLINT ban applies here too).
6165
# Vendored-tree diagnostics are path-filtered, mirroring .cppcheck.
6266
lint-mem:
63-
runs-on: ubuntu-latest
67+
# Pinned for the same reason as `lint`: llvm-toolchain-noble-21 below.
68+
runs-on: ubuntu-24.04
6469
timeout-minutes: 60
6570
steps:
6671
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/_test.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ jobs:
245245
# parallel suite — catches what an older compiler-rt can miss. Same
246246
# canonical scripts/test.sh wave as every other leg.
247247
test-diag:
248-
runs-on: ubuntu-latest
248+
# Pinned for the same reason as the lint jobs: the pinned diagnostic
249+
# toolchain below installs from llvm-toolchain-noble-21.
250+
runs-on: ubuntu-24.04
249251
timeout-minutes: 120
250252
steps:
251253
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/release.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,20 @@ jobs:
236236
- name: Generate SBOM
237237
run: python3 scripts/ci/generate-sbom.py "${{ inputs.version }}"
238238

239+
# actions/attest-sbom is deprecated. What it does now is emit
240+
# "::warning::actions/attest-sbom has been deprecated" and forward to
241+
# actions/attest with NODE_OPTIONS set, passing sbom-path straight
242+
# through. Calling attest directly produces the same attestation without
243+
# the wrapper, and sbom-path is a first-class input there (verified
244+
# against the action definition at this exact SHA, which is tag v4.1.0).
245+
#
246+
# This step deliberately carries no continue-on-error: a release must
247+
# fail if its SBOM cannot be attested. An unattested SBOM is worse than
248+
# an absent one, because the artifact still ships looking complete.
239249
- name: Attest SBOM
240-
uses: actions/attest-sbom@c604332985a26aa8cf1bdc465b92731239ec6b9e # v4.1.0
250+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
251+
env:
252+
NODE_OPTIONS: '--max-http-header-size=32768'
241253
with:
242254
subject-path: '*.tar.gz'
243255
sbom-path: 'sbom.json'

‎Makefile.cbm‎

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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 = \
337338
EXTRACTION_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

632636
TEST_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.
833844
GRAMMAR_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)
835846
GRAMMAR_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)
837848
GRAMMAR_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 $@ $<
974987
endif
975988

@@ -1123,28 +1136,35 @@ TS_RUNTIME_OBJ_PROD = $(BUILD_DIR)/prod_ts_runtime.o
11231136
LSP_OBJ_PROD = $(BUILD_DIR)/prod_lsp_all.o
11241137
PP_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)
11391159
LZ4_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)
11461166
ZSTD_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

11501170
OBJS_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

Comments
 (0)