From 9687bedc4c89d8ec12ab2cd2a8fc142f63511259 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 10 Feb 2024 23:02:59 +0000 Subject: [PATCH] sgx-azure-dcap-client: fix `gcc-13` build failure Without the change build fails on `master` as https://hydra.nixos.org/build/247706272: local_cache.cpp: In function 'void throw_if(bool, const std::string&)': local_cache.cpp:40:20: error: 'runtime_error' is not a member of 'std' 40 | throw std::runtime_error(error); | ^~~~~~~~~~~~~ local_cache.cpp:17:1: note: 'std::runtime_error' is defined in header ''; did you forget to '#include '? 16 | #include +++ |+#include 17 | #include --- .../linux/sgx/azure-dcap-client/default.nix | 11 +++++++++++ .../linux/sgx/azure-dcap-client/test-suite.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix b/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix index cd3d2f94d6f3..0ee191e86895 100644 --- a/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix +++ b/pkgs/os-specific/linux/sgx/azure-dcap-client/default.nix @@ -1,5 +1,6 @@ { stdenv , fetchFromGitHub +, fetchpatch , lib , curl , nlohmann_json @@ -43,6 +44,16 @@ stdenv.mkDerivation rec { hash = "sha256-q0dI4WdA1ue4sw+QfSherh31Ldf9gnhoft66o3E9gnU="; }; + patches = [ + # Fix gcc-13 build: + # https://github.com/microsoft/Azure-DCAP-Client/pull/197 + (fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/microsoft/Azure-DCAP-Client/commit/fbcae7b3c8f1155998248cf5b5f4c1df979483f5.patch"; + hash = "sha256-ezEuQql3stn58N1ZPKMlhPpUOBkDpCcENpGwFAmWtHc="; + }) + ]; + nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/os-specific/linux/sgx/azure-dcap-client/test-suite.nix b/pkgs/os-specific/linux/sgx/azure-dcap-client/test-suite.nix index 1e4432ecc642..40d80ece8abf 100644 --- a/pkgs/os-specific/linux/sgx/azure-dcap-client/test-suite.nix +++ b/pkgs/os-specific/linux/sgx/azure-dcap-client/test-suite.nix @@ -9,7 +9,7 @@ sgx-azure-dcap-client.overrideAttrs (old: { gtest ]; - patches = [ + patches = (old.patches or []) ++ [ ./tests-missing-includes.patch ];