Version
codebase-memory-mcp dev (built from source, main @ 7824e50)
Platform
macOS (Apple Silicon)
Install channel
Built from source
Binary variant
standard
What happened, and what did you expect?
In the Nix flake dev shell (nix develop) on macOS, scripts/build.sh aborts before compiling anything: it prints WARNING: clang (…) is x86_64 only — cannot build native arm64 and exits 1 — even though the Nix clang targets arm64-apple-darwin natively and builds fine. I expected scripts/build.sh (the "Build from Source" flow in CONTRIBUTING) to produce build/c/codebase-memory-mcp. The same false negative hits test.sh/lint.sh/repro.sh (shared scripts/env.sh).
Separately, a cross-architecture build (scripts/build.sh --arch x86_64) does not produce an x86_64 binary, and once the compiler check is bypassed the build fails to compile with unknown type name 'git_allocator'.
nix build works only because the flake's buildPhase already bypasses build.sh and calls make directly (with a comment acknowledging the file-check failure), so this is specific to the documented developer workflow, not the packaged build.
Reproduction
Public repo: this repository (DeusData/codebase-memory-mcp @ main). Host: macOS, Apple Silicon. Toolchain: nixpkgs clang-wrapper 21.x in the flake dev shell (CC=clang CXX=clang++); clang --version → Target: arm64-apple-darwin.
nix develop
scripts/build.sh
- Actual: aborts with
WARNING: clang (…) is x86_64 only — cannot build native arm64, exit 1.
- Expected: builds
build/c/codebase-memory-mcp (native arm64).
- Cross-arch:
scripts/build.sh --arch x86_64
- Actual: no working x86_64 binary (compiler check, then link failure — see Logs).
- Bypass the check the way the flake does —
make -f Makefile.cbm cbm:
- Actual: compile error
internal/cbm/cbm.c:347: unknown type name 'git_allocator' (only when libgit2 is on the pkg-config path, i.e. inside the Nix shell).
Logs
# 1) scripts/build.sh
=== build.sh: os=darwin arch=arm64 cores=10 cc=clang cxx=clang++ ===
ui=false version=dev
WARNING: clang (/nix/store/…-clang-wrapper-21.x/bin/clang) is x86_64 only — cannot build native arm64
Install arm64 GCC: arch -arm64 /opt/homebrew/bin/brew install gcc
Or override: scripts/test.sh --arch x86_64
# exit 1
# 2) cross-arch link (after the arch check is satisfied)
ld: warning: ignoring file …/zlib-1.3.2/lib/libz.dylib, building for macOS-x86_64 but … arm64
ld: warning: ignoring file …/libgit2-1.9.4/lib/libgit2.dylib, building for macOS-x86_64 but … arm64
Undefined symbols for architecture x86_64
ld: symbol(s) not found for architecture x86_64
# 3) make -f Makefile.cbm cbm
internal/cbm/cbm.c:347:12: error: unknown type name 'git_allocator'
347 | static git_allocator cbm_git_alloc = {
| ^
Diagnostics trajectory (memory / performance / leak issues)
N/A — build/toolchain bug, not a memory or performance issue.
Project scale (if relevant)
N/A
Confirmations
Version
codebase-memory-mcp dev (built from source, main @ 7824e50)
Platform
macOS (Apple Silicon)
Install channel
Built from source
Binary variant
standard
What happened, and what did you expect?
In the Nix flake dev shell (
nix develop) on macOS,scripts/build.shaborts before compiling anything: it printsWARNING: clang (…) is x86_64 only — cannot build native arm64and exits 1 — even though the Nixclangtargetsarm64-apple-darwinnatively and builds fine. I expectedscripts/build.sh(the "Build from Source" flow in CONTRIBUTING) to producebuild/c/codebase-memory-mcp. The same false negative hitstest.sh/lint.sh/repro.sh(sharedscripts/env.sh).Separately, a cross-architecture build (
scripts/build.sh --arch x86_64) does not produce an x86_64 binary, and once the compiler check is bypassed the build fails to compile withunknown type name 'git_allocator'.nix buildworks only because the flake'sbuildPhasealready bypassesbuild.shand callsmakedirectly (with a comment acknowledging thefile-check failure), so this is specific to the documented developer workflow, not the packaged build.Reproduction
Public repo: this repository (
DeusData/codebase-memory-mcp@main). Host: macOS, Apple Silicon. Toolchain: nixpkgsclang-wrapper21.x in the flake dev shell (CC=clang CXX=clang++);clang --version→Target: arm64-apple-darwin.nix developscripts/build.shWARNING: clang (…) is x86_64 only — cannot build native arm64, exit 1.build/c/codebase-memory-mcp(native arm64).scripts/build.sh --arch x86_64make -f Makefile.cbm cbm:internal/cbm/cbm.c:347: unknown type name 'git_allocator'(only whenlibgit2is on the pkg-config path, i.e. inside the Nix shell).Logs
Diagnostics trajectory (memory / performance / leak issues)
N/A — build/toolchain bug, not a memory or performance issue.
Project scale (if relevant)
N/A
Confirmations