Skip to content

Commit 23f1309

Browse files
authored
Merge branch 'main' into feat/ruby-lsp-per-file
2 parents 0f8b719 + cb7d937 commit 23f1309

135 files changed

Lines changed: 609483 additions & 188064 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: 28 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 \
@@ -832,8 +833,14 @@ BUILD_DIR = build/c
832833
# ── Object file compilation (grammars need relaxed warnings) ─────
833834

834835
# Grammar + tree-sitter runtime: compiled without -Werror (upstream code has warnings)
836+
# $(TEST_SEAM_DEFINE): these prod objects (grammars, ts_runtime, lsp_all) are
837+
# linked into the same binary as the CFLAGS_PROD sources, so both halves must
838+
# agree on the seam switch. lsp_all holds seam code of its own (ts_lsp.c's
839+
# budget probes, any seam counter a resolver defines): without the define a
840+
# TEST_SEAMS=1 binary silently lacks those seams, and a seam symbol that cbm.c
841+
# references fails to link. GRAMMAR_CFLAGS_TEST always carries the define.
835842
GRAMMAR_CFLAGS = -std=c11 -D_DEFAULT_SOURCE -O2 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
836-
$(MEMWASTE_VENDOR_CFLAGS)
843+
$(TEST_SEAM_DEFINE) $(MEMWASTE_VENDOR_CFLAGS)
837844
GRAMMAR_CFLAGS_TEST = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
838845
-DCBM_ENABLE_TEST_SEAMS=1 $(SANITIZED_DEFINE) $(SANITIZE)
839846
GRAMMAR_CFLAGS_TSAN = -std=c11 -D_DEFAULT_SOURCE -g -O1 -w -I$(CBM_DIR) -I$(TS_INCLUDE) -I$(TS_SRC) \
@@ -941,7 +948,9 @@ $(BUILD_DIR)/sqlite3.o: $(SQLITE3_SRC) | $(BUILD_DIR)
941948
$(BUILD_DIR)/tsan_sqlite3.o: $(SQLITE3_SRC) | $(BUILD_DIR)
942949
$(CC) $(SQLITE3_CFLAGS_TEST) $(TSAN_SANITIZE) -c -o $@ $<
943950

944-
$(BUILD_DIR)/prod_sqlite3.o: $(SQLITE3_SRC) Makefile.cbm | $(BUILD_DIR)
951+
# .build-config: SQLITE3_CFLAGS carries MEMWASTE_VENDOR_CFLAGS (see the stamp
952+
# under "Production binary").
953+
$(BUILD_DIR)/prod_sqlite3.o: $(SQLITE3_SRC) Makefile.cbm $(BUILD_DIR)/.build-config | $(BUILD_DIR)
945954
$(CC) $(SQLITE3_CFLAGS) -c -o $@ $<
946955

947956
# TRE regex (only compiled on Windows — POSIX uses system <regex.h>)
@@ -971,7 +980,7 @@ $(BUILD_DIR)/tre.o: $(TRE_SRC) | $(BUILD_DIR)
971980
$(BUILD_DIR)/tsan_tre.o: $(TRE_SRC) | $(BUILD_DIR)
972981
$(CC) $(TRE_CFLAGS) $(TSAN_SANITIZE) -c -o $@ $<
973982

974-
$(BUILD_DIR)/prod_tre.o: $(TRE_SRC) | $(BUILD_DIR)
983+
$(BUILD_DIR)/prod_tre.o: $(TRE_SRC) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
975984
$(CC) $(TRE_CFLAGS) -O2 $(MEMWASTE_VENDOR_CFLAGS) -c -o $@ $<
976985
endif
977986

@@ -1125,28 +1134,35 @@ TS_RUNTIME_OBJ_PROD = $(BUILD_DIR)/prod_ts_runtime.o
11251134
LSP_OBJ_PROD = $(BUILD_DIR)/prod_lsp_all.o
11261135
PP_OBJ_PROD = $(BUILD_DIR)/prod_preprocessor.o
11271136

1128-
$(BUILD_DIR)/prod_%.o: $(CBM_DIR)/%.c $(GRAMMAR_UNITY_DEPS) | $(BUILD_DIR)
1137+
# Every prod object whose flags carry a BUILD_CONFIG_SIG variable
1138+
# (TEST_SEAM_DEFINE via GRAMMAR_CFLAGS, MEMWASTE_VENDOR_CFLAGS) depends on the
1139+
# $(BUILD_DIR)/.build-config stamp. These objects are compiled once and linked
1140+
# into every later binary, so without the stamp a TEST_SEAMS or MEMWASTE flip
1141+
# relinks the PREVIOUS flavour: a release binary keeps seam code compiled into
1142+
# lsp_all, or a seams binary misses it. prod_mimalloc.o and the unixcoder blob
1143+
# take no config variable and stay off the stamp.
1144+
$(BUILD_DIR)/prod_%.o: $(CBM_DIR)/%.c $(GRAMMAR_UNITY_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11291145
$(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11301146

1131-
$(BUILD_DIR)/prod_ts_runtime.o: $(TS_RUNTIME_DEPS) | $(BUILD_DIR)
1147+
$(BUILD_DIR)/prod_ts_runtime.o: $(TS_RUNTIME_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11321148
$(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11331149

1134-
$(BUILD_DIR)/prod_lsp_all.o: $(LSP_UNITY_DEPS) | $(BUILD_DIR)
1150+
$(BUILD_DIR)/prod_lsp_all.o: $(LSP_UNITY_DEPS) $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11351151
$(CC) $(GRAMMAR_CFLAGS) -c -o $@ $<
11361152

1137-
$(BUILD_DIR)/prod_preprocessor.o: $(CBM_DIR)/preprocessor.cpp | $(BUILD_DIR)
1153+
$(BUILD_DIR)/prod_preprocessor.o: $(CBM_DIR)/preprocessor.cpp $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11381154
$(CXX) $(CXXFLAGS_PROD) -w -I$(CBM_DIR)/vendored -c -o $@ $<
11391155

11401156
# Vendored LZ4 (compiled separately, not unity-built via lz4_store.c)
11411157
LZ4_OBJ_PROD = $(BUILD_DIR)/prod_lz4.o $(BUILD_DIR)/prod_lz4hc.o
1142-
$(BUILD_DIR)/prod_lz4.o: $(CBM_DIR)/vendored/lz4/lz4.c | $(BUILD_DIR)
1158+
$(BUILD_DIR)/prod_lz4.o: $(CBM_DIR)/vendored/lz4/lz4.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11431159
$(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR) -c -o $@ $<
1144-
$(BUILD_DIR)/prod_lz4hc.o: $(CBM_DIR)/vendored/lz4/lz4hc.c | $(BUILD_DIR)
1160+
$(BUILD_DIR)/prod_lz4hc.o: $(CBM_DIR)/vendored/lz4/lz4hc.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11451161
$(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR)/vendored/lz4 -c -o $@ $<
11461162

11471163
# Vendored zstd (compiled separately, not unity-built via zstd_store.c)
11481164
ZSTD_OBJ_PROD = $(BUILD_DIR)/prod_zstd.o
1149-
$(BUILD_DIR)/prod_zstd.o: $(CBM_DIR)/vendored/zstd/zstd.c | $(BUILD_DIR)
1165+
$(BUILD_DIR)/prod_zstd.o: $(CBM_DIR)/vendored/zstd/zstd.c $(BUILD_DIR)/.build-config | $(BUILD_DIR)
11501166
$(CC) -std=c11 -D_DEFAULT_SOURCE -O2 -w $(MEMWASTE_VENDOR_CFLAGS) -I$(CBM_DIR)/vendored/zstd -c -o $@ $<
11511167

11521168
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)
@@ -1162,7 +1178,8 @@ MAIN_SRC = src/main.c
11621178
# configuration and it is rewritten only when that content changes, so ordinary
11631179
# incremental builds are unaffected. (Single-quoted: the signature may contain
11641180
# the escaped quotes of -DCBM_VERSION, which are literal inside '', but must not
1165-
# contain a literal single quote.)
1181+
# contain a literal single quote.) The config-flavoured prod objects above
1182+
# depend on the stamp for the same reason as the binary.
11661183
# SANITIZE belongs here: it changes the instrumentation compiled into every
11671184
# object, so a build that only changes it MUST rebuild. Its absence made
11681185
# `scripts/test.sh SANITIZE= ...` -- the documented way to get a plain build

0 commit comments

Comments
 (0)