mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
a4f929696490 Merge bitcoin-core/libmultiprocess#224: doc: fix typos f4344ae87da0 Merge bitcoin-core/libmultiprocess#222: test, ci: Fix threadsanitizer errors in mptest 1434642b3804 doc: fix typos 73d22ba2e930 test: Fix tsan race in thread busy test b74e1bba014d ci: Use tsan-instrumented cap'n proto in sanitizers job c332774409ad test: Fix failing exception check in new thread busy test ca3c05d56709 test: Use KJ_LOG instead of std::cout for logging 7eb1da120ab6 ci: Use tsan-instrumented libcxx in sanitizers job ec86e4336e98 Merge bitcoin-core/libmultiprocess#220: Add log levels and advertise them to users via logging callback 515ce93ad349 Logging: Pass LogData struct to logging callback 213574ccc43d Logging: reclassify remaining log messages e4de0412b430 Logging: Break out expensive log messages and classify them as Trace 408874a78fdc Logging: Use new logging macros 67b092d835cd Logging: Disable logging if messsage level is less than the requested level d0a1ba7ebf21 Logging: add log levels to mirror Core's 463a8296d188 Logging: Disable moving or copying Logger 83a2e10c0b03 Logging: Add an EventLoop constructor to allow for user-specified log options 58cf47a7fc8c Merge bitcoin-core/libmultiprocess#221: test default PassField impl handles output parameters db03a663f514 Merge bitcoin-core/libmultiprocess#214: Fix crash on simultaneous IPC calls using the same thread afcc40b0f1e8 Merge bitcoin-core/libmultiprocess#213: util+doc: Clearer errors when attempting to run examples + polished docs 6db669628387 test In|Out parameter 29cf2ada75ea test default PassField impl handles output parameters 1238170f68e8 test: simultaneous IPC calls using same thread eb069ab75d83 Fix crash on simultaneous IPC calls using the same thread ec03a9639ab5 doc: Precision and typos 2b4348193551 doc: Where possible, remove links to ryanofsky/bitcoin/ 286fe469c9c9 util: Add helpful error message when failing to execute file 47d79db8a552 Merge bitcoin-core/libmultiprocess#201: bug: fix mptest hang, ProxyClient<Thread> deadlock in disconnect handler f15ae9c9b9fb Merge bitcoin-core/libmultiprocess#211: Add .gitignore 4a269b21b8c8 bug: fix ProxyClient<Thread> deadlock if disconnected as IPC call is returning 85df96482c49 Use try_emplace in SetThread instead of threads.find ca9b380ea91a Use std::optional in ConnThreads to allow shortening locks 9b0799113557 doc: describe ThreadContext struct and synchronization requirements d60db601ed9b proxy-io.h: add Waiter::m_mutex thread safety annotations 4e365b019a9f ci: Use -Wthread-safety not -Wthread-safety-analysis 15d7bafbb001 Add .gitignore fe1cd8c76131 Merge bitcoin-core/libmultiprocess#208: ci: Test minimum cmake version in olddeps job b713a0b7bfbc Merge bitcoin-core/libmultiprocess#207: ci: output CMake version in CI script 0f580397c913 ci: Test minimum cmake version in olddeps job d603dcc0eef0 ci: output CMake version in CI script git-subtree-dir: src/ipc/libmultiprocess git-subtree-split: a4f92969649018ca70f949a09148bccfeaecd99a
85 lines
3.6 KiB
Nix
85 lines
3.6 KiB
Nix
{ pkgs ? import <nixpkgs> {}
|
|
, crossPkgs ? import <nixpkgs> {}
|
|
, enableLibcxx ? false # Whether to use libc++ toolchain and libraries instead of libstdc++
|
|
, minimal ? false # Whether to create minimal shell without extra tools (faster when cross compiling)
|
|
, capnprotoVersion ? null
|
|
, capnprotoSanitizers ? null # Optional sanitizers to build cap'n proto with
|
|
, cmakeVersion ? null
|
|
, libcxxSanitizers ? null # Optional LLVM_USE_SANITIZER value to use for libc++, see https://llvm.org/docs/CMake.html
|
|
}:
|
|
|
|
let
|
|
lib = pkgs.lib;
|
|
llvmBase = crossPkgs.llvmPackages_21;
|
|
llvm = llvmBase // lib.optionalAttrs (libcxxSanitizers != null) {
|
|
libcxx = llvmBase.libcxx.override {
|
|
devExtraCmakeFlags = [ "-DLLVM_USE_SANITIZER=${libcxxSanitizers}" ];
|
|
};
|
|
};
|
|
capnprotoHashes = {
|
|
"0.7.0" = "sha256-Y/7dUOQPDHjniuKNRw3j8dG1NI9f/aRWpf8V0WzV9k8=";
|
|
"0.7.1" = "sha256-3cBpVmpvCXyqPUXDp12vCFCk32ZXWpkdOliNH37UwWE=";
|
|
"0.8.0" = "sha256-rfiqN83begjJ9eYjtr21/tk1GJBjmeVfa3C3dZBJ93w=";
|
|
"0.8.1" = "sha256-OZqNVYdyszro5rIe+w6YN00g6y8U/1b8dKYc214q/2o=";
|
|
"0.9.0" = "sha256-yhbDcWUe6jp5PbIXzn5EoKabXiWN8lnS08hyfxUgEQ0=";
|
|
"0.9.2" = "sha256-BspWOPZcP5nCTvmsDE62Zutox+aY5pw42d6hpH3v4cM=";
|
|
"0.10.0" = "sha256-++F4l54OMTDnJ+FO3kV/Y/VLobKVRk461dopanuU3IQ=";
|
|
"0.10.4" = "sha256-45sxnVyyYIw9i3sbFZ1naBMoUzkpP21WarzR5crg4X8=";
|
|
"1.0.0" = "sha256-NLTFJdeOzqhk4ATvkc17Sh6g/junzqYBBEoXYGH/czo=";
|
|
"1.0.2" = "sha256-LVdkqVBTeh8JZ1McdVNtRcnFVwEJRNjt0JV2l7RkuO8=";
|
|
"1.1.0" = "sha256-gxkko7LFyJNlxpTS+CWOd/p9x/778/kNIXfpDGiKM2A=";
|
|
"1.2.0" = "sha256-aDcn4bLZGq8915/NPPQsN5Jv8FRWd8cAspkG3078psc=";
|
|
};
|
|
capnprotoBase = if capnprotoVersion == null then crossPkgs.capnproto else crossPkgs.capnproto.overrideAttrs (old: {
|
|
version = capnprotoVersion;
|
|
src = crossPkgs.fetchFromGitHub {
|
|
owner = "capnproto";
|
|
repo = "capnproto";
|
|
rev = "v${capnprotoVersion}";
|
|
hash = lib.attrByPath [capnprotoVersion] "" capnprotoHashes;
|
|
};
|
|
patches = lib.optionals (lib.versionAtLeast capnprotoVersion "0.9.0" && lib.versionOlder capnprotoVersion "0.10.4") [ ./ci/patches/spaceship.patch ];
|
|
} // (lib.optionalAttrs (lib.versionOlder capnprotoVersion "0.10") {
|
|
env = { }; # Drop -std=c++20 flag forced by nixpkgs
|
|
}));
|
|
capnproto = (capnprotoBase.overrideAttrs (old: lib.optionalAttrs (capnprotoSanitizers != null) {
|
|
env = (old.env or { }) // {
|
|
CXXFLAGS =
|
|
lib.concatStringsSep " " [
|
|
(old.env.CXXFLAGS or "")
|
|
"-fsanitize=${capnprotoSanitizers}"
|
|
"-fno-omit-frame-pointer"
|
|
"-g"
|
|
];
|
|
};
|
|
})).override (lib.optionalAttrs enableLibcxx { clangStdenv = llvm.libcxxStdenv; });
|
|
clang = if enableLibcxx then llvm.libcxxClang else llvm.clang;
|
|
clang-tools = llvm.clang-tools.override { inherit enableLibcxx; };
|
|
cmakeHashes = {
|
|
"3.12.4" = "sha256-UlVYS/0EPrcXViz/iULUcvHA5GecSUHYS6raqbKOMZQ=";
|
|
};
|
|
cmakeBuild = if cmakeVersion == null then pkgs.cmake else (pkgs.cmake.overrideAttrs (old: {
|
|
version = cmakeVersion;
|
|
src = pkgs.fetchurl {
|
|
url = "https://cmake.org/files/v${lib.versions.majorMinor cmakeVersion}/cmake-${cmakeVersion}.tar.gz";
|
|
hash = lib.attrByPath [cmakeVersion] "" cmakeHashes;
|
|
};
|
|
patches = [];
|
|
})).override { isMinimalBuild = true; };
|
|
in crossPkgs.mkShell {
|
|
buildInputs = [
|
|
capnproto
|
|
];
|
|
nativeBuildInputs = with pkgs; [
|
|
cmakeBuild
|
|
include-what-you-use
|
|
ninja
|
|
] ++ lib.optionals (!minimal) [
|
|
clang
|
|
clang-tools
|
|
];
|
|
|
|
# Tell IWYU where its libc++ mapping lives
|
|
IWYU_MAPPING_FILE = if enableLibcxx then "${llvm.libcxx.dev}/include/c++/v1/libcxx.imp" else null;
|
|
}
|