From patchwork Sat Jun 29 06:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 65748 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 3AEDD27BBEA; Sat, 29 Jun 2024 08:04:36 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 6A15927BBE2 for ; Sat, 29 Jun 2024 08:04:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNS8D-00069I-FX; Sat, 29 Jun 2024 03:04:21 -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 1sNS7u-00066b-Qm for guix-patches@gnu.org; Sat, 29 Jun 2024 03:04:11 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNS7u-0005Pi-HK for guix-patches@gnu.org; Sat, 29 Jun 2024 03:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNS7t-00067t-So for guix-patches@gnu.org; Sat, 29 Jun 2024 03:04:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71837] [PATCH] gnu: clasp: Prevent ID clashes in dependent packages. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 29 Jun 2024 07:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71837 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71837@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171964460523503 (code B ref -1); Sat, 29 Jun 2024 07:04:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Jun 2024 07:03:25 +0000 Received: from localhost ([127.0.0.1]:36865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNS7I-000671-G1 for submit@debbugs.gnu.org; Sat, 29 Jun 2024 03:03:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:46118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNS7G-00066q-Ao for submit@debbugs.gnu.org; Sat, 29 Jun 2024 03:03:23 -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 1sNS76-0005v6-Qh for guix-patches@gnu.org; Sat, 29 Jun 2024 03:03:17 -0400 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNS73-0005IA-Qe for guix-patches@gnu.org; Sat, 29 Jun 2024 03:03:12 -0400 Received: by mail-lf1-x144.google.com with SMTP id 2adb3069b0e04-52cd717ec07so1653750e87.0 for ; Sat, 29 Jun 2024 00:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719644586; x=1720249386; darn=gnu.org; h=to:content-transfer-encoding:mime-version:subject:date:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Irh8aGkbR2fVFAQQAelVxeczKXJPoi6A8D/3X3zLl9Y=; b=SbTC6TfQG+uVpyNwo9SLrRyDp8zlMoktcWwiAzH0s2VklvTbBxvgpdTDMQOpiCTj9x fba0K4Maz0nO6O6id8wgQ3+k8MHci0PHAjSAHkDJ4g2DP/FfdpFW7Uq9WOQADfkAlScz ew9cqFhmEg4NUsxXAs+1PnM8jaYqtoXlTF6eWR/FL4D+LN1vOQbD1vwBRgPhnvptgLOW j8scmjBXtqTOzDXLD5ETWNhVGDQbKzD6nfAydEZA8jLB3KrRtTpWyQyz2frtoQGFmkiM 0ioR/I254nSFj093UQv9MGtC6BHaQd4pPCoYDAIHGOGgaca/Wd1L1od3H+R4syQMWV1C fxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719644586; x=1720249386; h=to:content-transfer-encoding:mime-version:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Irh8aGkbR2fVFAQQAelVxeczKXJPoi6A8D/3X3zLl9Y=; b=rFm5rTXQfpqbmt5h3ker+0jUfJkxb2pYqB1A0q4cWx55rAhlQ8ic4XADPj+R5sLv7Z Ept9UiaLGbcBis639LWB3FygPD+2AJ4zdPkPM53JyztGYTCvEYTkP9LkrZBGQ2S47XKv cAgntXXLDtMk9gL2hiQKCp74cUKPGHh8ZorJ4m9y757LndZmHSmgD5kCZHJvZaG3oBjO r9iqjROD+DTQ7hmTo0tyERUgLCShmQSirrXsVJlpL5ecpM1q1onSMkubIyt29C4JSlOx 040H2mcUSyTaW9irU+kBp0af+cN+K5DECOimWTKEApwqvw37kTPaP367VwOvt1Jy1L6T GsVg== X-Gm-Message-State: AOJu0Yw2uLj0cSGWtT5bISZtFzoIleVDl/snzRpGB+/lTBzbKh9gThwA v2W925KsorH/FxSFXN9gobCv878Pr5+fNO5HY/eCBiv4vssu3ahRdtYfCc6V X-Google-Smtp-Source: AGHT+IEL+wuD9ADwfzub5GmxPnDK8ELqcL8zQspNADNGJP13zitt3PYoIEdVz0oz+NHSL9qHGOU4fw== X-Received: by 2002:a05:6512:2255:b0:52c:dbe2:69ba with SMTP id 2adb3069b0e04-52e82691abemr319152e87.33.1719644585874; Sat, 29 Jun 2024 00:03:05 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72b23de040sm106786466b.162.2024.06.29.00.03.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jun 2024 00:03:05 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Sat, 29 Jun 2024 08:53:54 +0200 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::144; envelope-from=liliana.prikler@gmail.com; helo=mail-lf1-x144.google.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MALFORMED_FREEMAIL=2.558, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , 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 Clasp uses an interesting CRTP pattern to insert statically (i.e. compile-time) generated numeric IDs into global fields. However, these templates are instantiated once per shared library---thus, whenever a library is linked, new IDs are generated, and the original intent (safely type-casting objects across libraries) is lost. To help the linker out, we make sure that these IDs are only instantiated in clasp and not when building other libraries. * gnu/packages/patches/clasp-hide-event-ids.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/clasp.scm (source)[patches]: Add it here. (clingo)[#:phases]: Drop ‘skip-failing-tests’. (python-clorm)[#:phases]: Adjust accordingly. (python-clintest): Drop arguments. --- gnu/local.mk | 1 + .../patches/clasp-hide-event-ids.patch | 41 +++++++++++++++++++ gnu/packages/potassco.scm | 31 ++------------ 3 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 gnu/packages/patches/clasp-hide-event-ids.patch base-commit: 01ea5ebc71a5f104af2ed220cb29f88523298ca7 diff --git a/gnu/local.mk b/gnu/local.mk index d0cc62dd57..de13a0794e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1063,6 +1063,7 @@ dist_patch_DATA = \ %D%/packages/patches/clang-runtime-3.7-fix-build-with-python3.patch \ %D%/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch \ %D%/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch \ + %D%/packages/patches/clasp-hide-event-ids.patch \ %D%/packages/patches/classpath-aarch64-support.patch \ %D%/packages/patches/classpath-miscompilation.patch \ %D%/packages/patches/cling-use-shared-library.patch \ diff --git a/gnu/packages/patches/clasp-hide-event-ids.patch b/gnu/packages/patches/clasp-hide-event-ids.patch new file mode 100644 index 0000000000..9587f9ff3f --- /dev/null +++ b/gnu/packages/patches/clasp-hide-event-ids.patch @@ -0,0 +1,41 @@ +From a4c4e4f3c410834c3e56f644841f5bcbb084225c Mon Sep 17 00:00:00 2001 +From: Liliana Marie Prikler +Date: Fri, 28 Jun 2024 11:15:16 +0200 +Subject: [PATCH] clasp: Hide Event_t::id_s. + +This patch helps build clingo with non-local clasp while keeping the +event system working as intended. +--- + clasp/util/misc_types.h | 2 ++ + src/CMakeLists.txt | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clasp/util/misc_types.h b/clasp/util/misc_types.h +index 3677873..09c2075 100644 +--- a/clasp/util/misc_types.h ++++ b/clasp/util/misc_types.h +@@ -432,7 +432,9 @@ struct Event_t : Event { + Event_t(Subsystem sys, Verbosity verb) : Event(sys, id_s, verb) {} + static const uint32 id_s; + }; ++#if _BUILDING_CLASP_ + template const uint32 Event_t::id_s = Event::nextId(); ++#endif + + template const ToType* event_cast(const EvType& ev) { return ev.id == ToType::id_s ? static_cast(&ev) : 0; } + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 8439d12..4f55990 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -123,6 +123,7 @@ source_group("${ide_header}\\mt" FILES ${header_mt}) + endif() + + add_library(libclasp ${header} ${header_util} ${header_cli} ${header_mt} ${src}) ++target_compile_definitions(libclasp PRIVATE _BUILDING_CLASP_) + if (CLASP_BUILD_WITH_THREADS) + target_link_libraries(libclasp PUBLIC Threads::Threads) + target_compile_options(libclasp PRIVATE +-- +2.45.1 + diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm index b7cfca2eec..5432fc10c3 100644 --- a/gnu/packages/potassco.scm +++ b/gnu/packages/potassco.scm @@ -112,6 +112,7 @@ (define-public clasp (url "https://github.com/potassco/clasp") (commit (string-append "v" version)))) (file-name (git-file-name name version)) + (patches (search-patches "clasp-hide-event-ids.patch")) (sha256 (base32 "0qap7rar8a5mkqz28n2hnvr4cfv5x0rh4zs3wdp919dw4d034chr")))) @@ -200,22 +201,7 @@ (define-public clingo (substitute* "cmake/ClingoConfig.cmake.in" (("find_package\\(Clasp") "find_package(clasp")) (rename-file "cmake/ClingoConfig.cmake.in" - "cmake/clingo-config.cmake.in"))) - (add-after 'unpack 'skip-failing-tests - (lambda _ - (with-directory-excursion "libclingo/tests" - (substitute* "CMakeLists.txt" - (("COMMAND test_clingo" all) - (string-append all - " -f " - "\"${CMAKE_CURRENT_SOURCE_DIR}/good.txt\""))) - (call-with-output-file "good.txt" - (lambda (port) - (for-each (lambda (test) (format port "~s~%" test)) - '("parse-ast-v2" "add-ast-v2" "build-ast-v2" - "unpool-ast-v2" "parse_term" - "propagator" "propgator-sequence-mining" - "symbol" "visitor")))))))))) + "cmake/clingo-config.cmake.in")))))) (inputs (list catch2-3 clasp libpotassco)) (native-inputs (list bison re2c mpark-variant @@ -465,10 +451,7 @@ (define-public python-clorm (lambda _ ;; noclingo tests rely on this being set (setenv "CLORM_NOCLINGO" "1") - (delete-file "tests/test_mypy_query.py") - (substitute* "tests/test_clingo.py" - (("self\\.assertTrue\\(os_called\\)" all) - (string-append "# " all)))))))) + (delete-file "tests/test_mypy_query.py")))))) (propagated-inputs (list python-clingo)) (native-inputs (list python-typing-extensions)) (home-page "https://potassco.org") @@ -627,14 +610,6 @@ (define-public python-clintest (base32 "0xzbby9ram55h87ykm652kgm45b8rlhbjc8gjkz308h1jnjllmmy")))) (build-system pyproject-build-system) - (arguments - (list #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'delete-failing-tests - (lambda _ - ;; XXX: Clingo statistics are broken in dependencies already. - (for-each delete-file '("tests/test_solver.py" - "tests/test_test.py"))))))) (inputs (list python-clingo)) (native-inputs (list python-pytest)) (home-page "https://potassco.org/clintest/")