From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aHowLiOpdGB0KwAAgWs5BA (envelope-from ) for ; Mon, 12 Apr 2021 22:10:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uCTxJyOpdGCMdAAA1q6Kng (envelope-from ) for ; Mon, 12 Apr 2021 20:10:11 +0000 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 170C824F32 for ; Mon, 12 Apr 2021 22:10:11 +0200 (CEST) Received: from localhost ([::1]:57588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW2ss-0001I8-3J for larch@yhetil.org; Mon, 12 Apr 2021 16:10:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW2sk-0001I0-Mi for guix-patches@gnu.org; Mon, 12 Apr 2021 16:10:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lW2sk-00031u-Fp for guix-patches@gnu.org; Mon, 12 Apr 2021 16:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lW2sk-00057N-9l for guix-patches@gnu.org; Mon, 12 Apr 2021 16:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47704] [PATCH] services: mysql: Add extra-environment as configuration option. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Apr 2021 20:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: david larsson Cc: 47704@debbugs.gnu.org Received: via spool by 47704-submit@debbugs.gnu.org id=B47704.161825816519626 (code B ref 47704); Mon, 12 Apr 2021 20:10:02 +0000 Received: (at 47704) by debbugs.gnu.org; 12 Apr 2021 20:09:25 +0000 Received: from localhost ([127.0.0.1]:58164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW2s9-00056U-CX for submit@debbugs.gnu.org; Mon, 12 Apr 2021 16:09:25 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:39546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW2s6-00056K-Fb for 47704@debbugs.gnu.org; Mon, 12 Apr 2021 16:09:23 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id rw9L2400A0mfAB401w9LuV; Mon, 12 Apr 2021 22:09:21 +0200 Message-ID: <60efaa4ac56f3dda7da44f0e60df921ccdd7bc89.camel@telenet.be> From: Maxime Devos Date: Mon, 12 Apr 2021 22:09:14 +0200 In-Reply-To: <701e03466beb09a26cc25e444382d14e@selfhosted.xyz> References: <91c1726e12b938f7656d7d7862920f69@selfhosted.xyz> <7d2d1250a3e87ac67c80897bffe0b82c@selfhosted.xyz> <7cfafd05c98540590905ceb5f3cd554fc9e2b79b.camel@telenet.be> <701e03466beb09a26cc25e444382d14e@selfhosted.xyz> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Y1jgmKD75vu75SmyxXkD" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1618258161; bh=ZQAW0MWNCelz3u1C5/2j8fTGG2iqy7baJOeSqnefrY8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ZSAx7DFG838W7/A2q/b66nJgyc8E6XFST+45gq9sD6wZ8JgBpfWmPscDtT9LCqJRY V9BAqoILBVCs+saDLUZMDGKzZpIp4/NwjZSso7ZlSb07Cnao+Xfdu7sBhAbbSE585/ HcmJZ5fDAleWYn/Hnn0wtmMHDfhrIm1tj1EtAUQujQytF9cil8qOIL84eqlK/NHA6x 9H/+JzVZeXDz4jHHIA6zYhjONBE+/vHUoLe9VxXHaLN0dEQTOHVVhj3zXqMNnaMJ+I 8l3Y4XzbwH0WsCTilZBpTqEkcynR4iTC9eM+Q06ih2l4pjQqTVMW2Pbtx2mzfBud6j vy7QHpmEfWoqw== 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618258211; 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: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=ZQAW0MWNCelz3u1C5/2j8fTGG2iqy7baJOeSqnefrY8=; b=uWzFyu5cgjGdUxA8fxbs2eN9WdAnfCoYRYlpAwiFMRGiPdWQpDR5fHZQMVMyzknbVPgr3Z g6DvVuhgeFyrbClpCMWXpLJUE2jFV+XC8lhzO8MjbgUs7F6FnjfC18mT0hvGwzmsD/JPwz ZhLf6MVWhT7VYl+hr6tT2yHp5rbDc7vpvHrzNmlRsFEybn17iq6uZDd9KW5/zaybzq6SS2 FVCABhTL6yihRKY+hsEUQkivhxYA+MGiZcID8NU56IeHEQ1KEtrfCcBD+ZuT/AXeyNhsrP 0nIWvC2T9O/UCAQt/wN9IPCBunNhnxXYEfBtvUlVb1QXOAlrvQn+bWsoMGTkQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618258211; a=rsa-sha256; cv=none; b=LhPLnVy7UdyMrKdg/6hzEoTDU9DWH8LH0xAj/JbPXAS7HP+VnnYhXkDZgnuOvTHHDEGNE/ VwimP3T5S7B1mh3a4/Xt2RongfRK9m3znJHgYKu/pbTyHR6Uw8UqzRBTMtQldLByxzay3u 6P9XmzU/9w7mKJ6MEKiEIsYRhvKSCLdu/oKKnXeI3Nz6ghCrRd90ZbqgeZCybF3iYU+OPl reseyROnBP/rFnMqhA6ORtufZ4iKEipqXxR8jjJUaWjxkeFvK7Bc607hI9b8iL9JeITWhw fRjOQpyvsJYwISa2SaJCWIDKbL3I6k/+yUmjwfgqmcgbRr1L+h1R3WDP9DSemg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ZSAx7DFG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=ZSAx7DFG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 170C824F32 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: xqvg5mtrAcWI --=-Y1jgmKD75vu75SmyxXkD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2021-04-12 at 20:06 +0200, david larsson wrote: > > > On 2021-04-11 17:33, Maxime Devos wrote: > > > > Please corect the galera package to refer to the coreutils (ls, sta= t, > > > > ...) > > > > by absolute file name instead, using something like > > > >=20 > > > > (add-after 'install > > > > (substitute* "INSTALL-LOCATION/wsrep_sst_rsync" > > > > (("\\bls\\b") (string-append (assoc-ref inputs "coreutils") > > > > "/bin/ls")) > > > > ...)) > > > >=20 > > > > (Likewise for rsync, gawk, iproute ...) >=20 > I don't think this is a nice solution because for every update to the=20 > mysql package would mean to verify that we are actually hitting a bunch= =20 > of spread out invocations of external programs inside those shell=20 > scripts with the regex in the (substitute* .. procedure. I would suggest= =20 > instead to define a variable like say: (define=20 > %default-mysqld-environment #~(list (string-append #$gawk "/bin/awk")=20 > ..) which contains all the external commands invoked from the shell=20 > scripts in the mysql/bin folder, and append that to the=20 > extra-environment list. What about inserting a (string-append "export PATH=3D" #$(file-apend gawk "= /bin/awk") ...) line in the scripts? Some of the scripts even already have a PATH=3D... li= ne (PATH=3D/bin:/sbin:/usr/bin or something like that). > I find this to be too tedious, and since it introduces maintenance=20 > hassle I would prefer my suggestion above. Fair enough (-:. > > [...] > > Take a look at 'nscd-shepherd-service' in gnu/serices/base.scm: > >=20 > > [snip] > > #:environment-variables > > (list (string-append "LD_LIBRARY_PATH=3D" > > (string-join > > (map (lambda (dir) > > (string-append dir "/lib")) > > (list #$@name-services)) > > ":"))))) > >=20 > > Replace LD_LIBRARY_PATH with PATH. Add a "extensions" field to > > . Replace 'name-services' with 'extensions'. >=20 > Not sure if you mean to keep /lib in the above procedure and use this=20 > for Galera's .so file, or to help set the PATH for the external programs= =20 > invoked from the shell scripts? I meant for help setting the PATH for the external programs invoked from the shell scripts.=20 > AFAIK the galera service requires you to specify the full path to the=20 > .so either way, and if you meant to use /bin instead of /lib above; the= =20 > binaries of the external programs that are needed are sometimes in=20 > out/sbin and sometimes in out/bin so this would unfortunately miss=20 > programs occasionally. I guess both out/bin and out/sbin could be added to the PATH. > > Procedures you need to modify: > > * mysql-cofiguration-file: add the field to $ > > * mysql-shepherd-service: add #:environment-variables as appropriate > > * mysql-upgrade-shepherd-service: also, maybe, I don't know? > >=20 > > Possible problems: maybe some scripts need some additional environment > > variables. Mabe provide both an "extensions" field, and an > > "extra-environment" field, and combine the results? >=20 > Possibly. What would you say about opening a separate bug report and=20 > potentially fix those things in separate PATCH-set? The mysql-upgrade=20 > service in particular is something I don't know whether it could benefit= =20 > from adding some things to the PATH. mysql-configuration-file deconstruct the struct. I'm= not 100% sure, but I think when you have a (match obj (($ field ...) .= ..)) expression, and you add a field to , you need to add the new field = to $ field ..., in the same order. mysql-shepherd-service: no need to explain, you have modified it in your pa= tch to pass #:enviroment-variables #$extra-env. mysql-upgrade-service: I don't know either. I'm not going to write a patch. I don't have a mysql service on my system; it was only a suggestion. > [...] > This one for example:=20 > https://lists.gnu.org/archive/html/bug-guix/2020-02/msg00321.html > But I would also assume that some of the interest in using=20 > network-manager's vpn plugin is due to it being hard to cover all the=20 > options in openvpn-client-configuration. (There was also an issue with= =20 > cert and key options being mandatory in openvpn-client-configuration) That's an informtive example, thanks! >=20 > > Agreed. I believe the current plan is to: > >=20 > > * add the 'extra-environment' escape hatch. > > * (possibly [dubious-discuss]) Add the extensions field (a list of > > package objects). This adds the listed packages to PATH. > > Slightly neater than 'extra-environment', but is not as general > > as 'extra-environment'. > > * The contents of 'extra-environment' and and 'extensions' are merged. >=20 > Can we do or discuss these things in a separately filed BUG report or=20 > PATCH? These things =3D the 'extensions' field, and merging 'extra-environment' an= d 'extensions'? As I said, it was only a suggestion and I won't be working o= n it. I think your original patch is good to go into the git repo. I'll open a separate bug report about =E2=80=98absolutising=E2=80=99 the binaries refer= red to from the scripts. Note: I do not have commit access. Greetings, Maxime. --=-Y1jgmKD75vu75SmyxXkD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHSo6hccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q13AP9rfOcbfRSxrJ/IrUD5m0AknBXT 11QFKQ/ZZL9txDfhrQD+M/G0DWsn/FKpGkmaLuG/pYOTq+hDCJPSH6AQyE2RBQg= =PgDB -----END PGP SIGNATURE----- --=-Y1jgmKD75vu75SmyxXkD--