Unverified Commit 036073ae authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

capnproto: 1.2.0 -> 1.4.0 (#485054)

parents 3b219d75 0cdfc628
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
From dfbbc505817bd0c3e01af5865196629c2a2a2b5e Mon Sep 17 00:00:00 2001
From: Marie Ramlow <me@nycode.dev>
Date: Wed, 10 Sep 2025 20:12:39 +0200
Subject: [PATCH] Check if libatomic is needed

---
 c++/src/kj/CMakeLists.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/c++/src/kj/CMakeLists.txt b/c++/src/kj/CMakeLists.txt
index 7114ddb80e..8ce355b8b0 100644
--- a/c++/src/kj/CMakeLists.txt
+++ b/c++/src/kj/CMakeLists.txt
@@ -84,6 +84,21 @@ target_compile_features(kj PUBLIC cxx_std_20)
 if(UNIX AND NOT ANDROID)
   target_link_libraries(kj PUBLIC pthread)
 endif()
+
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles("#include <atomic>
+int main() {
+  std::atomic<uint8_t> w1;
+  std::atomic<uint16_t> w2;
+  std::atomic<uint32_t> w4;
+  std::atomic<uint64_t> w8;
+  return ++w1 + ++w2 + ++w4 + ++w8;
+}" CAPNP_BUILDS_WITHOUT_LIBATOMIC)
+
+if(NOT CAPNP_BUILDS_WITHOUT_LIBATOMIC)
+  target_link_libraries(kj PUBLIC atomic)
+endif()
+
 #make sure the lite flag propagates to all users (internal + external) of this library
 target_compile_definitions(kj PUBLIC ${CAPNP_LITE_FLAG})
 #make sure external consumers don't need to manually set the include dirs
+2 −4
Original line number Diff line number Diff line
@@ -33,21 +33,19 @@ in
# See: https://gerrit.lix.systems/c/lix/+/1874
clangStdenv.mkDerivation rec {
  pname = "capnproto";
  version = "1.2.0";
  version = "1.4.0";

  # release tarballs are missing some ekam rules
  src = fetchFromGitHub {
    owner = "capnproto";
    repo = "capnproto";
    rev = "v${version}";
    hash = "sha256-aDcn4bLZGq8915/NPPQsN5Jv8FRWd8cAspkG3078psc=";
    hash = "sha256-CuhKOJwU+QG25lRR8F7ina+DV45ZlLzg/UJ2swf2tZ0=";
  };

  patches = [
    # https://github.com/capnproto/capnproto/pull/2377
    ./fix-libucontext.patch
    # https://github.com/capnproto/capnproto/pull/2410
    ./fix-libatomic.patch
  ];

  nativeBuildInputs = [
+29 −0
Original line number Diff line number Diff line
From 300f6e39cfc1723f0c703a3050cf0c2fd943baee Mon Sep 17 00:00:00 2001
From: Michael Daniels <mdaniels5757@gmail.com>
Date: Sun, 15 Mar 2026 10:14:06 -0400
Subject: [PATCH] fix cross-compilation with capnproto

See https://github.com/capnproto/capnproto/issues/1802
---
 tiledb/CMakeLists.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tiledb/CMakeLists.txt b/tiledb/CMakeLists.txt
index 8bf8559ed..1b5adb80c 100644
--- a/tiledb/CMakeLists.txt
+++ b/tiledb/CMakeLists.txt
@@ -617,6 +617,11 @@ target_include_directories(TILEDB_CORE_OBJECTS
 # Serialization
 if(TILEDB_SERIALIZATION)
   find_package(CapnProto REQUIRED)
+  find_program(CAPNP_EXECUTABLE_HOST capnp REQUIRED)
+  set_target_properties(CapnProto::capnp_tool PROPERTIES
+    IMPORTED_LOCATION ${CAPNP_EXECUTABLE_HOST}
+  )
+
   target_link_libraries(TILEDB_CORE_OBJECTS_ILIB
           INTERFACE
           CapnProto::capnp
-- 
2.51.2
+7 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-wzeWLwwsZXtrKsmlglZG7YvIki/ba7IwsDBq+40ltcg=";
  };

  patches = [ ./0001-fix-cross-compilation-with-capnproto.patch ];

  postPatch = ''
    substituteInPlace tiledb/sm/misc/test/unit_parse_argument.cc \
      --replace-fail '"catch.hpp"' '<catch2/catch_all.hpp>'
@@ -66,6 +68,7 @@ stdenv.mkDerivation (finalAttrs: {
  ++ lib.optional (!useAVX2) "-DCOMPILER_SUPPORTS_AVX2=FALSE";

  nativeBuildInputs = [
    capnproto
    clang-tools
    cmake
    python3
@@ -92,6 +95,10 @@ stdenv.mkDerivation (finalAttrs: {
    zstd
  ];

  preBuild = ''
    cmake --build . --target update-serialization
  '';

  nativeCheckInputs = [
    gtest
  ];