unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Olivier Dion <olivier.dion@polymtl.ca>, 54780@debbugs.gnu.org
Subject: [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies.
Date: Fri, 08 Apr 2022 16:04:16 +0200	[thread overview]
Message-ID: <c577e000949d06a83288f2eed04825a90ff696af.camel@telenet.be> (raw)
In-Reply-To: <3afb4ed9e9446906504f781dcf047160491ddfff.1649377087.git.olivier.dion@polymtl.ca>


[-- Attachment #1.1: Type: text/plain, Size: 531 bytes --]

Olivier Dion via Guix-patches via schreef op do 07-04-2022 om 20:18 [-
0400]:
> Headers of liburcu are used by headers of lttng.

This can be addressed without propagation, by substitute*.  Something
like:

  (lambda* (#:key inputs #:allow-other-keys)
    (substitute* (find-files ".h")
      (("some-liburcu-header.h")
       (search-input-file inputs "include/some-liburcu-header.h"))))

Attached is some more generic and automated code I wrote a while ago.
Maybe it's good enough for lttng?

Greetings,
Maxime.

[-- Attachment #1.2: absolute-inclusions.scm --]
[-- Type: text/x-scheme, Size: 2100 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(define-module (guix build absolute-inclusions)
  #:export (absolute-inclusions patch-header-inclusions)
  #:use-module (guix build utils)
  #:use-module (ice-9 match)
  #:use-module (rnrs exceptions))

(define (absolute-inclusions files header-locations)
  (substitute* files
    ;; TODO: allow spaces before the < or include, maybe recognise #include
    ;; "foo" ...
    (("#include <(.*)>" 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* (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))
  ;; TODO: are there also other header names in use?
  (define header-file? (file-name-predicate "\\.(h|hpp)$"))
  (for-each (match-lambda
              ((_ . output)
               (absolute-inclusions
                (find-files (string-append output "/include") header-file?)
                header-locations)))
            outputs))

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-04-08 14:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  0:18 [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies Olivier Dion via Guix-patches via
2022-04-08 14:04 ` Maxime Devos [this message]
2022-04-08 14:23   ` Olivier Dion via Guix-patches via
2022-04-08 14:28     ` Olivier Dion via Guix-patches via
2022-04-08 15:32       ` [bug#54780] (C include header depropagation) " Maxime Devos
2022-04-08 15:39       ` Maxime Devos
2022-04-08 15:59         ` Olivier Dion via Guix-patches via
2022-04-08 17:17         ` Olivier Dion via Guix-patches via
2022-04-08 19:41           ` Maxime Devos
2022-04-08 22:56             ` Olivier Dion via Guix-patches via
2022-04-08 23:15               ` [bug#54780] [PATCH v2 1/2] guix: build: Add absolute-inclusions.scm Olivier Dion via Guix-patches via
2022-04-21 16:46                 ` [bug#54780] [PATCH v3 " Olivier Dion via Guix-patches via
2022-04-21 16:46                 ` [bug#54780] [PATCH v3 2/2] gnu: packages: Use absolute headers inclusion Olivier Dion via Guix-patches via
2022-04-08 23:15               ` [bug#54780] [PATCH v2 " Olivier Dion via Guix-patches via
2022-04-09  9:11               ` [bug#54780] [PATCH] gnu: lttng-ust: Fix dependencies Maxime Devos
2022-04-09  9:13                 ` Maxime Devos
2022-04-09 14:40                   ` Olivier Dion via Guix-patches via
2022-04-09 16:01                     ` Maxime Devos
2022-04-09 16:34                       ` Olivier Dion via Guix-patches via
2022-04-08 15:23     ` Maxime Devos
2022-05-17 20:38 ` Olivier Dion via Guix-patches via
2022-06-14 21:26   ` bug#54780: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c577e000949d06a83288f2eed04825a90ff696af.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=54780@debbugs.gnu.org \
    --cc=olivier.dion@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).