From 04a0465d67a58040013c74dbb92e0f7a0572cc0e Mon Sep 17 00:00:00 2001 From: xyzconstant <263061129+xyzconstant@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:59:51 -0300 Subject: [PATCH] ci: Compile capnproto with GCC in gnu32 job In the gnu32 job, capnproto (libkj) is compiled with Clang while libmultiprocess is compiled with GCC, but they handle empty structs differently on i686. Clang omits them, while GCC reserves a stack slot for them. This causes a segfault in calls to functions like `kj::str(kj::Exception)`, which internally pass an empty `Stringifier` object. This commit fixes the issue by compiling capnproto with the same toolchain as libmultiprocess (GCC) when i686 is detected in shell.nix. --- shell.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 1fbfda51..01cf415c 100644 --- a/shell.nix +++ b/shell.nix @@ -50,7 +50,12 @@ let "-g" ]; }; - })).override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; }); + })).override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; } + # On i686, GCC and clang handle empty structs differently, causing an + # ABI mismatch and segfaulting in calls to functions like + # kj::str(kj::Exception). Prevent this by compiling capnproto with the + # same toolchain as libmultiprocess. + // lib.optionalAttrs crossPkgs.stdenv.hostPlatform.isx86_32 { clangStdenv = crossPkgs.stdenv; }); clang = if enableLibcxx then llvm.libcxxClang else llvm.clang; clang-tools = llvm.clang-tools.override { inherit enableLibcxx; }; cmakeHashes = {