From patchwork Thu May 25 17:54:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saku Laesvuori X-Patchwork-Id: 50330 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 10B0B27BBE9; Thu, 25 May 2023 18:55:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8984427BBE2 for ; Thu, 25 May 2023 18:55:22 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2FB6-0001ce-Tb; Thu, 25 May 2023 13:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2FB1-0001bk-Oy for guix-patches@gnu.org; Thu, 25 May 2023 13:55:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2FB1-0001Ju-4Z for guix-patches@gnu.org; Thu, 25 May 2023 13:55:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2FB0-000521-Ua for guix-patches@gnu.org; Thu, 25 May 2023 13:55:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63706] [PATCH v2 1/3] gnu: c++-gsl: Update to 4.0.0 Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 May 2023 17:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63706 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63706@debbugs.gnu.org Cc: Saku Laesvuori , liliana.prikler@gmail.com Received: via spool by 63706-submit@debbugs.gnu.org id=B63706.168503729519310 (code B ref 63706); Thu, 25 May 2023 17:55:02 +0000 Received: (at 63706) by debbugs.gnu.org; 25 May 2023 17:54:55 +0000 Received: from localhost ([127.0.0.1]:48041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2FAs-00051H-QY for submit@debbugs.gnu.org; Thu, 25 May 2023 13:54:55 -0400 Received: from vmi571514.contaboserver.net ([75.119.130.101]:34532 helo=mail.laesvuori.fi) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2FAq-00050u-6L for 63706@debbugs.gnu.org; Thu, 25 May 2023 13:54:53 -0400 Received: from X-kone.lan (88-113-24-127.elisa-laajakaista.fi [88.113.24.127]) by mail.laesvuori.fi (Postfix) with ESMTPSA id 6DC43340103; Thu, 25 May 2023 19:54:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1685037299; bh=MPjPnwLU92R/sqVy3wMFKOsuyUW7aHvCKDJNSnVm7Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=S7+Siq2iJu2egQwQcCwXR5TTVdwMcljVpc5TZYsz68vsrKfsan4IL0Bx+WY/i6kRS LpfW491FcHMJP7hlz5Iw2+LxaT88Gz222XURna8MzW+zWgEkmUsSbdD+PSk6JbHxkR u3lPKblJ8XLTfXw8p7EUgjWK3Ce+ef77zJjWcRrU= Date: Thu, 25 May 2023 20:54:41 +0300 Message-Id: <20230525175443.10827-1-saku@laesvuori.fi> X-Mailer: git-send-email 2.39.2 In-Reply-To: <7b5f5d605d53a90df35aae829c7ef34269fbc476.camel@gmail.com> References: <7b5f5d605d53a90df35aae829c7ef34269fbc476.camel@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Saku Laesvuori X-ACL-Warn: , Saku Laesvuori via Guix-patches X-Patchwork-Original-From: Saku Laesvuori via Guix-patches via From: Saku Laesvuori Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/cpp.scm (c++gsl): Update to 4.0.0. * gnu/packages/patches/c++-gsl-find-system-gtest.patch: Delete file. * gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove deleted patches. --- gnu/local.mk | 2 - gnu/packages/cpp.scm | 8 +- .../patches/c++-gsl-find-system-gtest.patch | 96 ------------- .../c++-gsl-move-array-bounds-tests.patch | 126 ------------------ 4 files changed, 2 insertions(+), 230 deletions(-) delete mode 100644 gnu/packages/patches/c++-gsl-find-system-gtest.patch delete mode 100644 gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch base-commit: 3c33f7072a190231183f90a463a429dbb0d3e8b9 diff --git a/gnu/local.mk b/gnu/local.mk index c10fb01bb3..32e0e3071f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1032,8 +1032,6 @@ dist_patch_DATA = \ %D%/packages/patches/curl-use-ssl-cert-env.patch \ %D%/packages/patches/cursynth-wave-rand.patch \ %D%/packages/patches/cvs-CVE-2017-12836.patch \ - %D%/packages/patches/c++-gsl-find-system-gtest.patch \ - %D%/packages/patches/c++-gsl-move-array-bounds-tests.patch \ %D%/packages/patches/date-output-pkg-config-files.patch \ %D%/packages/patches/datefudge-gettimeofday.patch \ %D%/packages/patches/dbacl-include-locale.h.patch \ diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 34ae9ef70e..64f923929e 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -224,7 +224,7 @@ (define-public range-v3 (define-public c++-gsl (package (name "c++-gsl") - (version "3.1.0") + (version "4.0.0") (source (origin (method git-fetch) @@ -235,12 +235,8 @@ (define-public c++-gsl (string-append "v" version)))) (file-name (git-file-name name version)) - (patches - (search-patches - "c++-gsl-find-system-gtest.patch" - "c++-gsl-move-array-bounds-tests.patch")) (sha256 - (base32 "0gbvr48f03830g3154bjhw92b8ggmg6wwh5xyb8nppk9v6w752l0")))) + (base32 "0dgb3rb6x2276d3v7x568m3zhqr67rhk8ynqgm3c304avnmcaw3i")))) (build-system cmake-build-system) (native-inputs (list googletest pkg-config)) diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch deleted file mode 100644 index 2def650292..0000000000 --- a/gnu/packages/patches/c++-gsl-find-system-gtest.patch +++ /dev/null @@ -1,96 +0,0 @@ -From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001 -From: Nicholas Guriev -Date: Sat, 18 Apr 2020 13:30:17 +0300 -Subject: [PATCH] Search for GoogleTest via pkg-config first - ---- - tests/CMakeLists.txt | 55 ++++++++++++++++++++++++-------------------- - 1 file changed, 30 insertions(+), 25 deletions(-) - -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 02193197..53d475c2 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -1,36 +1,41 @@ - cmake_minimum_required(VERSION 3.0.2) - - project(GSLTests CXX) -+include(FindPkgConfig) - - # will make visual studio generated project group files - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - --configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) --execute_process( -- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -- RESULT_VARIABLE result -- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download --) --if(result) -- message(FATAL_ERROR "CMake step for googletest failed: ${result}") --endif() -+pkg_search_module(GTestMain gtest_main) -+if (NOT GTestMain_FOUND) -+ configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) -+ execute_process( -+ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . -+ RESULT_VARIABLE result -+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download -+ ) -+ if(result) -+ message(FATAL_ERROR "CMake step for googletest failed: ${result}") -+ endif() - --execute_process( -- COMMAND ${CMAKE_COMMAND} --build . -- RESULT_VARIABLE result -- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download --) --if(result) -- message(FATAL_ERROR "CMake step for googletest failed: ${result}") --endif() -+ execute_process( -+ COMMAND ${CMAKE_COMMAND} --build . -+ RESULT_VARIABLE result -+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download -+ ) -+ if(result) -+ message(FATAL_ERROR "CMake step for googletest failed: ${result}") -+ endif() - --set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -+ set(GTestMain_LIBRARIES gtest_main) - --add_subdirectory( -- ${CMAKE_CURRENT_BINARY_DIR}/googletest-src -- ${CMAKE_CURRENT_BINARY_DIR}/googletest-build -- EXCLUDE_FROM_ALL --) -+ add_subdirectory( -+ ${CMAKE_CURRENT_BINARY_DIR}/googletest-src -+ ${CMAKE_CURRENT_BINARY_DIR}/googletest-build -+ EXCLUDE_FROM_ALL -+ ) -+endif() - - if (MSVC AND (GSL_CXX_STANDARD EQUAL 17)) - set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-) -@@ -149,7 +154,7 @@ function(add_gsl_test name) - target_link_libraries(${name} - GSL - gsl_tests_config -- gtest_main -+ ${GTestMain_LIBRARIES} - ) - add_test( - ${name} -@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name) - target_link_libraries(${name} - GSL - gsl_tests_config_noexcept -- gtest_main -+ ${GTestMain_LIBRARIES} - ) - add_test( - ${name} diff --git a/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch b/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch deleted file mode 100644 index 0629212688..0000000000 --- a/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch +++ /dev/null @@ -1,126 +0,0 @@ -Description: Move tests that trigger -Warray-bounds to separate compilation unit - GCC 10 is now smart enough to detect violation of array boundaries that tests - are actually tested. Along with -Werror this led to tests failure, so I move - such tests to another compilation unit to have the warning deactivated for - only these tests. -Bug-Debian: https://bugs.debian.org/966895 -Author: Nicholas Guriev -Last-Modified: Wed, 19 Aug 2020 08:55:52 +0300 - ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -179,6 +179,7 @@ add_gsl_test(owner_tests) - add_gsl_test(byte_tests) - add_gsl_test(algorithm_tests) - add_gsl_test(strict_notnull_tests) -+add_gsl_test(array_bounds) - - - # No exception tests ---- /dev/null -+++ b/tests/array_bounds.cpp -@@ -0,0 +1,68 @@ -+/////////////////////////////////////////////////////////////////////////////// -+// -+// Copyright (c) 2015 Microsoft Corporation. All rights reserved. -+// -+// This code is licensed under the MIT License (MIT). -+// -+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -+// THE SOFTWARE. -+// -+/////////////////////////////////////////////////////////////////////////////// -+ -+#ifdef __GNUC__ -+#pragma GCC diagnostic warning "-Warray-bounds" -+#endif // __GNUC__ -+ -+#include -+ -+#include // for gsl::multi_span -+ -+namespace gsl -+{ -+struct fail_fast; -+} // namespace gsl -+ -+namespace -+{ -+static constexpr char deathstring[] = "Expected Death"; -+} // namespace -+ -+TEST(array_bounds, subspan_from_multi_span_test) -+{ -+ int arr[5] = {1, 2, 3, 4, 5}; -+ gsl::multi_span av = arr; -+ -+ std::set_terminate([] { -+ std::cerr << "Expected Death. subspan"; -+ std::abort(); -+ }); -+ -+ EXPECT_DEATH(av.subspan(6).length(), deathstring); -+} -+ -+TEST(array_bounds, strided_span_bounds_from_strided_span_tests) -+{ -+ int arr[] = {0, 1, 2, 3}; -+ gsl::multi_span av(arr); -+ -+ std::set_terminate([] { -+ std::cerr << "Expected Death. strided_span_bounds"; -+ std::abort(); -+ }); -+ -+ // incorrect sections -+ EXPECT_DEATH(av.section(0, 0)[0], deathstring); -+ EXPECT_DEATH(av.section(1, 0)[0], deathstring); -+ EXPECT_DEATH(av.section(1, 1)[1], deathstring); -+ -+ EXPECT_DEATH(av.section(2, 5), deathstring); -+ EXPECT_DEATH(av.section(5, 2), deathstring); -+ EXPECT_DEATH(av.section(5, 0), deathstring); -+ EXPECT_DEATH(av.section(0, 5), deathstring); -+ EXPECT_DEATH(av.section(5, 5), deathstring); -+} ---- a/tests/multi_span_tests.cpp -+++ b/tests/multi_span_tests.cpp -@@ -1042,10 +1042,6 @@ TEST(multi_span_test, subspan) - EXPECT_TRUE(av.subspan(1).length() == 4); - EXPECT_TRUE(av.subspan(4).length() == 1); - EXPECT_TRUE(av.subspan(5).length() == 0); -- // Disabled test instead of fixing since multi_span is deprecated. (PR#835) --#if !(defined(__GNUC__) && __GNUC__ == 8) -- EXPECT_DEATH(av.subspan(6).length(), deathstring); --#endif - auto av2 = av.subspan(1); - for (int i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2); - } ---- a/tests/strided_span_tests.cpp -+++ b/tests/strided_span_tests.cpp -@@ -403,20 +403,6 @@ TEST(strided_span_tests, strided_span_bo - }); - - { -- // incorrect sections -- -- EXPECT_DEATH(av.section(0, 0)[0], deathstring); -- EXPECT_DEATH(av.section(1, 0)[0], deathstring); -- EXPECT_DEATH(av.section(1, 1)[1], deathstring); -- -- EXPECT_DEATH(av.section(2, 5), deathstring); -- EXPECT_DEATH(av.section(5, 2), deathstring); -- EXPECT_DEATH(av.section(5, 0), deathstring); -- EXPECT_DEATH(av.section(0, 5), deathstring); -- EXPECT_DEATH(av.section(5, 5), deathstring); -- } -- -- { - // zero stride - strided_span sav{av, {{4}, {}}}; - EXPECT_TRUE(sav[0] == 0);