GNU bug report logs - #50586
[PATCH] gnu: mysql: Propagate runtime dependencies.

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Tue, 14 Sep 2021 16:11:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50586 in the body.
You can then email your comments to 50586 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Tue, 14 Sep 2021 16:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to zimoun <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 14 Sep 2021 16:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Tue, 14 Sep 2021 18:10:25 +0200
Fixes <htpps://bugs.gnu.org/23045>.

* gnu/packages/databases.scm (mysql): Add 'propagated-inputs'.
---
 gnu/packages/databases.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c75e1421d5..7e07dbc5e4 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me <at> bonfacemunyoki.com>
 ;;; Copyright © 2021 Simon Streit <simon <at> netpanic.org>
 ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo <at> member.fsf.org>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -90,6 +91,7 @@
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -708,6 +710,11 @@ auto-completion and syntax highlighting.")
        ("openssl" ,openssl)
        ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
        ("zlib" ,zlib)))
+    (propagated-inputs
+     ;; Required by 'mysql_config'
+     `(("awk" ,gawk)
+       ("coreutils" ,coreutils)         ;ls,cat
+       ("sed" ,sed)))
     (home-page "https://www.mysql.com/")
     (synopsis "Fast, easy to use, and popular database")
     (description

base-commit: a72519489f0178051b7049d5793d95d070ebef86
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Wed, 15 Sep 2021 11:44:01 GMT) Full text and rfc822 format available.

Message #8 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: zimoun <zimon.toutoune <at> gmail.com>, 50586 <at> debbugs.gnu.org
Subject: Re: [bug#50586] [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Wed, 15 Sep 2021 13:43:12 +0200
[Message part 1 (text/plain, inline)]
zimoun schreef op di 14-09-2021 om 18:10 [+0200]:
> @@ -708,6 +710,11 @@ auto-completion and syntax highlighting.")
>         ("openssl" ,openssl)
>         ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
>         ("zlib" ,zlib)))
> +    (propagated-inputs
> +     ;; Required by 'mysql_config'
> +     `(("awk" ,gawk)
> +       ("coreutils" ,coreutils)         ;ls,cat
> +       ("sed" ,sed)))

If 'wrap-program' is used on mysql_config to set PATH to
the bin directories of awk, coreutils and sed,
or 'substitute*' is used to replace 'awk', 'sed' and 'ls'
by their absolute paths, then propagation can be avoided.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Wed, 15 Sep 2021 14:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: 50586 <at> debbugs.gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH v2] gnu: mysql: Add wrapper around mysql_config.
Date: Wed, 15 Sep 2021 16:54:42 +0200
Fixes <https://bugs.gnu.org/23045>.

* gnu/packages/databases.scm (mysql): Add phase to wrap 'mysql_config'.
---
 gnu/packages/databases.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c75e1421d5..1b4a1b0f12 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me <at> bonfacemunyoki.com>
 ;;; Copyright © 2021 Simon Streit <simon <at> netpanic.org>
 ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo <at> member.fsf.org>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -90,6 +91,7 @@
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -695,6 +697,20 @@ auto-completion and syntax highlighting.")
                        (for-each delete-file
                                  (find-files (string-append out "/bin")
                                              "_embedded$"))
+                       #t)))
+                  (add-after
+                   'install 'wrap-mysql_config
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (let* ((out (assoc-ref outputs "out"))
+                            (bin (string-append out "/bin"))
+                            (awk (assoc-ref inputs "gawk"))
+                            (coreutils (assoc-ref inputs "coreutils"))
+                            (sed (assoc-ref inputs "sed")))
+                       (wrap-program (string-append bin "/mysql_config")
+                         `("PATH" ":" suffix
+                           (,(string-append awk "/bin")
+                            ,(string-append coreutils "/bin")
+                            ,(string-append sed "/bin"))))
                        #t))))))
     (native-inputs
      `(("bison" ,bison)
@@ -702,11 +718,14 @@ auto-completion and syntax highlighting.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("boost" ,boost-for-mysql)
+       ("coreutils" ,coreutils)         ;ls,cat required by mysql_config
+       ("gawk" ,gawk)                   ;required by mysql_config
        ("libaio" ,libaio)
        ("libtirpc" ,libtirpc)
        ("ncurses" ,ncurses)
        ("openssl" ,openssl)
        ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
+       ("sed" ,sed)                     ;required by mysql_config
        ("zlib" ,zlib)))
     (home-page "https://www.mysql.com/")
     (synopsis "Fast, easy to use, and popular database")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Wed, 15 Sep 2021 14:56:02 GMT) Full text and rfc822 format available.

Message #14 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 50586 <at> debbugs.gnu.org
Subject: Re: [bug#50586] [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Wed, 15 Sep 2021 16:55:42 +0200
Hi Maxime,

On Wed, 15 Sept 2021 at 13:43, Maxime Devos <maximedevos <at> telenet.be> wrote:

> If 'wrap-program' is used on mysql_config to set PATH to
> the bin directories of awk, coreutils and sed,
> or 'substitute*' is used to replace 'awk', 'sed' and 'ls'
> by their absolute paths, then propagation can be avoided.

Indeed.  It is better. :-)
Done in v2.
Thanks for the review.

Cheers,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Mon, 20 Sep 2021 19:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 50586 <at> debbugs.gnu.org
Subject: Re: bug#50586: [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Mon, 20 Sep 2021 19:19:12 +0000
Hello zimoun,

> +                       (wrap-program (string-append bin "/mysql_config")
> +                         `("PATH" ":" suffix
> +                           (,(string-append awk "/bin")
> +                            ,(string-append coreutils "/bin")
> +                            ,(string-append sed "/bin"))))

It looks like mysqld_safe could use the same kind of wrapping, at least
for "ps" and "grep" binaries. Could you please have a look?

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Tue, 21 Sep 2021 06:37:02 GMT) Full text and rfc822 format available.

Message #20 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: 50586 <at> debbugs.gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH v3] gnu: mysql: Add wrapper around mysql_config.
Date: Tue, 21 Sep 2021 08:35:56 +0200
Fixes <https://bugs.gnu.org/23045>.

* gnu/packages/databases.scm (mysql): Add phase to wrap 'mysql_config'.
[inputs]: Add 'coreutils', 'gawk', 'procps' and 'sed'
---
 gnu/packages/databases.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c75e1421d5..58e3d7175b 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -53,6 +53,7 @@
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me <at> bonfacemunyoki.com>
 ;;; Copyright © 2021 Simon Streit <simon <at> netpanic.org>
 ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo <at> member.fsf.org>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -90,6 +91,7 @@
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -695,6 +697,29 @@ auto-completion and syntax highlighting.")
                        (for-each delete-file
                                  (find-files (string-append out "/bin")
                                              "_embedded$"))
+                       #t)))
+                  (add-after
+                   'install 'wrap-mysql_helpers
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (let* ((out (assoc-ref outputs "out"))
+                            (bin (string-append out "/bin"))
+                            (awk (assoc-ref inputs "gawk"))
+                            (coreutils (assoc-ref inputs "coreutils"))
+                            (grep (assoc-ref inputs "grep"))
+                            (ps (assoc-ref inputs "procps"))
+                            (sed (assoc-ref inputs "sed")))
+                       (wrap-program (string-append bin "/mysql_config")
+                         `("PATH" ":" suffix
+                           (,(string-append awk "/bin")
+                            ,(string-append coreutils "/bin")
+                            ,(string-append sed "/bin"))))
+                       (wrap-program (string-append bin "/mysqld_safe")
+                         `("PATH" ":" suffix
+                           (,(string-append awk "/bin")
+                            ,(string-append coreutils "/bin")
+                            ,(string-append grep "/bin")
+                            ,(string-append ps "/bin")
+                            ,(string-append sed "/bin"))))
                        #t))))))
     (native-inputs
      `(("bison" ,bison)
@@ -702,11 +727,16 @@ auto-completion and syntax highlighting.")
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("boost" ,boost-for-mysql)
+       ("coreutils" ,coreutils)         ;ls,cat required by mysql_config, mysqld_safe
+       ("gawk" ,gawk)                   ;required by mysql_config, mysqld_safe
+       ("grep" ,grep)                   ;required by mysqld_safe
        ("libaio" ,libaio)
        ("libtirpc" ,libtirpc)
        ("ncurses" ,ncurses)
        ("openssl" ,openssl)
+       ("procps" ,procps)               ;required by mysqld_safe
        ("rpcsvc-proto" ,rpcsvc-proto) ; rpcgen
+       ("sed" ,sed)                     ;required by mysql_config, mysqld_safe
        ("zlib" ,zlib)))
     (home-page "https://www.mysql.com/")
     (synopsis "Fast, easy to use, and popular database")
-- 
2.32.0





Information forwarded to guix-patches <at> gnu.org:
bug#50586; Package guix-patches. (Tue, 21 Sep 2021 06:37:02 GMT) Full text and rfc822 format available.

Message #23 received at 50586 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 50586 <at> debbugs.gnu.org
Subject: Re: bug#50586: [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Tue, 21 Sep 2021 08:26:24 +0200
Hi,

On lun., 20 sept. 2021 at 19:19, Mathieu Othacehe <othacehe <at> gnu.org> wrote:

> It looks like mysqld_safe could use the same kind of wrapping, at least
> for "ps" and "grep" binaries. Could you please have a look?

Thanks for the catch up.  Well, it is fixed in v3.  I have checked by
hand the 2 bash scripts…

--8<---------------cut here---------------start------------->8---
$ file bin/* | grep -v ELF
bin/mysql_config:              a /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/bash script, ASCII text executable
bin/mysqld_safe:               a /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16/bin/sh script, ASCII text executable
bin/mysqld_multi:              Perl script text executable
bin/mysqldumpslow:             Perl script text executable
--8<---------------cut here---------------end--------------->8---

…and I have no idea about the Perl ones; let assume all is fine since
there is no bug report about them. ;-)

Note that ’mysqld_safe’ contains absolute path:

--8<---------------cut here---------------start------------->8---
      # Restrict to a the list in $malloc_dirs above
      case "`dirname "$malloc_lib"`" in
        /usr/lib) ;;
        /usr/lib64) ;;
        /usr/lib/i386-linux-gnu) ;;
        /usr/lib/x86_64-linux-gnu) ;;
        *)
          log_error "--malloc-lib must be located in one of the directories: $malloc_dirs"
          exit 1
          ;;
      esac
--8<---------------cut here---------------end--------------->8---

Because I am not an user of ’mysqld_safe’ and there is no bug report, I
assume it is not an issue and let it aside.


Cheers,
simon




Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Tue, 21 Sep 2021 14:25:01 GMT) Full text and rfc822 format available.

Notification sent to zimoun <zimon.toutoune <at> gmail.com>:
bug acknowledged by developer. (Tue, 21 Sep 2021 14:25:02 GMT) Full text and rfc822 format available.

Message #28 received at 50586-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 50586-done <at> debbugs.gnu.org
Subject: Re: bug#50586: [PATCH] gnu: mysql: Propagate runtime dependencies.
Date: Tue, 21 Sep 2021 14:24:45 +0000
Hey,

> +       ("sed" ,sed)                     ;required by mysql_config, mysqld_safe

Thanks for the v3, I edited the commit message and removed the above
comments before pushing.

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Oct 2021 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.