GNU bug report logs - #61680
[PATCH] gnu: podman: Add 'docker' alias script as 'docker' output

Previous Next

Package: guix-patches;

Reported by: Zongyuan Li <zongyuan.li <at> c0x0o.me>

Date: Tue, 21 Feb 2023 14:58:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 61680 AT debbugs.gnu.org.

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#61680; Package guix-patches. (Tue, 21 Feb 2023 14:58:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zongyuan Li <zongyuan.li <at> c0x0o.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 21 Feb 2023 14:58:01 GMT) Full text and rfc822 format available.

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

From: Zongyuan Li <zongyuan.li <at> c0x0o.me>
To: guix-patches <at> gnu.org
Cc: Zongyuan Li <zongyuan.li <at> c0x0o.me>
Subject: [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Tue, 21 Feb 2023 14:34:24 +0000
* gnu/packages/containers.scm: New 'docker' output for podman

Signed-off-by: Zongyuan Li <zongyuan.li <at> c0x0o.me>
---
 gnu/packages/containers.scm | 157 +++++++++++++++++++-----------------
 1 file changed, 83 insertions(+), 74 deletions(-)

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 272b67c38d..80c4aaa400 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -312,83 +312,92 @@ (define-public podman
   (package
     (name "podman")
     (version "4.3.1")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/containers/podman")
-             (commit (string-append "v" version))))
-       (modules '((guix build utils)))
-       ;; FIXME: Btrfs libraries not detected by these scripts.
-       (snippet '(substitute* "Makefile"
-                   ((".*hack/btrfs.*") "")))
-       (sha256
-        (base32 "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
-       (file-name (git-file-name name version))))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/containers/podman")
+                    (commit (string-append "v" version))))
+              (modules '((guix build utils)))
+              ;; FIXME: Btrfs libraries not detected by these scripts.
+              (snippet '(substitute* "Makefile"
+                          ((".*hack/btrfs.*")
+                           "")))
+              (sha256
+               (base32
+                "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
+              (file-name (git-file-name name version))))

     (build-system gnu-build-system)
+    (outputs '("out" "docker"))
     (arguments
-     (list
-      #:make-flags
-      #~(list #$(string-append "CC=" (cc-for-target))
-              (string-append "PREFIX=" #$output))
-      #:tests? #f                  ; /sys/fs/cgroup not set up in guix sandbox
-      #:test-target "test"
-      #:phases
-      #~(modify-phases %standard-phases
-          (delete 'configure)
-          (add-after 'unpack 'set-env
-            (lambda* (#:key inputs #:allow-other-keys)
-              ;; when running go, things fail because
-              ;; HOME=/homeless-shelter.
-              (setenv "HOME" "/tmp")))
-          (replace 'check
-            (lambda* (#:key tests? #:allow-other-keys)
-              (when tests?
-                ;; (invoke "strace" "-f" "bin/podman" "version")
-                (invoke "make" "localsystem")
-                (invoke "make" "remotesystem"))))
-          (add-after 'unpack 'fix-hardcoded-paths
-            (lambda _
-              (substitute* (find-files "libpod" "\\.go")
-                (("exec.LookPath[(][\"]slirp4netns[\"][)]")
-                 (string-append "exec.LookPath(\""
-                                (which "slirp4netns") "\")")))
-              (substitute* "hack/install_catatonit.sh"
-                (("CATATONIT_PATH=\"[^\"]+\"")
-                 (string-append "CATATONIT_PATH=" (which "true"))))
-              (substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go"
-                (("/usr/local/libexec/podman")
-                 (string-append #$output "/bin")))
-              (substitute* "vendor/github.com/containers/common/pkg/config/default.go"
-                (("/usr/libexec/podman/conmon") (which "conmon"))
-                (("/usr/local/libexec/cni")
-                 (string-append #$(this-package-input "cni-plugins")
-                                "/bin"))
-                (("/usr/bin/crun") (which "crun")))))
-          (add-after 'install 'install-completions
-            (lambda _
-              (invoke "make" "install.completions"
-                      (string-append "PREFIX=" #$output)))))))
-    (inputs
-     (list btrfs-progs
-           cni-plugins
-           conmon
-           crun
-           gpgme
-           go-github-com-go-md2man
-           iptables
-           libassuan
-           libseccomp
-           libselinux
-           slirp4netns))
-    (native-inputs
-     (list bats
-           git
-           go
-           ; strace ; XXX debug
-           pkg-config
-           python))
+     (list #:make-flags #~(list #$(string-append "CC="
+                                                 (cc-for-target))
+                                (string-append "PREFIX="
+                                               #$output))
+           #:tests? #f ;/sys/fs/cgroup not set up in guix sandbox
+           #:test-target "test"
+           #:phases #~(modify-phases %standard-phases
+                        (delete 'configure)
+                        (add-after 'unpack 'set-env
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (setenv "HOME" "/tmp")))
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              (invoke "make" "localsystem")
+                              (invoke "make" "remotesystem"))))
+                        (add-after 'unpack 'fix-hardcoded-paths
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (substitute* (find-files "libpod" "\\.go")
+                              (("exec.LookPath[(][\"]slirp4netns[\"][)]")
+                               (string-append "exec.LookPath(\""
+                                              (which "slirp4netns") "\")")))
+                            (substitute* "hack/install_catatonit.sh"
+                              (("CATATONIT_PATH=\"[^\"]+\"")
+                               (string-append "CATATONIT_PATH="
+                                              (which "true"))))
+                            (substitute* "vendor/github.com/containers/common/pkg/config/config_linux.go"
+                              (("/usr/local/libexec/podman")
+                               (string-append #$output "/bin")))
+                            (substitute* "vendor/github.com/containers/common/pkg/config/default.go"
+                              (("/usr/libexec/podman/conmon")
+                               (which "conmon"))
+                              (("/usr/local/libexec/cni")
+                               (string-append #$(this-package-input
+                                                 "cni-plugins") "/bin"))
+                              (("/usr/bin/crun")
+                               (which "crun")))
+                            (substitute* "docker"
+                              (("/usr/bin/podman")
+                               (string-append (assoc-ref outputs "out")
+                                              "/bin/podman")))))
+                        (add-after 'install 'install-docker
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (let* ((docker (assoc-ref outputs "docker")))
+                              (install-file "docker"
+                                            (string-append docker "/bin")) #t)))
+                        (add-after 'install 'install-completions
+                          (lambda _
+                            (invoke "make" "install.completions"
+                                    (string-append "PREFIX="
+                                                   #$output)))))))
+    (inputs (list btrfs-progs
+                  cni-plugins
+                  conmon
+                  crun
+                  gpgme
+                  go-github-com-go-md2man
+                  iptables
+                  libassuan
+                  libseccomp
+                  libselinux
+                  slirp4netns))
+    (native-inputs (list bats
+                         git
+                         go
+                         ;; strace ; XXX debug
+                         pkg-config
+                         python))
     (home-page "https://podman.io")
     (synopsis "Manage containers, images, pods, and their volumes")
     (description
--
2.37.1 (Apple Git-137.1)






Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Wed, 22 Feb 2023 05:20:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Zongyuan Li <zongyuan.li <at> c0x0o.me>, 61680 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Wed, 22 Feb 2023 06:19:05 +0100
Am Dienstag, dem 21.02.2023 um 14:34 +0000 schrieb Zongyuan Li:
> * gnu/packages/containers.scm: New 'docker' output for podman
That ChangeLog looks somewhat incomplete.

> Signed-off-by: Zongyuan Li <zongyuan.li <at> c0x0o.me>
Signed-off-by is for committers signing off the commits.

> ---
>  gnu/packages/containers.scm | 157 +++++++++++++++++++---------------
> --
>  1 file changed, 83 insertions(+), 74 deletions(-)
> 
> diff --git a/gnu/packages/containers.scm
> b/gnu/packages/containers.scm
> index 272b67c38d..80c4aaa400 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -312,83 +312,92 @@ (define-public podman
>    (package
>      (name "podman")
>      (version "4.3.1")
> -    (source
> -     (origin
> -       (method git-fetch)
> -       (uri (git-reference
> -             (url "https://github.com/containers/podman")
> -             (commit (string-append "v" version))))
> -       (modules '((guix build utils)))
> -       ;; FIXME: Btrfs libraries not detected by these scripts.
> -       (snippet '(substitute* "Makefile"
> -                   ((".*hack/btrfs.*") "")))
> -       (sha256
> -        (base32
> "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
> -       (file-name (git-file-name name version))))
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/containers/podman")
> +                    (commit (string-append "v" version))))
> +              (modules '((guix build utils)))
> +              ;; FIXME: Btrfs libraries not detected by these
> scripts.
> +              (snippet '(substitute* "Makefile"
> +                          ((".*hack/btrfs.*")
> +                           "")))
> +              (sha256
> +               (base32
> +               
> "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
> +              (file-name (git-file-name name version))))
Don't mix style changes with functional ones.  `guix style', while
recommended in the manual, often does more harm than good.

> +    (outputs '("out" "docker"))
Since this is a very non-standard output, perhaps try describing it
with a output-synopsis package property.

Cheers

Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Wed, 22 Feb 2023 06:35:02 GMT) Full text and rfc822 format available.

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

From: lWP6SrZsSwhCy5tUxadDfg <zongyuan.li <at> c0x0o.me>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 61680 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Wed, 22 Feb 2023 05:52:47 +0000

> On Feb 22, 2023, at 13:19, Liliana Marie Prikler <liliana.prikler <at> gmail.com> wrote:
>
> Am Dienstag, dem 21.02.2023 um 14:34 +0000 schrieb Zongyuan Li:
>> * gnu/packages/containers.scm: New 'docker' output for podman
> That ChangeLog looks somewhat incomplete.
>
>> Signed-off-by: Zongyuan Li <zongyuan.li <at> c0x0o.me>
> Signed-off-by is for committers signing off the commits.
>
>> ---
>>  gnu/packages/containers.scm | 157 +++++++++++++++++++---------------
>> --
>>  1 file changed, 83 insertions(+), 74 deletions(-)
>>
>> diff --git a/gnu/packages/containers.scm
>> b/gnu/packages/containers.scm
>> index 272b67c38d..80c4aaa400 100644
>> --- a/gnu/packages/containers.scm
>> +++ b/gnu/packages/containers.scm
>> @@ -312,83 +312,92 @@ (define-public podman
>>    (package
>>      (name "podman")
>>      (version "4.3.1")
>> -    (source
>> -     (origin
>> -       (method git-fetch)
>> -       (uri (git-reference
>> -             (url "https://github.com/containers/podman")
>> -             (commit (string-append "v" version))))
>> -       (modules '((guix build utils)))
>> -       ;; FIXME: Btrfs libraries not detected by these scripts.
>> -       (snippet '(substitute* "Makefile"
>> -                   ((".*hack/btrfs.*") "")))
>> -       (sha256
>> -        (base32
>> "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
>> -       (file-name (git-file-name name version))))
>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://github.com/containers/podman")
>> +                    (commit (string-append "v" version))))
>> +              (modules '((guix build utils)))
>> +              ;; FIXME: Btrfs libraries not detected by these
>> scripts.
>> +              (snippet '(substitute* "Makefile"
>> +                          ((".*hack/btrfs.*")
>> +                           "")))
>> +              (sha256
>> +               (base32
>> +
>> "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
>> +              (file-name (git-file-name name version))))
> Don't mix style changes with functional ones.  `guix style', while
> recommended in the manual, often does more harm than good.
>
>> +    (outputs '("out" "docker"))
> Since this is a very non-standard output, perhaps try describing it
> with a output-synopsis package property.
>
> Cheers

Thanks for the review. I will take a look :)
By the way, should I post a new v2 patch in a new thread, or just continue with this one?







Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Wed, 22 Feb 2023 19:24:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: lWP6SrZsSwhCy5tUxadDfg <zongyuan.li <at> c0x0o.me>
Cc: 61680 <at> debbugs.gnu.org
Subject: Re: [PATCH] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Wed, 22 Feb 2023 20:23:19 +0100
Am Mittwoch, dem 22.02.2023 um 05:52 +0000 schrieb
lWP6SrZsSwhCy5tUxadDfg:
> 
> 
> > On Feb 22, 2023, at 13:19, Liliana Marie Prikler
> > <liliana.prikler <at> gmail.com> wrote:
> > 
> > Am Dienstag, dem 21.02.2023 um 14:34 +0000 schrieb Zongyuan Li:
> > > * gnu/packages/containers.scm: New 'docker' output for podman
> > That ChangeLog looks somewhat incomplete.
> > 
> > > Signed-off-by: Zongyuan Li <zongyuan.li <at> c0x0o.me>
> > Signed-off-by is for committers signing off the commits.
> > 
> > > ---
> > >  gnu/packages/containers.scm | 157 +++++++++++++++++++-----------
> > > ----
> > > --
> > >  1 file changed, 83 insertions(+), 74 deletions(-)
> > > 
> > > diff --git a/gnu/packages/containers.scm
> > > b/gnu/packages/containers.scm
> > > index 272b67c38d..80c4aaa400 100644
> > > --- a/gnu/packages/containers.scm
> > > +++ b/gnu/packages/containers.scm
> > > @@ -312,83 +312,92 @@ (define-public podman
> > >    (package
> > >      (name "podman")
> > >      (version "4.3.1")
> > > -    (source
> > > -     (origin
> > > -       (method git-fetch)
> > > -       (uri (git-reference
> > > -             (url "https://github.com/containers/podman")
> > > -             (commit (string-append "v" version))))
> > > -       (modules '((guix build utils)))
> > > -       ;; FIXME: Btrfs libraries not detected by these scripts.
> > > -       (snippet '(substitute* "Makefile"
> > > -                   ((".*hack/btrfs.*") "")))
> > > -       (sha256
> > > -        (base32
> > > "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
> > > -       (file-name (git-file-name name version))))
> > > +    (source (origin
> > > +              (method git-fetch)
> > > +              (uri (git-reference
> > > +                    (url "https://github.com/containers/podman")
> > > +                    (commit (string-append "v" version))))
> > > +              (modules '((guix build utils)))
> > > +              ;; FIXME: Btrfs libraries not detected by these
> > > scripts.
> > > +              (snippet '(substitute* "Makefile"
> > > +                          ((".*hack/btrfs.*")
> > > +                           "")))
> > > +              (sha256
> > > +               (base32
> > > +
> > > "05hv4xdf06n728lmsx793zygypc9i404bgcgpy0fyrg8c2s11q2h"))
> > > +              (file-name (git-file-name name version))))
> > Don't mix style changes with functional ones.  `guix style', while
> > recommended in the manual, often does more harm than good.
> > 
> > > +    (outputs '("out" "docker"))
> > Since this is a very non-standard output, perhaps try describing it
> > with a output-synopsis package property.
> > 
> > Cheers
> 
> Thanks for the review. I will take a look :)
> By the way, should I post a new v2 patch in a new thread, or just
> continue with this one?
Established practise is to bump the reroll count (-v2 -v3 ...) and
reply to the existing thread.

Cheers

Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Thu, 23 Feb 2023 18:54:02 GMT) Full text and rfc822 format available.

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

From: Zongyuan Li <zongyuan.li <at> c0x0o.me>
To: 61680 <at> debbugs.gnu.org
Cc: liliana.prikler <at> gmail.com, zongyuan.li <at> c0x0o.me
Subject: [PATCH v2] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Thu, 23 Feb 2023 06:56:45 +0000
Introduces a output named 'docker' in podman package. This
output provides a 'docker' alias for podman. Since their
cmd interface are identical, this simple script just act
the same as 'alias docker=podman', with some additional
checks and notification.

Changes since v1:

    * Add more details in commit messages
    * Revert style format
    * Add output-synopsis for 'docker' output

* gnu/packages/containers.scm: New 'docker' output for podman
---
 gnu/packages/containers.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 272b67c38d..50dfa88421 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -327,6 +327,9 @@ (define-public podman
        (file-name (git-file-name name version))))

     (build-system gnu-build-system)
+    (outputs '("out" "docker"))
+    (properties
+      `((output-synopsis "docker" "docker alias for podman")))
     (arguments
      (list
       #:make-flags
@@ -349,7 +352,7 @@ (define-public podman
                 (invoke "make" "localsystem")
                 (invoke "make" "remotesystem"))))
           (add-after 'unpack 'fix-hardcoded-paths
-            (lambda _
+            (lambda* (#:key outputs #:allow-other-keys)
               (substitute* (find-files "libpod" "\\.go")
                 (("exec.LookPath[(][\"]slirp4netns[\"][)]")
                  (string-append "exec.LookPath(\""
@@ -365,7 +368,14 @@ (define-public podman
                 (("/usr/local/libexec/cni")
                  (string-append #$(this-package-input "cni-plugins")
                                 "/bin"))
-                (("/usr/bin/crun") (which "crun")))))
+                (("/usr/bin/crun") (which "crun")))
+              (substitute* "docker"
+                (("/usr/bin/podman") (string-append (assoc-ref outputs "out")
+                                                    "/bin/podman")))))
+          (add-after 'install 'install-docker
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((docker (assoc-ref outputs "docker")))
+                (install-file "docker" (string-append docker "/bin")) #t)))
           (add-after 'install 'install-completions
             (lambda _
               (invoke "make" "install.completions"
--
2.37.1 (Apple Git-137.1)






Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Thu, 02 Mar 2023 18:36:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Zongyuan Li <zongyuan.li <at> c0x0o.me>
Cc: 61680 <at> debbugs.gnu.org, liliana.prikler <at> gmail.com
Subject: Re: bug#61680: [PATCH] gnu: podman: Add 'docker' alias script as
 'docker' output
Date: Thu, 02 Mar 2023 19:35:05 +0100
Hi,

Zongyuan Li <zongyuan.li <at> c0x0o.me> skribis:

> Introduces a output named 'docker' in podman package. This
> output provides a 'docker' alias for podman. Since their
> cmd interface are identical, this simple script just act
> the same as 'alias docker=podman', with some additional
> checks and notification.
>
> Changes since v1:
>
>     * Add more details in commit messages
>     * Revert style format
>     * Add output-synopsis for 'docker' output
>
> * gnu/packages/containers.scm: New 'docker' output for podman

Regarding the commit log, please check ‘git log’ and the “Submitting
Patches” of the manual for convention.  We can tweak that for you if you
want, but basically it’s about describe what has changed, not why.

>  gnu/packages/containers.scm | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
> index 272b67c38d..50dfa88421 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -327,6 +327,9 @@ (define-public podman
>         (file-name (git-file-name name version))))
>
>      (build-system gnu-build-system)
> +    (outputs '("out" "docker"))
> +    (properties
> +      `((output-synopsis "docker" "docker alias for podman")))

Are there downsides to having the ‘docker’ command directly in “out”?

I would prefer that because it’d be more easily discovered.

>      (arguments
>       (list
>        #:make-flags
> @@ -349,7 +352,7 @@ (define-public podman
>                  (invoke "make" "localsystem")
>                  (invoke "make" "remotesystem"))))
>            (add-after 'unpack 'fix-hardcoded-paths
> -            (lambda _
> +            (lambda* (#:key outputs #:allow-other-keys)
>                (substitute* (find-files "libpod" "\\.go")
>                  (("exec.LookPath[(][\"]slirp4netns[\"][)]")
>                   (string-append "exec.LookPath(\""
> @@ -365,7 +368,14 @@ (define-public podman
>                  (("/usr/local/libexec/cni")
>                   (string-append #$(this-package-input "cni-plugins")
>                                  "/bin"))
> -                (("/usr/bin/crun") (which "crun")))))
> +                (("/usr/bin/crun") (which "crun")))
> +              (substitute* "docker"
> +                (("/usr/bin/podman") (string-append (assoc-ref outputs "out")
> +                                                    "/bin/podman")))))
> +          (add-after 'install 'install-docker
> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (let* ((docker (assoc-ref outputs "docker")))
> +                (install-file "docker" (string-append docker "/bin")) #t)))

No need for a trailing #t.

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Fri, 03 Mar 2023 06:31:01 GMT) Full text and rfc822 format available.

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

From: Zongyuan Li <zongyuan.li <at> c0x0o.me>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61680 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: bug#61680: [PATCH] gnu: podman: Add 'docker' alias script as
 'docker' output
Date: Fri, 03 Mar 2023 06:30:14 +0000
Hi,

Thanks for the review, Ludovic

> On Mar 3, 2023, at 02:35, Ludovic Courtès <ludo <at> gnu.org> wrote:
>
> Regarding the commit log, please check ‘git log’ and the “Submitting
> Patches” of the manual for convention.  We can tweak that for you if you
> want, but basically it’s about describe what has changed, not why.


I will try to fix it in next version, but I’m ok if you want to tweak that.

> Are there downsides to having the ‘docker’ command directly in “out”?
>
> I would prefer that because it’d be more easily discovered.

‘docker’ alias in podman will conflict with the real docker package.
If user wants both podman and docker package installed on their
system, it’s better to put alias in a seperate output.

> No need for a trailing #t.

ACK

Li




Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Fri, 03 Mar 2023 08:10:02 GMT) Full text and rfc822 format available.

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

From: Zongyuan Li <zongyuan.li <at> c0x0o.me>
To: 61680 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, liliana.prikler <at> gmail.com, Zongyuan Li <zongyuan.li <at> c0x0o.me>
Subject: [PATCH v3] gnu: podman: Add 'docker' alias script as 'docker' output
Date: Fri, 03 Mar 2023 08:08:55 +0000
gnu: podman: Add 'docker' alias script as 'docker' output

changes since v2:

    * Remove redundant trailing #t
    * Adjust commit log

* gnu/packages/containers.scm (podman): New 'docker' output for podman
---
 gnu/packages/containers.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index b402bbde6a..b316588ea2 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -327,6 +327,9 @@ (define-public podman
        (file-name (git-file-name name version))))

     (build-system gnu-build-system)
+    (outputs '("out" "docker"))
+    (properties
+      `((output-synopsis "docker" "docker alias for podman")))
     (arguments
      (list
       #:make-flags
@@ -349,7 +352,7 @@ (define-public podman
                 (invoke "make" "localsystem")
                 (invoke "make" "remotesystem"))))
           (add-after 'unpack 'fix-hardcoded-paths
-            (lambda _
+            (lambda* (#:key outputs #:allow-other-keys)
               (substitute* (find-files "libpod" "\\.go")
                 (("exec.LookPath[(][\"]slirp4netns[\"][)]")
                  (string-append "exec.LookPath(\""
@@ -365,7 +368,14 @@ (define-public podman
                 (("/usr/local/libexec/cni")
                  (string-append #$(this-package-input "cni-plugins")
                                 "/bin"))
-                (("/usr/bin/crun") (which "crun")))))
+                (("/usr/bin/crun") (which "crun")))
+              (substitute* "docker"
+                (("/usr/bin/podman") (string-append (assoc-ref outputs "out")
+                                                    "/bin/podman")))))
+          (add-after 'install 'install-docker
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((docker (assoc-ref outputs "docker")))
+                (install-file "docker" (string-append docker "/bin")))))
           (add-after 'install 'install-completions
             (lambda _
               (invoke "make" "install.completions"
--
2.37.1 (Apple Git-137.1)






Information forwarded to guix-patches <at> gnu.org:
bug#61680; Package guix-patches. (Fri, 24 Mar 2023 10:30:03 GMT) Full text and rfc822 format available.

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

From: Zongyuan Li <zongyuan.li <at> c0x0o.me>
To: 61680 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [PATCH v3] gnu: podman: Add 'docker' alias script as 'docker'
 output
Date: Fri, 24 Mar 2023 10:29:18 +0000
Ping. Any further information?

Thanks

> On Mar 3, 2023, at 16:08, Zongyuan Li <zongyuan.li <at> c0x0o.me> wrote:
>
> gnu: podman: Add 'docker' alias script as 'docker' output
>
> changes since v2:
>
>    * Remove redundant trailing #t
>    * Adjust commit log
>
> * gnu/packages/containers.scm (podman): New 'docker' output for podman
> ---
> gnu/packages/containers.scm | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
> index b402bbde6a..b316588ea2 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -327,6 +327,9 @@ (define-public podman
>        (file-name (git-file-name name version))))
>
>     (build-system gnu-build-system)
> +    (outputs '("out" "docker"))
> +    (properties
> +      `((output-synopsis "docker" "docker alias for podman")))
>     (arguments
>      (list
>       #:make-flags
> @@ -349,7 +352,7 @@ (define-public podman
>                 (invoke "make" "localsystem")
>                 (invoke "make" "remotesystem"))))
>           (add-after 'unpack 'fix-hardcoded-paths
> -            (lambda _
> +            (lambda* (#:key outputs #:allow-other-keys)
>               (substitute* (find-files "libpod" "\\.go")
>                 (("exec.LookPath[(][\"]slirp4netns[\"][)]")
>                  (string-append "exec.LookPath(\""
> @@ -365,7 +368,14 @@ (define-public podman
>                 (("/usr/local/libexec/cni")
>                  (string-append #$(this-package-input "cni-plugins")
>                                 "/bin"))
> -                (("/usr/bin/crun") (which "crun")))))
> +                (("/usr/bin/crun") (which "crun")))
> +              (substitute* "docker"
> +                (("/usr/bin/podman") (string-append (assoc-ref outputs "out")
> +                                                    "/bin/podman")))))
> +          (add-after 'install 'install-docker
> +            (lambda* (#:key outputs #:allow-other-keys)
> +              (let* ((docker (assoc-ref outputs "docker")))
> +                (install-file "docker" (string-append docker "/bin")))))
>           (add-after 'install 'install-completions
>             (lambda _
>               (invoke "make" "install.completions"
> --
> 2.37.1 (Apple Git-137.1)
>






This bug report was last modified 1 year and 42 days ago.

Previous Next


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