From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aPbKAxrHGWJKVwEAgWs5BA (envelope-from ) for ; Sat, 26 Feb 2022 07:22:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id vTUGOBnHGWKB+wAAG6o9tA (envelope-from ) for ; Sat, 26 Feb 2022 07:22:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A125A3507A for ; Sat, 26 Feb 2022 07:22:17 +0100 (CET) Received: from localhost ([::1]:47352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNqT9-0006XG-UM for larch@yhetil.org; Sat, 26 Feb 2022 01:22:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNqSw-0006X0-4k for guix-patches@gnu.org; Sat, 26 Feb 2022 01:22:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60259) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNqSv-0002aQ-Sy for guix-patches@gnu.org; Sat, 26 Feb 2022 01:22:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNqSv-0000JQ-Ix for guix-patches@gnu.org; Sat, 26 Feb 2022 01:22:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53676] [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Feb 2022 06:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53676 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 53676@debbugs.gnu.org Received: via spool by 53676-submit@debbugs.gnu.org id=B53676.16458565141185 (code B ref 53676); Sat, 26 Feb 2022 06:22:01 +0000 Received: (at 53676) by debbugs.gnu.org; 26 Feb 2022 06:21:54 +0000 Received: from localhost ([127.0.0.1]:54156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNqSn-0000J2-Vu for submit@debbugs.gnu.org; Sat, 26 Feb 2022 01:21:54 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:35674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNqSl-0000Io-Kb for 53676@debbugs.gnu.org; Sat, 26 Feb 2022 01:21:52 -0500 Received: by mail-qt1-f175.google.com with SMTP id w1so4505142qtj.2 for <53676@debbugs.gnu.org>; Fri, 25 Feb 2022 22:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=3LzqYJ2krX80Q0UCBCDoLASCeCh8PcHXgdnCj+9s5sY=; b=dfJnqJBFQ9eujJDHkNgJKJUFSnAhMBDtoJ7vwu3kH/deb1TgkghPvp96lK3VdF/7A2 5xQTpwy3/U0At7y+N/gva0aISnlTXHYoLwLxD5Mhpt4mc87wADJ3JeXtm/urKIviwjoK YezGRUiES6tDVM6EkDlqe5PYffoxNoQuT/e4f2IPcp/GLHo2K85UALLN9YR9eU4Cfeib oKSjvhQeBENSoCHj42h9hUrRLVpoh1Yt/hJ1/baK7/YaZk5fWqfBwUWfhK5KP6aJr7tc yKnZTke12P2eQobPCnXD6aRy0+xV3m6YHaeNSO+m2+HwR9wbF+6YNkShOL4AForu3+0g 2IQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=3LzqYJ2krX80Q0UCBCDoLASCeCh8PcHXgdnCj+9s5sY=; b=g9OPfQcDD+1JwjoO11tEKALEzAb6dKPLi4//aBjMrxQP1kYmaIxaKnSKPJsuUHjAJw gwxWMofSa9afUFKDcGTErsjtsaJ4DGdS3mknNUMpN4z771HSS0+obLLWa38KVcuOr8o3 H3Ibz4znmn5Vf+JWxVgZT55g3xhjvczCsCkTpJPj1dRYokLri5AQ0t4pdeUlUYA0YR7O wvK9zsjIJNbpWpHlvJEskE+vmtgbVwGXepw5YMRJfA9olRCINbr0Xc+yXnrByBkBjo67 cnc2gGPohRuFzX0PzBhh59FU9PpeNBc3Qb2ZephmK98qD17JcQ7/S2wYqf44KLKU1t93 JLoQ== X-Gm-Message-State: AOAM533hDll5ViUc4UBTMLW3iKBmfaK2HCv8NVBrKCGDAV0PE1Uu3HHd kHFLDleqrhRggCz2WCSP5fKPImwYGuzZRQ== X-Google-Smtp-Source: ABdhPJx1oMwMUqnYOYdeoY7dUkDbBTjXDPrlICNn6U7kUOhRUtv85oMkP/xtEU9OIrKLjqaMA8j7wg== X-Received: by 2002:ac8:570d:0:b0:2dd:97c8:e413 with SMTP id 13-20020ac8570d000000b002dd97c8e413mr9802236qtw.3.1645856505814; Fri, 25 Feb 2022 22:21:45 -0800 (PST) Received: from hurd (dsl-149-67.b2b2c.ca. [66.158.149.67]) by smtp.gmail.com with ESMTPSA id 194-20020a3706cb000000b005081e1550c8sm2211679qkg.78.2022.02.25.22.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 22:21:45 -0800 (PST) From: Maxim Cournoyer References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> <877d9j2ad9.fsf@gmail.com> <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> Date: Sat, 26 Feb 2022 01:21:44 -0500 In-Reply-To: <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 25 Feb 2022 06:20:37 +0100") Message-ID: <87zgmew3k7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645856537; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=3LzqYJ2krX80Q0UCBCDoLASCeCh8PcHXgdnCj+9s5sY=; b=Q1GIvwT2J5V/SRUs4mbAWY1JMMH7wof2Tj58UAcaCDmTQV8vpv17wbuen/hrlcIOSxX/is JZQBBofLb6i2D43MtwjjOKyPoM5vZTuHfxBpwO3Py5GlejyIl935K9cTP2ld9fruzWiHc6 l4QtoZoF3qKWPioc0DdFtpi+wzY97kXcUL4Oy1tex9aaZE840PQm4i/x9p0fhTK164JCtr 8Fw5XhUT2M0jauJSiC1zPW+fEKyF/2ZzSPvRiluGtQkIVsrXN5YwwKcDDkxUaYXDXvNPxJ hvdxeg9itRWelHT0q9nlE2sFS/C+1jW7aoGwbd+6nCs9ttMW+nuJhml5i71vZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645856537; a=rsa-sha256; cv=none; b=FdFR5VrF5cJTihd22l1rSmDG0zjiQKmgecFGoQyLt9+GesaUhg8lNqHV6AGXP+NCp6iZW5 xUtiPhz3KMBQ21mTw+Gke1Sc6A0cvIOMcOsf2cWshQNxbNpd5OxoXU3IVbN5ZAWKdEtp/8 mA3BH5hwjQxwd6Nfg1vKPvCrqkd+p09Dwo0ao9yUlnpHX5oknnJIi/6Yix1o4yhP+kOVfL HMU89emkfiRTuVPP6AhAANhlPbSljcIMWCe8sqt04HY2FZo/Ai3AiOMnYczopsNIZOH8IJ sRBEbPeiVVThZXETYi9HbsuBhTdZV9bi5Lfp4TUw5Qov5okrro0Y5bEuIbsm8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dfJnqJBF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.38 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dfJnqJBF; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A125A3507A X-Spam-Score: 5.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: uBqSHr/hPfjn Hi Liliana, Liliana Marie Prikler writes: > Hi Maxim, > > Am Donnerstag, dem 24.02.2022 um 17:00 -0500 schrieb Maxim Cournoyer: >> Thank you for your continued feedback.=C2=A0 The reason I prefer this >> simple substitution to a conditional one is two-fold: >>=20 >> 1. It avoids two actors potentially touching the default 'script- >> file' (the pulseaudio-service-type code as well as the user), which >> could be unwieldy (do we plug the default.pa.d after their changes to >> ensure it is there, or before, which means it'd potentially be >> erased?).=C2=A0 Having it part of the shipped default.pa file makes this >> simpler to reason with. > Sure, but all we'd need here is proper documentation. For the record, > I would check if a `source /etc/pulse/default.pa.d' is in the user- > supplied file (even if commented) and append it if not. OK; I went a bit dumber/safer: when extra-script-files is non-null, the .include is appended. >> 2. It allows foreign distribution users to keep their custom user >> script working even when they use our pulseaudio package (it makes >> our pulseaudio package behave as intended by upstream). > That ignores the case where users modify their distro's default.pa > *and* put stuff into default.pa.d. This might be necessary in some > scenarios where the upstream default breaks user expectations. I'd > really prefer if foreign distro users just set their environment > variables, as those work unconditionally as intended. That sounds a bit hypothetical, but yes, it's a possibility. >> I wouldn't mind using a feature branch to get the < 2k dependent >> packages rebuilt as suggested by Leo, if you think that's preferable. > That would work for the rebuilds, making this not a graft, but I'm > still concerned whether we really want these semantics or not. With > the WebkitGTK bug fixed, we can put our generated default.pa into /etc > again, making it more debuggable. My personal opinion is still on > explicitly declared rather than implicitly assumed. OK, if we want to add the .include conditionally, I'd go with something like: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -21507,7 +21507,10 @@ List of settings to set in @file{daemon.conf}, for= matted just like @var{client-conf}. =20 @item @code{script-file} (default: @code{(file-append pulseaudio "/etc/pul= se/default.pa")}) -Script file to use as @file{default.pa}. +Script file to use as @file{default.pa}. In case the +@code{extra-script-files} field below is used, an @code{.include} +directive pointing to @file{/etc/pulse/default.pa.d} is appended to the +provided script. =20 @item @code{extra-script-files} (default: @code{'())}) A list of file-like objects defining extra PulseAudio scripts to run at modified gnu/services/sound.scm @@ -174,6 +174,21 @@ (define (assert-pulseaudio-script-file-name name) extra-script-files))) (file-union "default.pa.d" (zip labels extra-script-files)))) =20 +(define (append-include-directive script-file) + "Append an include directive to source scripts under /etc/pulse/default.= pa.d." + (computed-file "default.pa" + #~(begin + (use-modules (ice-9 textual-ports)) + (define script-text + (call-with-input-file #$script-file get-string-all)) + (call-with-output-file #$output + (lambda (port) + (format port (string-append script-text + " +# Added by Guix to include scripts specified in extra-script-files. +.nofail +.include /etc/pulse/default.pa.d~%"))))))) + (define pulseaudio-etc (match-lambda (($ client-conf daemon-conf default-script-= file @@ -181,7 +196,10 @@ (define pulseaudio-etc `(("pulse" ,(file-union "pulse" - `(("default.pa" ,default-script-file) + `(("default.pa" + ,(if (null? extra-script-files) + default-script-file + (append-include-directive default-script-file))) ("system.pa" ,system-script-file) ,@(if (null? extra-script-files) '() --8<---------------cut here---------------end--------------->8--- A mixed-file as you used previously (combining two .include) could have been used, but I prefer to have the content directly visible under /etc/pulse/default.pa (and the shebang line preserved). This gets rid of the change on the pulseaudio package itself. What do you think? Thank you, Maxim