From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wPOdNbGMdGAgAwEAgWs5BA (envelope-from ) for ; Mon, 12 Apr 2021 20:08:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 1Z5lL7GMdGByMAAAbx9fmQ (envelope-from ) for ; Mon, 12 Apr 2021 18:08:49 +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 3EBC922D3E for ; Mon, 12 Apr 2021 20:08:49 +0200 (CEST) Received: from localhost ([::1]:58484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW0zQ-0000EE-9O for larch@yhetil.org; Mon, 12 Apr 2021 14:08:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW0xj-0008A3-2U for guix-patches@gnu.org; Mon, 12 Apr 2021 14:07:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lW0xi-0004Ci-9N for guix-patches@gnu.org; Mon, 12 Apr 2021 14:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lW0xi-0006Dg-3r for guix-patches@gnu.org; Mon, 12 Apr 2021 14:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47704] [PATCH] services: mysql: Add extra-environment as configuration option. Resent-From: david larsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Apr 2021 18:07: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: Maxime Devos Cc: 47704@debbugs.gnu.org Received: via spool by 47704-submit@debbugs.gnu.org id=B47704.161825079423873 (code B ref 47704); Mon, 12 Apr 2021 18:07:02 +0000 Received: (at 47704) by debbugs.gnu.org; 12 Apr 2021 18:06:34 +0000 Received: from localhost ([127.0.0.1]:58012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW0xF-0006Cy-J8 for submit@debbugs.gnu.org; Mon, 12 Apr 2021 14:06:34 -0400 Received: from server0.selfhosted.xyz ([217.64.149.7]:33814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lW0xC-0006Cg-Qg for 47704@debbugs.gnu.org; Mon, 12 Apr 2021 14:06:32 -0400 Received: from server0.selfhosted.xyz (localhost [127.0.0.1]) by server0.selfhosted.xyz (Postfix) with ESMTP id 1E6411D0FC04; Mon, 12 Apr 2021 20:06:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=selfhosted.xyz; s=dkim; t=1618250782; bh=9iP7Q2gQ3EARAnJ4/ZPvgKNkUOtl+FUt7C3sipdYIDk=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=nv1isoM2jYwOEllbvRYkEyFSFE7Petg0QS7E7eCv4eYi5ngWC+hgm77BnMfu1ywhD Hyp4gavTb1kAve7uR8s/lM4JEkxVHeiBVhDIKkZ/poBZ0GdjcMEjQDpCV6l+rpxf8H hC2CqbZAdtpddQ8mR+Grt2zHUtA602QcWDrJAfoEPe4uO3sIDx+L+8wYNQcQWzon8U 8RvBzenZGN9JGDvuuGv/0qsGe9histPf3zM9kkNCIh4Fzi6qHXb91/jrIb57wcUwEt 9yyIw8CjPzFT/FxzmPrsy/WmbWdDtWRSw1P3jMRoCz0hxWR5cWz49QynNlWgmtB9LP ocVeAsFaVrnWA== X-Fuglu-Suspect: 8a00938977fa4b35a4a2188b027c0d3c X-Fuglu-Spamstatus: NO Received: from webmail.selfhosted.xyz (office.selfhosted.xyz [192.168.1.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mail@selfhosted.xyz) by server0.selfhosted.xyz (Postfix) with ESMTPSA; Mon, 12 Apr 2021 20:06:15 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 12 Apr 2021 20:06:14 +0200 From: david larsson In-Reply-To: <7cfafd05c98540590905ceb5f3cd554fc9e2b79b.camel@telenet.be> References: <91c1726e12b938f7656d7d7862920f69@selfhosted.xyz> <7d2d1250a3e87ac67c80897bffe0b82c@selfhosted.xyz> <7cfafd05c98540590905ceb5f3cd554fc9e2b79b.camel@telenet.be> Message-ID: <701e03466beb09a26cc25e444382d14e@selfhosted.xyz> X-Sender: david.larsson@selfhosted.xyz 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=1618250929; 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=9iP7Q2gQ3EARAnJ4/ZPvgKNkUOtl+FUt7C3sipdYIDk=; b=tZxbV6GLP4YxsGbiJUOb2Xky3vwdFX2Ike0J7sqnKZ117fJLASrBC2Jd/eu37ALWFUUENU eEZ7pQ+Bnj17SJotbX5vWPoV6OHrrFosdmEGr37T+Gqe+QnNI0fBN5cKqtF7rYQeqyJLn2 7u6blD2N8BG4fM12L6OHLpDZb8UUe+igl4gXX0Zb4LVLDeVyuhM5oZf3a5navSHC2SllOb dg3x88i08iNZDEkQtoP2dkAwCbCDbH8Yn5qn7FT38ddjj8eJ/G6srh9Zm8aM8i94Cq+bD5 xYqnHR4O7pdO8dJiVEgXfFevM07iCQWgLp2Lbx3ZtmRt9IoNyokNbhBx1WmH2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618250929; a=rsa-sha256; cv=none; b=nQvxgjz+xrV7llUpT+8P5zrhht5XuzFRcBT+uJgJo65ofbwMgN8dof6/FYKcow0gmhrmWM arYRLiNqF5cJLljp4yf9cxE4kEHb2PDYSam44RreT642EDosifzZUmqpYmWSwD01F97Q7W Uxbmss4mmWZ9H4xxwaee75IBl+m9ZBLaReVLMX4HPinzazwa6+RN41OCgwusplaejPR0zq 7h/3Pn0+u1VF5Ym9U3XmJCY4vK8IZZD/vymE1UeSfCjyYaA4anHyQ/87/BY0lcjuw5mUjY LnTloZecXzvdA1I4KXxnpXGbQXqZ0E/jdAdDDDMX5e/Igavmf7PsrXalsoDbYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=selfhosted.xyz header.s=dkim header.b=nv1isoM2; 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: -1.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=selfhosted.xyz header.s=dkim header.b=nv1isoM2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=selfhosted.xyz (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: 3EBC922D3E X-Spam-Score: -1.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: nPbZJO1IJW/v >> On 2021-04-11 17:33, Maxime Devos wrote: >> > Please corect the galera package to refer to the coreutils (ls, stat, >> > ...) >> > by absolute file name instead, using something like >> > >> > (add-after 'install >> > (substitute* "INSTALL-LOCATION/wsrep_sst_rsync" >> > (("\\bls\\b") (string-append (assoc-ref inputs "coreutils") >> > "/bin/ls")) >> > ...)) >> > >> > (Likewise for rsync, gawk, iproute ...) I don't think this is a nice solution because for every update to the mysql package would mean to verify that we are actually hitting a bunch of spread out invocations of external programs inside those shell scripts with the regex in the (substitute* .. procedure. I would suggest instead to define a variable like say: (define %default-mysqld-environment #~(list (string-append #$gawk "/bin/awk") ..) which contains all the external commands invoked from the shell scripts in the mysql/bin folder, and append that to the extra-environment list. >> I agree it >> would be nice to patch all the shell scripts in the $#mysql/bin folder >> but this would 1. require maintaining all the additional patching of >> those scripts as part of the mysql package > > This shouldn't be complicated, though possibly somewhat tedious. > I took a look at > /gnu/store/bjgz8jnfsbb4qvaa9csfy8i3x1i3ivp7-mariadb-10.5.8/bin/wsrep_* > (your hash may vary). The following should be ‘absolutised’: > > * In wsrep_sst_mariabackup: > > OS=$(uname) > sfmt="tar" > if pv --help 2>/dev/null | grep -q FORMAT;then > mariabackup > wsrep_log_error > mbstream > xbcrypt (*) > [more things] > * In wsrep_sst_*: other things (eg. rm) > > The following shouldn't be required, and could be commented out: > # Setting the path for lsof on CentOS > export PATH="/usr/sbin:/sbin:$PATH" > > It's a little tedious, but it should be worth it. This could be done > in the post-install phase of mariadb. I find this to be too tedious, and since it introduces maintenance hassle I would prefer my suggestion above. > For an (almost) good example on > how to ‘absolutise’, see 'xvfb-run'. Actually, it uses "which" which > is incorrect when cross-compiling, but that can be worked-around by > adding (setenv "PATH" (string-append BINDIR-OF-INPUTS-COREUTILS ":" > BINDIR-OF-INPUTS-AWK ...)) > > About xbcrypt (*): I have no idea from which package this comes. > Is it an optional dependency? If it is optional, _not_ patching it > could make sense, as to avoid increasing the closure. This would > extra-environment. [..] > That said, if that's too much work or too error-prone, I've an > alternative > proposal below, which is a little more ‘high level’ than asking the > user to > spell out the PATH: > > Take a look at 'nscd-shepherd-service' in gnu/serices/base.scm: > > [snip] > #:environment-variables > (list (string-append "LD_LIBRARY_PATH=" > (string-join > (map (lambda (dir) > (string-append dir "/lib")) > (list #$@name-services)) > ":"))))) > > Replace LD_LIBRARY_PATH with PATH. Add a "extensions" field to > . Replace 'name-services' with 'extensions'. Not sure if you mean to keep /lib in the above procedure and use this for Galera's .so file, or to help set the PATH for the external programs invoked from the shell scripts? AFAIK the galera service requires you to specify the full path to the .so either way, and if you meant to use /bin instead of /lib above; the binaries of the external programs that are needed are sometimes in out/sbin and sometimes in out/bin so this would unfortunately miss programs occasionally. > 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? > > 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? Possibly. What would you say about opening a separate bug report and potentially fix those things in separate PATCH-set? The mysql-upgrade service in particular is something I don't know whether it could benefit from adding some things to the PATH. > For the patch as you've submitted it, the lack of a system test > shouldn't > be a problem, as Guix System doesn't support mariadb + galera. The > system > test is more for if ‘we’ add a 'galera' field to 'mysql-configuration' > as > I suggested. Great! >> The "escape hatch" would therefore be very useful for now, and >> less hassle to maintain - compare with for example the vpn service and >> the amount of emails in the lists regarding lack of options that could >> have easily been added via some g-expression strings. > > Somewhat off-topic, which e-mails would these be? This one for example: https://lists.gnu.org/archive/html/bug-guix/2020-02/msg00321.html But I would also assume that some of the interest in using network-manager's vpn plugin is due to it being hard to cover all the options in openvpn-client-configuration. (There was also an issue with cert and key options being mandatory in openvpn-client-configuration) > Agreed. I believe the current plan is to: > > * 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. Can we do or discuss these things in a separately filed BUG report or PATCH? Best regards, David