Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Pin GCC everywhere: local (gcc-14), CI Ubuntu (gcc), CI macOS (gcc-14)

Martin Vogelf646da29354a
diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml
index 6e043aa64..17b8a4de7 100644
--- a/.github/workflows/dry-run.yml
+++ b/.github/workflows/dry-run.yml
@@ -62,12 +62,20 @@ jobs:
include:
- os: ubuntu-latest
arch: amd64
+ cc: gcc
+ cxx: g++
- os: ubuntu-24.04-arm
arch: arm64
+ cc: gcc
+ cxx: g++
- os: macos-14
arch: arm64
+ cc: gcc-14
+ cxx: g++-14
- os: macos-15-intel
arch: amd64
+ cc: gcc-14
+ cxx: g++-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@@ -77,7 +85,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev
- name: Run C tests (ASan + UBSan)
- run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test
+ run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
# ── Step 3: Build binaries (standard + UI, all OS) ───────────
build-unix:
@@ -88,15 +96,23 @@ jobs:
- os: ubuntu-latest
goos: linux
goarch: amd64
+ cc: gcc
+ cxx: g++
- os: ubuntu-24.04-arm
goos: linux
goarch: arm64
+ cc: gcc
+ cxx: g++
- os: macos-14
goos: darwin
goarch: arm64
+ cc: gcc-14
+ cxx: g++-14
- os: macos-15-intel
goos: darwin
goarch: amd64
+ cc: gcc-14
+ cxx: g++-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@@ -110,7 +126,7 @@ jobs:
node-version: "22"
- name: Build standard binary
- run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm
+ run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
- name: Archive standard binary
run: |
@@ -118,7 +134,7 @@ jobs:
-C build/c codebase-memory-mcp
- name: Build UI binary
- run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui
+ run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
- name: Archive UI binary
run: |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 0b149122b..e8023fac0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -74,12 +74,20 @@ jobs:
include:
- os: ubuntu-latest
arch: amd64
+ cc: gcc
+ cxx: g++
- os: ubuntu-24.04-arm
arch: arm64
+ cc: gcc
+ cxx: g++
- os: macos-14
arch: arm64
+ cc: gcc-14
+ cxx: g++-14
- os: macos-15-intel
arch: amd64
+ cc: gcc-14
+ cxx: g++-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@@ -89,7 +97,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev
- name: Run C tests (ASan + UBSan)
- run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test
+ run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
# ── Step 3: Build binaries (standard + UI, all OS) ───────────
build-unix:
@@ -100,15 +108,23 @@ jobs:
- os: ubuntu-latest
goos: linux
goarch: amd64
+ cc: gcc
+ cxx: g++
- os: ubuntu-24.04-arm
goos: linux
goarch: arm64
+ cc: gcc
+ cxx: g++
- os: macos-14
goos: darwin
goarch: arm64
+ cc: gcc-14
+ cxx: g++-14
- os: macos-15-intel
goos: darwin
goarch: amd64
+ cc: gcc-14
+ cxx: g++-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@@ -127,6 +143,7 @@ jobs:
run: |
CLEAN_VERSION="${VERSION#v}"
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm \
+ CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} \
CFLAGS_EXTRA="-DCBM_VERSION=\"\\\"$CLEAN_VERSION\\\"\""
- name: Archive standard binary
@@ -140,6 +157,7 @@ jobs:
run: |
CLEAN_VERSION="${VERSION#v}"
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui \
+ CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} \
CFLAGS_EXTRA="-DCBM_VERSION=\"\\\"$CLEAN_VERSION\\\"\""
- name: Archive UI binary
diff --git a/Makefile.cbm b/Makefile.cbm
index 0444869e5..b4752f4ee 100644
--- a/Makefile.cbm
+++ b/Makefile.cbm
@@ -7,8 +7,11 @@
# make -f Makefile.cbm cbm # Production binary
# make -f Makefile.cbm clean-c # Remove build artifacts
-CC = cc
-CXX = c++
+# Pin GCC for consistent behavior across macOS, Linux, and CI.
+# macOS: brew install gcc → gcc-14/g++-14. Linux: system gcc/g++.
+# Override with: make CC=gcc-14 CXX=g++-14
+CC ?= gcc-14
+CXX ?= g++-14
# ── Common flags ─────────────────────────────────────────────────
@@ -33,8 +36,7 @@ endif
CFLAGS_COMMON = -std=c11 -D_DEFAULT_SOURCE -Wall -Wextra -Werror \
-Wno-unused-parameter -Wno-sign-compare \
- -Wno-unknown-warning-option \
- -Wno-format-truncation -Wno-restrict -Wno-unused-result \
+ -Wno-format-truncation -Wno-unused-result \
-Isrc -Ivendored -Ivendored/sqlite3 \
-Ivendored/mimalloc/include \
-I$(CBM_DIR) -I$(TS_INCLUDE) \