Skip to content

Commit f646da2

Browse files
committed
Pin GCC everywhere: local (gcc-14), CI Ubuntu (gcc), CI macOS (gcc-14)
1 parent 80299ab commit f646da2

3 files changed

Lines changed: 44 additions & 8 deletions

File tree

.github/workflows/dry-run.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,20 @@ jobs:
6262
include:
6363
- os: ubuntu-latest
6464
arch: amd64
65+
cc: gcc
66+
cxx: g++
6567
- os: ubuntu-24.04-arm
6668
arch: arm64
69+
cc: gcc
70+
cxx: g++
6771
- os: macos-14
6872
arch: arm64
73+
cc: gcc-14
74+
cxx: g++-14
6975
- os: macos-15-intel
7076
arch: amd64
77+
cc: gcc-14
78+
cxx: g++-14
7179
runs-on: ${{ matrix.os }}
7280
steps:
7381
- uses: actions/checkout@v4
@@ -77,7 +85,7 @@ jobs:
7785
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev
7886

7987
- name: Run C tests (ASan + UBSan)
80-
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test
88+
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
8189

8290
# ── Step 3: Build binaries (standard + UI, all OS) ───────────
8391
build-unix:
@@ -88,15 +96,23 @@ jobs:
8896
- os: ubuntu-latest
8997
goos: linux
9098
goarch: amd64
99+
cc: gcc
100+
cxx: g++
91101
- os: ubuntu-24.04-arm
92102
goos: linux
93103
goarch: arm64
104+
cc: gcc
105+
cxx: g++
94106
- os: macos-14
95107
goos: darwin
96108
goarch: arm64
109+
cc: gcc-14
110+
cxx: g++-14
97111
- os: macos-15-intel
98112
goos: darwin
99113
goarch: amd64
114+
cc: gcc-14
115+
cxx: g++-14
100116
runs-on: ${{ matrix.os }}
101117
steps:
102118
- uses: actions/checkout@v4
@@ -110,15 +126,15 @@ jobs:
110126
node-version: "22"
111127

112128
- name: Build standard binary
113-
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm
129+
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
114130

115131
- name: Archive standard binary
116132
run: |
117133
tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
118134
-C build/c codebase-memory-mcp
119135
120136
- name: Build UI binary
121-
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui
137+
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
122138

123139
- name: Archive UI binary
124140
run: |

.github/workflows/release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,20 @@ jobs:
7474
include:
7575
- os: ubuntu-latest
7676
arch: amd64
77+
cc: gcc
78+
cxx: g++
7779
- os: ubuntu-24.04-arm
7880
arch: arm64
81+
cc: gcc
82+
cxx: g++
7983
- os: macos-14
8084
arch: arm64
85+
cc: gcc-14
86+
cxx: g++-14
8187
- os: macos-15-intel
8288
arch: amd64
89+
cc: gcc-14
90+
cxx: g++-14
8391
runs-on: ${{ matrix.os }}
8492
steps:
8593
- uses: actions/checkout@v4
@@ -89,7 +97,7 @@ jobs:
8997
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev zlib1g-dev
9098

9199
- name: Run C tests (ASan + UBSan)
92-
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test
100+
run: make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm test CC=${{ matrix.cc }} CXX=${{ matrix.cxx }}
93101

94102
# ── Step 3: Build binaries (standard + UI, all OS) ───────────
95103
build-unix:
@@ -100,15 +108,23 @@ jobs:
100108
- os: ubuntu-latest
101109
goos: linux
102110
goarch: amd64
111+
cc: gcc
112+
cxx: g++
103113
- os: ubuntu-24.04-arm
104114
goos: linux
105115
goarch: arm64
116+
cc: gcc
117+
cxx: g++
106118
- os: macos-14
107119
goos: darwin
108120
goarch: arm64
121+
cc: gcc-14
122+
cxx: g++-14
109123
- os: macos-15-intel
110124
goos: darwin
111125
goarch: amd64
126+
cc: gcc-14
127+
cxx: g++-14
112128
runs-on: ${{ matrix.os }}
113129
steps:
114130
- uses: actions/checkout@v4
@@ -127,6 +143,7 @@ jobs:
127143
run: |
128144
CLEAN_VERSION="${VERSION#v}"
129145
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm \
146+
CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} \
130147
CFLAGS_EXTRA="-DCBM_VERSION=\"\\\"$CLEAN_VERSION\\\"\""
131148
132149
- name: Archive standard binary
@@ -140,6 +157,7 @@ jobs:
140157
run: |
141158
CLEAN_VERSION="${VERSION#v}"
142159
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) -f Makefile.cbm cbm-with-ui \
160+
CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} \
143161
CFLAGS_EXTRA="-DCBM_VERSION=\"\\\"$CLEAN_VERSION\\\"\""
144162
145163
- name: Archive UI binary

Makefile.cbm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
# make -f Makefile.cbm cbm # Production binary
88
# make -f Makefile.cbm clean-c # Remove build artifacts
99

10-
CC = cc
11-
CXX = c++
10+
# Pin GCC for consistent behavior across macOS, Linux, and CI.
11+
# macOS: brew install gcc → gcc-14/g++-14. Linux: system gcc/g++.
12+
# Override with: make CC=gcc-14 CXX=g++-14
13+
CC ?= gcc-14
14+
CXX ?= g++-14
1215

1316
# ── Common flags ─────────────────────────────────────────────────
1417

@@ -33,8 +36,7 @@ endif
3336

3437
CFLAGS_COMMON = -std=c11 -D_DEFAULT_SOURCE -Wall -Wextra -Werror \
3538
-Wno-unused-parameter -Wno-sign-compare \
36-
-Wno-unknown-warning-option \
37-
-Wno-format-truncation -Wno-restrict -Wno-unused-result \
39+
-Wno-format-truncation -Wno-unused-result \
3840
-Isrc -Ivendored -Ivendored/sqlite3 \
3941
-Ivendored/mimalloc/include \
4042
-I$(CBM_DIR) -I$(TS_INCLUDE) \

0 commit comments

Comments
 (0)