Skip to content

build from source fails on cachyos #589

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

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

    bugSomething 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