From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GB3qIYgWVWQDzwAASxT56A (envelope-from ) for ; Fri, 05 May 2023 16:45:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iBbvIYgWVWQ5wQAAauVa8A (envelope-from ) for ; Fri, 05 May 2023 16:45:28 +0200 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 4E411ADA5 for ; Fri, 5 May 2023 16:45:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puwgD-000782-O0; Fri, 05 May 2023 10:45:05 -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 1puwgA-00077f-VP for bug-guix@gnu.org; Fri, 05 May 2023 10:45:03 -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 1puwgA-0000Yb-M6 for bug-guix@gnu.org; Fri, 05 May 2023 10:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puwgA-0002jL-Hi for bug-guix@gnu.org; Fri, 05 May 2023 10:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63082: [PATCH 14/17] services: mpd: Obsolete 'environment-variables' field. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 May 2023 14:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63082 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Bruno Victal Cc: 63082@debbugs.gnu.org Received: via spool by 63082-submit@debbugs.gnu.org id=B63082.168329789910470 (code B ref 63082); Fri, 05 May 2023 14:45:02 +0000 Received: (at 63082) by debbugs.gnu.org; 5 May 2023 14:44:59 +0000 Received: from localhost ([127.0.0.1]:57233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puwg7-0002io-C7 for submit@debbugs.gnu.org; Fri, 05 May 2023 10:44:59 -0400 Received: from mail-qk1-f173.google.com ([209.85.222.173]:51325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puwg5-0002iZ-Si for 63082@debbugs.gnu.org; Fri, 05 May 2023 10:44:58 -0400 Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-74e3de79bf2so165837385a.2 for <63082@debbugs.gnu.org>; Fri, 05 May 2023 07:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683297892; x=1685889892; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=uPzZFecG9yynhTEh/EiFe6rjXEVMwRYt+t5PddjzTX0=; b=A2X57e2Uj6nYGmglO2Pbkq0QB6FkcFTvRilLME/0miq4LOHCY33GjIPugNWdk7BWks AusdE1O1f645JmkCIcCCbB2285UggmyKaSE2T+x4wfF2axuu9pkCSk8lU9aFrzGy7LxK oyIJscLMG7gxxBQVeaW/E5IpnQSLvTpKG9tDCDdv+IZSj3K0iI5G62gESH+fXi2wl5Vi 5Me3Vy21EIXsH8FAQD0HF7btuOd/q8njz1pHGgbt5M6L0/JM46LkszaW88Z3/dxWJCNp Mcpe8sZ6lTLY9stB9rrj35QHaG+HA9rGP1LXj4VUpqKIT+JWIZuON0CtYio0jcOfnYYW SpcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683297892; x=1685889892; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uPzZFecG9yynhTEh/EiFe6rjXEVMwRYt+t5PddjzTX0=; b=PLm3PGftDmms5lR7ve1NTuMh7BDPzOCvqAtnjiiDDATtNwEKNGFZfRntYZVtvagCcR o4SNM0laGeIirwVbGVuZuxeyDNVMihGF21AVSvn9LkmOT0zVPiiqRFc6+OWsOPYlV1uj sxmt9+UEzBtPyE2bX6t+C6cYUsuKJhR+jerJu0WkqTM4AZ0odMJxRB8/kV7CUO22EhKf Ijpt7Lu4ZLJES1D6Gm/rrx8oAMkUoSAKUP7UrDoSN5OOzyE/Ve6lpSofRnyO/hIDRzz6 MwbUuhHLhUmlQIhXWHb6LHq9V5uZMDR2KnadwEnN2uHWj6Q+wun5CQZcQXDp4tYi36tJ /L3Q== X-Gm-Message-State: AC+VfDytRvTSDEX5wtV6xlUnSl+8jJfYFRTLIaH0tDbvs5BFMI3n73VA GV/d9LqEHwl+IJZxQqehP5dpvKPF/ug= X-Google-Smtp-Source: ACHHUZ7GpR2VE1wIjPAj2AQoOwjgfnenYRuoHaLuJU0OC5tLJlhjwwPf9SdZ2c6Ss+K5/9Dj0x7O+w== X-Received: by 2002:ac8:5fc1:0:b0:3ef:6577:7f90 with SMTP id k1-20020ac85fc1000000b003ef65777f90mr2576636qta.26.1683297892090; Fri, 05 May 2023 07:44:52 -0700 (PDT) Received: from hurd (dsl-205-236-230-162.b2b2c.ca. [205.236.230.162]) by smtp.gmail.com with ESMTPSA id u2-20020a05622a198200b003e69d6792f6sm665939qtc.45.2023.05.05.07.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 07:44:51 -0700 (PDT) From: Maxim Cournoyer References: <16e06b4b2a932a7c48696fcc1b89c5a454dc9d2b.1682690696.git.maxim.cournoyer@gmail.com> <2fabf610-5256-dad1-0e62-449fbcc738f0@makinata.eu> <874joyaad3.fsf@gmail.com> <2e5d3ddb-5948-de11-4fa5-da02e848a8e6@makinata.eu> <87h6su1944.fsf@gmail.com> Date: Fri, 05 May 2023 10:44:50 -0400 In-Reply-To: (Bruno Victal's message of "Thu, 4 May 2023 17:21:10 +0100") Message-ID: <87ild64z31.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683297928; a=rsa-sha256; cv=none; b=a55Arn6h2wHSsYUZgx2h5zbqHbam2bO9cYyjFKOhHujPO7hoP47JMGZRoIwELH1RSfuexg BXA8XHNUV2UL/4KnPK78VPug4nuHJOnK9xssuYvuUkrSWx5ckQH+EPtoCFhgJcZrXPgAZE WS7oI/zpd06w/bDMMLFG3/mWpobC9c/s1jlUyoV/9gbdgFooLj0CJcyM4lsr6i0jlSD1lI errSw7saf/VlhfZ++NalIM/U8gplu8H6OuaKrng57t4VGNW6pnbmDv+KqwqT58Bj6Bovo8 jQvqlYr/GOL4K8rf//uJtZ3pwru0t8TLmbTCfZIaE1Ull8ZdfJqUxJDsFfBrbA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=A2X57e2U; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683297928; 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=uPzZFecG9yynhTEh/EiFe6rjXEVMwRYt+t5PddjzTX0=; b=P/7c3Leyg7D271Jhnnl1t0G0KKe5mDIFQhvf+q36Xqd/lGF6WQOuazSAM0G3cnyhxIGC7O 1eRrS0JGJynsrsMM0dEdnwVm/pSth2F3EtbCKzhKWniqBjK/so/FStZgHouh/Di80Ux401 mH7gA9lyTRr2WV+qNRcoYibYsVpuBR+iixa07Vvh0KQ/rEJONE66uPRId147xiteJrBjEE M+RVJKnd4LLtlAPOb9DypIu4MC+NaZRC++q2g2960b4KvgKfqB1F2YRGd8SIyuTL/l15bv eEXOZ+5A2j0gZire/7Jp6gTFSy+tmJ8IncUlObSKGYPRyvzSp/ZgaVBlZJSiSg== X-Migadu-Spam-Score: -3.20 X-Spam-Score: -3.20 X-Migadu-Queue-Id: 4E411ADA5 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=A2X57e2U; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: r1UJgKnDGBya Hi Bruno, Bruno Victal writes: > Hi Maxim, > > On 2023-05-03 02:44, Maxim Cournoyer wrote: >> Hi Bruno, >>=20 >> Bruno Victal writes: >>=20 >>> On 2023-04-29 18:04, Maxim Cournoyer wrote: >>>> Hi Bruno, >>>> >>>> Bruno Victal writes: >>>> >>>>> On 2023-04-28 15:27, Maxim Cournoyer wrote: >>>>>> Rationale: Services can be extended via the simple-service mechanism= instead >>>>>> of having to expose fields on service configurations that are not di= rectly >>>>>> connected to the service's configuration. >>>>>> >>>>>> * gnu/services/audio.scm (mpd-environment-variables-sanitizer): New = sanitizer. >>>>>> (mpd-configuration): Use it. >>>>>> (mpd-shepherd-service): Hard code the useful environment variables i= nside the >>>>>> Shepherd service. >>>>>> --- >>>>> >>>>> This field shouldn't be deprecated as one of it's primary purposes is= to allow for >>>>> the pulseaudio daemon configuration to be set to another one. >>>>> What you're doing here is effectively hardcoding the pulseaudio confi= guration. >>>> >>>> Our only means to declare a pulseaudio configuration >>>> (pulseaudio-service-type) places it at this location, so it seems >>>> reasonable to hard code it. What use case do you have for a custom >>>> pulseaudio configuration that pulseaudio-service-type could not cater >>>> to? This prevents users defining another environment variable and >>>> forgetting to replace these, then wondering why the default pulse >>>> configuration doesn't work, and it felt out of place to me (an >>>> implementation detail better encapsulated). >>> >>> Indeed but note that there's a small subtlety to pulseaudio-service-typ= e, chiefly that >>> the service is not your typical =C2=BFmonodaemonic? process that is use= d throughout the system, >>> rather it simply provides you a default config for the pulseaudio daemo= n. >>> The fact that multiple pulseaudio daemons can be launched alongside is = a strong indicator that >>> perhaps you will want for some of them to use different configurations,= which is done via the >>> environment variables. >>> >>> Right now this would be mainly achieved using local-file, text-file or = specifying a path >>> but in theory the procedures for pulseaudio-service-type could be reuse= d for serializing >>> configurations to be used outside of the service. >>> >>> Regarding the users forgetting the variables, it looks obvious that if = you omit the default >>> values there then the behavior will also change accordingly. >>> If you strongly feel that this is very pitfall prone (IMO it's no >>> worse than forgetting to add %base-services >>> at the end of the services field) then perhaps documenting it would suf= fice? >>=20 >> Is this a use case in actual use? It seems a bit of a stretch in my >> mind, especially considering the service was already difficult to get >> working in its default configuration; I doubt someone would go out of >> their way to manage multiple distinctly configured pulseaudio daemons >> :-). But if it's something in actual use providing value, I don't mind >> to keep it until we have a better way to extend a common set of basic >> properties for services in general. > > I added this field because while I was refactoring this in #59866 I clear= ed #:environment-variables > from the service constructor as they were setting =E2=80=9Cwrong variable= s=E2=80=9D > (stemming from the abuse of the service > as a home service) and since I was mostly interested on the network > (http) outputs which didn't require any > variables set I didn't notice any issues until I learned about > PulseAudio's rtp modules and tried using them. > > With this, I realized that the environment variables should be > adjustable in order for the service to be flexible > enough for general usage. (in general I prefer the services to be less op= inionated) > > Though originally thought towards multiple PulseAudio configurations, I s= hould stress that PulseAudio > (and PipeWire when we get there) understand a plethora of environment var= iables: In general I try to stick to the YAGNI principle (You Ain't Gonna Need It), because adding things without a current real world test often means they'll need to be adjusted in the future when someone really starts using them, and it's then harder because they've been made public and can't easily be changed. This commit mostly meant to open a discussion, which has now been had (thanks!), so I'll drop the commit removing #:environment-variables and push a fresh series. Thanks for your patience! --=20 Thanks, Maxim