From 84266e795accfbf420350b4a1ace33fa20268b58 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Oct 2024 13:37:35 +0100 Subject: [PATCH 1/4] gbenchmark: 1.8.5 -> 1.9.0 Release notes: --- pkgs/development/libraries/gbenchmark/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index be39b0d7cbdd..32582b25b608 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "gbenchmark"; - version = "1.8.5"; + version = "1.9.0"; src = fetchFromGitHub { owner = "google"; repo = "benchmark"; rev = "v${version}"; - hash = "sha256-c46Xna/t21WKaFa7n4ieIacsrxJ+15uGNYWCUVuUhsI="; + hash = "sha256-5cl1PIjhXaL58kSyWZXRWLq6BITS2BwEovPhwvk2e18="; }; nativeBuildInputs = [ cmake ]; From 94b9af3863eb939d5874f699443d73eeeb54756d Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Oct 2024 13:37:35 +0100 Subject: [PATCH 2/4] gbenchmark: remove obsolete patch This was upstreamed in . --- pkgs/development/libraries/gbenchmark/default.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index 32582b25b608..10163a04bc58 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -22,11 +22,6 @@ stdenv.mkDerivation rec { postPatch = '' cp -r ${gtest.src} googletest chmod -R u+w googletest - - # https://github.com/google/benchmark/issues/1396 - substituteInPlace cmake/benchmark.pc.in \ - --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ - --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ ''; # Tests fail on 32-bit due to not enough precision From 267cdb7989e81a4aceb1ddcd928b9c990116ab8e Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Oct 2024 13:37:35 +0100 Subject: [PATCH 3/4] gbenchmark: use Ninja to build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I confirmed that it’s faster. --- pkgs/development/libraries/gbenchmark/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index 10163a04bc58..fcb95d088f8d 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , cmake +, ninja , gtest , prometheus-cpp }: @@ -17,7 +18,7 @@ stdenv.mkDerivation rec { hash = "sha256-5cl1PIjhXaL58kSyWZXRWLq6BITS2BwEovPhwvk2e18="; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake ninja ]; postPatch = '' cp -r ${gtest.src} googletest From 2a9be238cf0c4d26b2a2fc48c023c38094120325 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Oct 2024 13:37:35 +0100 Subject: [PATCH 4/4] gbenchmark: disable `-Werror` Fixes the build on Darwin. --- pkgs/development/libraries/gbenchmark/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index fcb95d088f8d..4aea6433c813 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -20,6 +20,19 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ]; + cmakeFlags = [ + # We ran into issues with gtest 1.8.5 conditioning on + # `#if __has_cpp_attribute(maybe_unused)`, which was, for some + # reason, going through even when C++14 was being used and + # breaking the build on Darwin by triggering warnings about using + # C++17 features. + # + # This might be a problem with our Clang, as it does not reproduce + # with Xcode, but since `-Werror` is painful for us anyway and + # upstream exposes a CMake flag to turn it off, we just use that. + (lib.cmakeBool "BENCHMARK_ENABLE_WERROR" false) + ]; + postPatch = '' cp -r ${gtest.src} googletest chmod -R u+w googletest