Skip to content

Commit 96b4604

Browse files
hyperpolymathclaude
andcommitted
fix(ffi): Zig 0.15.2 compatibility for 8 new cartridges
- vault-mcp: Replace ArrayList.init() with fixed-size buffer - discord/telegram/matrix-mcp: Remove discarded unbounded for counters - gitlab-api-mcp: Fix &mut → & (Zig syntax, not Rust) - postgresql/redis/mongodb-mcp: Remove linkSystemLibrary for uninstalled libs (stub-only builds) All 36 cartridge FFI shared libraries now build cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a14bd82 commit 96b4604

11 files changed

Lines changed: 25 additions & 19 deletions

File tree

cartridges/discord-mcp/ffi/discord_mcp_ffi.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ test "slot exhaustion" {
358358
discord_mcp_reset();
359359

360360
var slots: [MAX_SESSIONS]c_int = undefined;
361-
for (&slots, 0..) |*s, _| {
361+
for (&slots) |*s| {
362362
s.* = discord_mcp_session_open();
363363
try std.testing.expect(s.* >= 0);
364364
}

cartridges/gitlab-api-mcp/ffi/gitlab_api_mcp_ffi.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub export fn gitlab_api_mcp_session_open() c_int {
143143
mutex.lock();
144144
defer mutex.unlock();
145145

146-
for (&mut sessions, 0..) |*slot, idx| {
146+
for (&sessions, 0..) |*slot, idx| {
147147
if (!slot.active) {
148148
slot.* = .{};
149149
slot.active = true;
@@ -562,7 +562,7 @@ pub export fn gitlab_api_mcp_logout(slot_idx: c_int) c_int {
562562
pub export fn gitlab_api_mcp_reset() void {
563563
mutex.lock();
564564
defer mutex.unlock();
565-
for (&mut sessions) |*slot| {
565+
for (&sessions) |*slot| {
566566
@memset(&slot.token_buf, 0);
567567
}
568568
sessions = [_]SessionSlot{.{}} ** MAX_SESSIONS;
@@ -751,7 +751,7 @@ test "slot exhaustion" {
751751
gitlab_api_mcp_reset();
752752

753753
var slots: [MAX_SESSIONS]c_int = undefined;
754-
for (&mut slots) |*s| {
754+
for (&slots) |*s| {
755755
s.* = gitlab_api_mcp_session_open();
756756
try std.testing.expect(s.* >= 0);
757757
}

cartridges/jira-mcp/tests/integration_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd "$FFI_DIR" && zig build test 2>&1
2020
# Validate Idris2 ABI (if idris2 available)
2121
echo "[3/3] Checking ABI..."
2222
if command -v idris2 &>/dev/null; then
23-
cd "$CART_DIR/abi" && idris2 --check JiraMcp.SafeCloud 2>&1
23+
cd "$CART_DIR/abi" && idris2 --check jira_mcp.ipkg 2>&1
2424
echo " ABI: OK"
2525
else
2626
echo " ABI: SKIPPED (idris2 not in PATH)"

cartridges/linear-mcp/tests/integration_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd "$FFI_DIR" && zig build test 2>&1
2020
# Validate Idris2 ABI (if idris2 available)
2121
echo "[3/3] Checking ABI..."
2222
if command -v idris2 &>/dev/null; then
23-
cd "$CART_DIR/abi" && idris2 --check LinearMcp.SafeCloud 2>&1
23+
cd "$CART_DIR/abi" && idris2 --check linear_mcp.ipkg 2>&1
2424
echo " ABI: OK"
2525
else
2626
echo " ABI: SKIPPED (idris2 not in PATH)"

cartridges/matrix-mcp/ffi/matrix_mcp_ffi.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ test "slot exhaustion" {
376376
matrix_mcp_reset();
377377

378378
var slots: [MAX_SESSIONS]c_int = undefined;
379-
for (&slots, 0..) |*s, _| {
379+
for (&slots) |*s| {
380380
s.* = matrix_mcp_session_open();
381381
try std.testing.expect(s.* >= 0);
382382
}

cartridges/mongodb-mcp/ffi/build.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ pub fn build(b: *std.Build) void {
2626
.linkage = .dynamic,
2727
});
2828
lib.linkLibC();
29-
lib.linkSystemLibrary("mongoc-1.0");
30-
lib.linkSystemLibrary("bson-1.0");
29+
// NOTE: linkSystemLibrary("mongoc-1.0") and linkSystemLibrary("bson-1.0")
30+
// removed — stub implementation does not actually call libmongoc/libbson yet.
31+
// Will be re-enabled when real bindings are wired.
3132
b.installArtifact(lib);
3233

3334
// Tests

cartridges/notion-mcp/tests/integration_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd "$FFI_DIR" && zig build test 2>&1
2020
# Validate Idris2 ABI (if idris2 available)
2121
echo "[3/3] Checking ABI..."
2222
if command -v idris2 &>/dev/null; then
23-
cd "$CART_DIR/abi" && idris2 --check NotionMcp.SafeComms 2>&1
23+
cd "$CART_DIR/abi" && idris2 --check notion_mcp.ipkg 2>&1
2424
echo " ABI: OK"
2525
else
2626
echo " ABI: SKIPPED (idris2 not in PATH)"

cartridges/postgresql-mcp/ffi/build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub fn build(b: *std.Build) void {
2626
.linkage = .dynamic,
2727
});
2828
lib.linkLibC();
29-
lib.linkSystemLibrary("pq");
29+
// NOTE: linkSystemLibrary("pq") removed — stub implementation does not
30+
// actually call libpq yet. Will be re-enabled when real bindings are wired.
3031
b.installArtifact(lib);
3132

3233
// Tests

cartridges/redis-mcp/ffi/build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pub fn build(b: *std.Build) void {
2626
.linkage = .dynamic,
2727
});
2828
lib.linkLibC();
29-
lib.linkSystemLibrary("hiredis");
29+
// NOTE: linkSystemLibrary("hiredis") removed — stub implementation does not
30+
// actually call hiredis yet. Will be re-enabled when real bindings are wired.
3031
b.installArtifact(lib);
3132

3233
// Tests

cartridges/telegram-mcp/ffi/telegram_mcp_ffi.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ test "slot exhaustion" {
359359
telegram_mcp_reset();
360360

361361
var slots: [MAX_SESSIONS]c_int = undefined;
362-
for (&slots, 0..) |*s, _| {
362+
for (&slots) |*s| {
363363
s.* = telegram_mcp_session_open();
364364
try std.testing.expect(s.* >= 0);
365365
}

0 commit comments

Comments
 (0)