Skip to content

build from source fails on cachyos #589

Closed

Description

@haarer

Version

codebase-memory-mcp dev

Platform

Linux (x64)

Install channel

Built from source

Binary variant

standard

What happened, and what did you expect?

clone repo, run scripts/build.sh
got build errors
some related to -Werror=discarded-qualifiers
some related to a missing include needed for recent libgit

gcc (GCC) 16.1.1 20260430
pkg-config --modversion libgit2 1.9.4

I think it is, because gcc 16.1.1 is picky about discarded qualifiers by default.

these changes let it build

❯ git diff
diff --git a/internal/cbm/cbm.c b/internal/cbm/cbm.c
index d611f18..81bc99d 100644
--- a/internal/cbm/cbm.c
+++ b/internal/cbm/cbm.c
@@ -21,6 +21,7 @@
#include "sqlite3.h" // sqlite3_mem_methods, sqlite3_config, SQLITE_CONFIG_MALLOC — bind sqlite to mimalloc
#if defined(HAVE_LIBGIT2)
#include <git2.h> // git_allocator, git_libgit2_opts, GIT_OPT_SET_ALLOCATOR — bind libgit2 to mimalloc
+#include <git2/sys/alloc.h>
#endif
#endif
#include <stdint.h> // uint32_t, uint64_t, int64_t
diff --git a/src/cli/cli.c b/src/cli/cli.c
index 4228dba..8219da6 100644
--- a/src/cli/cli.c
+++ b/src/cli/cli.c
@@ -1457,12 +1457,12 @@ int cbm_remove_codex_mcp(const char config_path) {
/
Splice out an existing [CODEX_HOOK_BEGIN .. CODEX_HOOK_END] block (inclusive,

  • plus a leading newline). Returns a newly-malloc'd string the caller frees, or
  • NULL if no block was present (content is left untouched). */
    -static char *codex_hook_strip(const char *content) {
  • char *begin = strstr(content, CODEX_HOOK_BEGIN);
    +static char *codex_hook_strip(const char *content) {
  • const char *begin = strstr(content, CODEX_HOOK_BEGIN);
    if (!begin) {
    return NULL;
    }
  • char *end = strstr(begin, CODEX_HOOK_END);
  • const char *end = strstr(begin, CODEX_HOOK_END);

Reproduction

reproducible on vanilla cachyos, just clone the repo and try to build.

Logs


Project scale (if relevant)

No response

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. DeusData commented on Jun 23, 2026

    @DeusData
    Owner

    Hey, yes we are currently in a "in between release" phase. It's currently not all verified to be working. Please use the release binaries from 0.8.1 or check out to the commit version listed in the release :)

  2. haarer commented on Jun 23, 2026

    @haarer
    Author
  3. DeusData commented on Jun 23, 2026

    @DeusData
    Owner

    @haarer alright will have a look, thx for reporting

  4. DeusData commented on Jun 26, 2026

    @DeusData
    Owner

    Thanks for the persistence on this — and you were right to push back. v0.8.1 is a
    release tag, not an in-between state. Apologies for the confusion.

    Your diff looks directionally correct. Before we merge, we want to confirm the
    <git2/sys/alloc.h> path is stable across distros and that no older toolchain breaks
    with the const char * changes. Could you share:

    Instructions for your coding agent:

    # 1. Full build output with errors highlighted
    cd /path/to/codebase-memory-mcp
    bash scripts/build.sh 2>&1 | tee /tmp/cbm-build-589.log
    grep -n 'error:\|warning:.*-Werror' /tmp/cbm-build-589.log | head -60
    
    # 2. Compiler and libgit2 details
    gcc --version
    pkg-config --modversion libgit2
    pkg-config --cflags libgit2
    
    # 3. Where is git2/sys/alloc.h on your system?
    find /usr -name 'alloc.h' -path '*/git2/*' 2>/dev/null
    find /usr -name 'alloc.h' -path '*/git2/sys/*' 2>/dev/null
    
    # 4. After applying your diff, does it build cleanly?
    bash scripts/build.sh 2>&1 | grep -Ec '^.*(error|warning.*Werror):'
    # Expected: 0
    
    # 5. Smoke test the built binary
    ./codebase-memory-mcp --version

    The find output (step 3) confirming git2/sys/alloc.h exists at that path is the
    most important piece — it determines whether we can use the include unconditionally or
    need a configure-time check.

    Thanks for the patch and for the detailed context!

  5. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Jun 26, 2026
  6. github-actions commented on Jun 26, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

  7. added
    priority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.
    on Jun 30, 2026
  8. added this to the 0.9.1-rc milestone on Jul 8, 2026
  9. removed
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Jul 10, 2026
  10. added
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    editor/integrationEditor compatibility and CLI integration
    and removed
    priority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.
    on Sep 5, 2026
  11. DeusData commented on Sep 25, 2026

    @DeusData
    Owner

    Thank you, Alexander, for the patch and for pushing back; you were right that v0.8.1 was a proper tag! Both problems are fixed as of v0.9.0: the const-qualifier errors in c13a9db (#588) and the libgit2 include in 03a0840. The optional libgit2 dependency was later dropped entirely, so that include is gone. Could you confirm that a build from the v0.11.0 tag succeeds with your gcc 16.1.1? If we don't hear back, we'll close this as fixed.

  12. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Sep 25, 2026
  13. github-actions commented on Sep 26, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

  14. github-actions commented on Oct 18, 2026

    @github-actions

    This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.

  15. added
    staleNo activity after an info request; will be closed soon
    on Oct 18, 2026
  16. DeusData commented on Oct 19, 2026

    @DeusData
    Owner

    Thank you again for the CachyOS patch and correction about the release tag. Checking back on the September request: does building a newer tagged release succeed with your GCC version? I have no fresh toolchain result to add, and silence alone will not be treated as your confirmation.

  17. removed
    staleNo activity after an info request; will be closed soon
    on Oct 20, 2026
  18. haarer commented on Oct 20, 2026

    @haarer
    Author

    i tested on the tag v0.12.1 and on head and it builds fine on cachyos now.
    so it is fixed for me.

    thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then closebugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions