From patchwork Fri Apr 8 23:15:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Olivier Dion X-Patchwork-Id: 38456 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 2095627BBEB; Sat, 9 Apr 2022 00:16:23 +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 C7C7827BBE9 for ; Sat, 9 Apr 2022 00:16:22 +0100 (BST) Received: from localhost ([::1]:54506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncxq1-000150-VI for patchwork@mira.cbaines.net; Fri, 08 Apr 2022 19:16:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncxpi-00014e-Fu for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncxpi-0003k4-79 for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ncxpi-0004ne-2G for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54780] [PATCH v2 1/2] guix: build: Add absolute-inclusions.scm. Resent-From: Olivier Dion Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Apr 2022 23:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54780 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Olivier Dion , Maxime Devos , 54780@debbugs.gnu.org Received: via spool by 54780-submit@debbugs.gnu.org id=B54780.164945974118415 (code B ref 54780); Fri, 08 Apr 2022 23:16:02 +0000 Received: (at 54780) by debbugs.gnu.org; 8 Apr 2022 23:15:41 +0000 Received: from localhost ([127.0.0.1]:36277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncxpN-0004mw-AS for submit@debbugs.gnu.org; Fri, 08 Apr 2022 19:15:41 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:48625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncxpL-0004mY-64 for 54780@debbugs.gnu.org; Fri, 08 Apr 2022 19:15:39 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 238NFOOG032495 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 8 Apr 2022 19:15:32 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 238NFOOG032495 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1649459733; bh=TCzed2oCGaucY8qT+ju2eKl/nQUoGndQUISZrEph/cY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gRrn8ZdxO3d/jNtmjy+7XO6X7pj0qmIt673uaiNT6xVdd714+eAkXMsMTJYtW0vhR fz11+/68d3UvSvgqSOt+30zgJyiIh9k0S4wWIHmAbt42HVE10bC7D/7itDGy6Aczz5 vQB6cmUCZ4v+IWgaL5GmD7zduxJWIPpwnPBrw9L8= Date: Fri, 8 Apr 2022 19:15:22 -0400 Message-Id: <4b19827ee0d266ecd80dc7c5d776f3ffd764a575.1649459701.git.olivier.dion@polymtl.ca> X-Mailer: git-send-email 2.34.0 In-Reply-To: <87lewfuqtk.fsf@laura> References: <87lewfuqtk.fsf@laura> MIME-Version: 1.0 X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Fri, 8 Apr 2022 23:15:24 +0000 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" Reply-to: Olivier Dion X-ACL-Warn: , Olivier Dion via Guix-patches X-Patchwork-Original-From: Olivier Dion via Guix-patches via From: Olivier Dion X-getmail-retrieved-from-mailbox: Patches * guix/build/absolute-inclusions.scm: New file. * Makefile.am (MODULES): Add it here. --- Makefile.am | 1 + guix/build/absolute-inclusions.scm | 51 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 guix/build/absolute-inclusions.scm diff --git a/Makefile.am b/Makefile.am index fecce7c6f7..394df67016 100644 --- a/Makefile.am +++ b/Makefile.am @@ -181,6 +181,7 @@ MODULES = \ guix/diagnostics.scm \ guix/ui.scm \ guix/status.scm \ + guix/build/absolute-inclusions.scm \ guix/build/android-ndk-build-system.scm \ guix/build/ant-build-system.scm \ guix/build/download.scm \ diff --git a/guix/build/absolute-inclusions.scm b/guix/build/absolute-inclusions.scm new file mode 100644 index 0000000000..06b4cd7beb --- /dev/null +++ b/guix/build/absolute-inclusions.scm @@ -0,0 +1,51 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Maxime Devos +;;; Copyright © 2022 Olivier Dion +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build absolute-inclusions) + #:use-module (guix build utils) + #:use-module (ice-9 match) + #:use-module (rnrs exceptions) + #:export (absolute-inclusions patch-header-inclusions)) + +(define (absolute-inclusions files header-locations) + (substitute* files + (("^[ \t]*#[ \t]*include[ \t]*<(.*)>[ \t]*" original header-name) + (guard (c ((search-error? c) original)) + ;; TODO: verify with libgcc & etc, maybe avoid increasing the + ;; closure size by skipping glibc and linux headers ... + (format #f "#include <~a>" + (search-input-file header-locations + (string-append "include/" header-name))))))) + +(define header-file? + ;; See gcc(1) for the list of suffixes. + (let ((suffixes (list "h" "hh" "H" "hp" "hxx" "hpp" "HPP" "h++" "tcc"))) + (file-name-predicate + (format #f "\\.(~a)$" (string-join suffixes "|" 'infix))))) + +(define* (patch-header-inclusions #:key inputs outputs #:allow-other-keys) + "Patch inclusions in C headers in OUTPUTS to use absolute file names." + (define header-locations (append outputs inputs)) + (for-each (match-lambda + ((_ . output) + (absolute-inclusions + (find-files (string-append output "/include") + header-file?) + header-locations))) + outputs)) From patchwork Fri Apr 8 23:15:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Dion X-Patchwork-Id: 38457 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 6ACCC27BBE9; Sat, 9 Apr 2022 00:16:23 +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 1CD4727BBEA for ; Sat, 9 Apr 2022 00:16:23 +0100 (BST) Received: from localhost ([::1]:54514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncxq2-00015d-7h for patchwork@mira.cbaines.net; Fri, 08 Apr 2022 19:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncxpj-00014g-0I for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncxpi-0003k9-Kh for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ncxpi-0004nn-F2 for guix-patches@gnu.org; Fri, 08 Apr 2022 19:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54780] [PATCH v2 2/2] gnu: packages: Use absolute headers inclusion. Resent-From: Olivier Dion Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Apr 2022 23:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54780 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Olivier Dion , Maxime Devos , 54780@debbugs.gnu.org Received: via spool by 54780-submit@debbugs.gnu.org id=B54780.164945974418424 (code B ref 54780); Fri, 08 Apr 2022 23:16:02 +0000 Received: (at 54780) by debbugs.gnu.org; 8 Apr 2022 23:15:44 +0000 Received: from localhost ([127.0.0.1]:36279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncxpP-0004n6-Oj for submit@debbugs.gnu.org; Fri, 08 Apr 2022 19:15:44 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:57875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncxpL-0004md-TY for 54780@debbugs.gnu.org; Fri, 08 Apr 2022 19:15:40 -0400 Received: from laura.hitronhub.home (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 238NFOOH032495 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 8 Apr 2022 19:15:33 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 238NFOOH032495 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1649459734; bh=gXlbJq8Fec9q6kndZpAQXdOuLpMaxtzBWMUpNOLrMe4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vZC5OYcp9r1WLfE8SHl4V8tfd8BCUIF4NFVfv8IiUXYs1J27OnsSMw4IoeJ/RJp7L MK8C8POWJ1u0+HpGNzMXhaejCpvr5C5hi2YwVrbq16/hb0JyKfRBHvT7Z1aShDmI/x Yt4ee40xY1uHLmCNno3/fFT9gnr3CXF5GfDeYyI4= Date: Fri, 8 Apr 2022 19:15:23 -0400 Message-Id: X-Mailer: git-send-email 2.34.0 In-Reply-To: <87lewfuqtk.fsf@laura> References: <87lewfuqtk.fsf@laura> MIME-Version: 1.0 X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Fri, 8 Apr 2022 23:15:24 +0000 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" Reply-to: Olivier Dion X-ACL-Warn: , Olivier Dion via Guix-patches X-Patchwork-Original-From: Olivier Dion via Guix-patches via From: Olivier Dion X-getmail-retrieved-from-mailbox: Patches * gnu/packages/instrumentation.scm (lttng-ust): [phases]: Add absolute-inclusions. * gnu/packages/datastructures.scm (liburcu): [phases]: Add absolute-inclusions. --- gnu/packages/datastructures.scm | 11 +++++++++++ gnu/packages/instrumentation.scm | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm index f247231ecf..042fc8114e 100644 --- a/gnu/packages/datastructures.scm +++ b/gnu/packages/datastructures.scm @@ -26,6 +26,7 @@ (define-module (gnu packages datastructures) #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages perl) + #:use-module (guix gexp) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) @@ -146,6 +147,16 @@ (define-public liburcu (base32 "10rh6v9j13622cjlzx31cfpghjy0kqkvn6pb42whwwcg5cyz64rj")))) (build-system gnu-build-system) + (arguments + (list #:imported-modules + `(,@%gnu-build-system-modules (guix build absolute-inclusions)) + #:modules '((guix build gnu-build-system) + (guix build absolute-inclusions) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'absolute-inclusions + patch-header-inclusions)))) (native-inputs (list perl)) ; for tests (home-page "https://liburcu.org/") diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm index ab986bfcc7..672189a068 100644 --- a/gnu/packages/instrumentation.scm +++ b/gnu/packages/instrumentation.scm @@ -215,6 +215,17 @@ (define-public lttng-ust (build-system gnu-build-system) (inputs (list liburcu numactl)) + (arguments + (list + #:imported-modules + `(,@%gnu-build-system-modules (guix build absolute-inclusions)) + #:modules '((guix build gnu-build-system) + (guix build absolute-inclusions) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'absolute-inclusions + patch-header-inclusions)))) (native-inputs (list python-3 pkg-config)) (home-page "https://lttng.org/")