GNU bug report logs - #70115
[PATCH] gnu: skopeo: Update to 1.15.0.

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sun, 31 Mar 2024 21:08:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

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 70115 in the body.
You can then email your comments to 70115 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#70115; Package guix-patches. (Sun, 31 Mar 2024 21:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 31 Mar 2024 21:08:02 GMT) Full text and rfc822 format available.

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

From: Tomas Volf <~@wolfsden.cz>
To: guix-patches <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH] gnu: skopeo: Update to 1.15.0.
Date: Sun, 31 Mar 2024 23:05:02 +0200
The package is also converted to gnu-build-system in order to take advantage
of already existing Makefile instead of reinventing (parts) of it in Guile.

* gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
[build-system]: Use gnu-build-system.
[native-inputs]: Add go-1.21, sort.
[inputs]: Add bash-minimal.
[arguments]<#:import-path, #:install-source?>: Delete.
<#:make-flags, #:test-target, #:imported-modules>: New arguments.
<#:phases>{'configure}: Delete.
{'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.

Change-Id: I1010e1f4fbdc093646c2879bdf30125ab2e88bdd
---
This commit updates the skopeo, and also converts it to use
gnu-build-system.  Both is done in one commit, since 1.15 did not
built just by straight-forward update, and due to the intended rewrite
the time spent debugging that would be wasted.

This (gnu-build-system) matches how podman and buildah are done in #70112
bringing all github.com/containers/* projects on the same model.

 gnu/packages/virtualization.scm | 80 ++++++++++++++++++++++-----------
 1 file changed, 54 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 251fe00aa0..60f43c19cf 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -151,6 +151,7 @@ (define-module (gnu packages virtualization)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
+  #:use-module (guix modules)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -2257,7 +2258,7 @@ (define-public umoci
 (define-public skopeo
   (package
     (name "skopeo")
-    (version "1.2.3")
+    (version "1.15.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -2266,12 +2267,15 @@ (define-public skopeo
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
-    (build-system go-build-system)
+                "1f9n3ysdmll7vq8dmgpv03m8aqq3w9cfvbmxxpwmnv1nlfc67ihq"))))
+    (build-system gnu-build-system)
     (native-inputs
-     (list pkg-config go-github-com-go-md2man))
+     (list go-1.21
+           go-github-com-go-md2man
+           pkg-config))
     (inputs
-     (list btrfs-progs
+     (list bash-minimal
+           btrfs-progs
            eudev
            libassuan
            libselinux
@@ -2280,27 +2284,51 @@ (define-public skopeo
            glib
            gpgme))
     (arguments
-     '(#:import-path "github.com/containers/skopeo"
-       #:install-source? #f
-       #:tests? #f                                ; The tests require Docker
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'build
-           (lambda* (#:key import-path #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (invoke "make" "bin/skopeo"))))
-         (add-after 'build 'build-docs
-           (lambda* (#:key import-path #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (invoke "make" "docs"))))
-         (replace 'install
-           (lambda* (#:key import-path outputs #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (let ((out (assoc-ref outputs "out")))
-                 (install-file "default-policy.json"
-                               (string-append out "/etc/containers"))
-                 (invoke "make" "install-binary" "install-completions" "install-docs"
-                         (string-append "PREFIX=" out)))))))))
+     (list
+      #:make-flags
+      #~(list (string-append "CC=" #$(cc-for-target))
+              "PREFIX="
+              (string-append "DESTDIR=" #$output)
+              (string-append "GOMD2MAN="
+                             #$go-github-com-go-md2man "/bin/go-md2man"))
+      #:tests? #f                       ; The tests require Docker
+      #:test-target "test-unit"
+      #:imported-modules
+      (source-module-closure `(,@%gnu-build-system-modules
+                               (guix build go-build-system)))
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (add-after 'unpack 'set-env
+            (lambda _
+              ;; When running go, things fail because HOME=/homeless-shelter.
+              (setenv "HOME" "/tmp")
+              ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
+              ;; Make <4.4 causing CC not to be propagated into $(shell ...)
+              ;; calls.  Can be removed once we update to >4.3.
+              ;;
+              ;; This techically does nothing *now*, but after upstream
+              ;; issue[1] is solved and 'cc-to-gcc phase is removed, it will
+              ;; start being required.
+              ;; 1: https://github.com/containers/skopeo/issues/2278
+              (setenv "CC" #$(cc-for-target))))
+          (add-after 'unpack 'cc-to-gcc
+            (lambda _
+              (for-each (lambda (file)
+                          (substitute* file
+                            (("^cc -" all)
+                             (string-append "g" all))))
+                        '("hack/btrfs_tag.sh"
+                          "hack/btrfs_installed_tag.sh"
+                          "hack/libdm_tag.sh"
+                          "hack/libsubid_tag.sh"))))
+          (add-after 'install 'wrap-skopeo
+            (lambda _
+              (wrap-program (string-append #$output "/bin/skopeo")
+                `("PATH" suffix
+                  ("/run/setuid-programs")))))
+          (add-after 'install 'remove-go-references
+            (@@ (guix build go-build-system) remove-go-references)))))
     (home-page "https://github.com/containers/skopeo")
     (synopsis "Interact with container images and container image registries")
     (description
--
2.41.0




Information forwarded to guix-patches <at> gnu.org:
bug#70115; Package guix-patches. (Mon, 01 Apr 2024 13:06:01 GMT) Full text and rfc822 format available.

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

From: Z572 <873216071 <at> qq.com>
To: Tomas Volf <~@wolfsden.cz>
Cc: 70115 <at> debbugs.gnu.org
Subject: Re: [bug#70115] [PATCH] gnu: skopeo: Update to 1.15.0.
Date: Mon, 01 Apr 2024 20:37:45 +0800
[Message part 1 (text/plain, inline)]
Tomas Volf <~@wolfsden.cz> writes:

> The package is also converted to gnu-build-system in order to take advantage
> of already existing Makefile instead of reinventing (parts) of it in Guile.
>
> * gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
> [build-system]: Use gnu-build-system.
> [native-inputs]: Add go-1.21, sort.
> [inputs]: Add bash-minimal.
> [arguments]<#:import-path, #:install-source?>: Delete.
> <#:make-flags, #:test-target, #:imported-modules>: New arguments.
> <#:phases>{'configure}: Delete.
> {'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.
>
> Change-Id: I1010e1f4fbdc093646c2879bdf30125ab2e88bdd
> ---
> This commit updates the skopeo, and also converts it to use
> gnu-build-system.  Both is done in one commit, since 1.15 did not
> built just by straight-forward update, and due to the intended rewrite
> the time spent debugging that would be wasted.
>
> This (gnu-build-system) matches how podman and buildah are done in #70112
> bringing all github.com/containers/* projects on the same model.
>
>  gnu/packages/virtualization.scm | 80 ++++++++++++++++++++++-----------
>  1 file changed, 54 insertions(+), 26 deletions(-)
>
> diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
> index 251fe00aa0..60f43c19cf 100644
> --- a/gnu/packages/virtualization.scm
> +++ b/gnu/packages/virtualization.scm
> @@ -151,6 +151,7 @@ (define-module (gnu packages virtualization)
>    #:use-module (guix gexp)
>    #:use-module (guix git-download)
>    #:use-module (guix packages)
> +  #:use-module (guix modules)
>    #:use-module (guix utils)
>    #:use-module (srfi srfi-1)
>    #:use-module (srfi srfi-26)
> @@ -2257,7 +2258,7 @@ (define-public umoci
>  (define-public skopeo
>    (package
>      (name "skopeo")
> -    (version "1.2.3")
> +    (version "1.15.0")
>      (source (origin
>                (method git-fetch)
>                (uri (git-reference
> @@ -2266,12 +2267,15 @@ (define-public skopeo
>                (file-name (git-file-name name version))
>                (sha256
>                 (base32
> -                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
> -    (build-system go-build-system)
> +                "1f9n3ysdmll7vq8dmgpv03m8aqq3w9cfvbmxxpwmnv1nlfc67ihq"))))
> +    (build-system gnu-build-system)
>      (native-inputs
> -     (list pkg-config go-github-com-go-md2man))
> +     (list go-1.21
> +           go-github-com-go-md2man
> +           pkg-config))
>      (inputs
> -     (list btrfs-progs
> +     (list bash-minimal
> +           btrfs-progs
>             eudev
>             libassuan
>             libselinux
> @@ -2280,27 +2284,51 @@ (define-public skopeo
>             glib
>             gpgme))
>      (arguments
> -     '(#:import-path "github.com/containers/skopeo"
> -       #:install-source? #f
> -       #:tests? #f                                ; The tests require Docker
> -       #:phases
> -       (modify-phases %standard-phases
> -         (replace 'build
> -           (lambda* (#:key import-path #:allow-other-keys)
> -             (with-directory-excursion (string-append "src/" import-path)
> -               (invoke "make" "bin/skopeo"))))
> -         (add-after 'build 'build-docs
> -           (lambda* (#:key import-path #:allow-other-keys)
> -             (with-directory-excursion (string-append "src/" import-path)
> -               (invoke "make" "docs"))))
> -         (replace 'install
> -           (lambda* (#:key import-path outputs #:allow-other-keys)
> -             (with-directory-excursion (string-append "src/" import-path)
> -               (let ((out (assoc-ref outputs "out")))
> -                 (install-file "default-policy.json"
> -                               (string-append out "/etc/containers"))
> -                 (invoke "make" "install-binary" "install-completions" "install-docs"
> -                         (string-append "PREFIX=" out)))))))))
> +     (list
> +      #:make-flags
> +      #~(list (string-append "CC=" #$(cc-for-target))
> +              "PREFIX="
> +              (string-append "DESTDIR=" #$output)
> +              (string-append "GOMD2MAN="
> +                             #$go-github-com-go-md2man "/bin/go-md2man"))
> +      #:tests? #f                       ; The tests require Docker
> +      #:test-target "test-unit"
> +      #:imported-modules
> +      (source-module-closure `(,@%gnu-build-system-modules
> +                               (guix build go-build-system)))
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (delete 'configure)
> +          (add-after 'unpack 'set-env
> +            (lambda _
> +              ;; When running go, things fail because HOME=/homeless-shelter.
> +              (setenv "HOME" "/tmp")
> +              ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
> +              ;; Make <4.4 causing CC not to be propagated into $(shell ...)
> +              ;; calls.  Can be removed once we update to >4.3.
> +              ;;
> +              ;; This techically does nothing *now*, but after upstream
> +              ;; issue[1] is solved and 'cc-to-gcc phase is removed, it will
> +              ;; start being required.
> +              ;; 1: https://github.com/containers/skopeo/issues/2278
> +              (setenv "CC" #$(cc-for-target))))
> +          (add-after 'unpack 'cc-to-gcc
> +            (lambda _
> +              (for-each (lambda (file)
> +                          (substitute* file
> +                            (("^cc -" all)
> +                             (string-append "g" all))))

I don't think this is a good idea. Why not "$(CC)", this env can get
from set-env phase.

> +                        '("hack/btrfs_tag.sh"
> +                          "hack/btrfs_installed_tag.sh"
> +                          "hack/libdm_tag.sh"
> +                          "hack/libsubid_tag.sh"))))
> +          (add-after 'install 'wrap-skopeo
> +            (lambda _
> +              (wrap-program (string-append #$output "/bin/skopeo")
> +                `("PATH" suffix
> +                  ("/run/setuid-programs")))))

It would be nice to add some comments about why need wrap /run/setuid-programs .

> +          (add-after 'install 'remove-go-references
> +            (@@ (guix build go-build-system) remove-go-references)))))
>      (home-page "https://github.com/containers/skopeo")
>      (synopsis "Interact with container images and container image registries")
>      (description

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

Information forwarded to guix-patches <at> gnu.org:
bug#70115; Package guix-patches. (Mon, 01 Apr 2024 13:22:02 GMT) Full text and rfc822 format available.

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

From: Tomas Volf <~@wolfsden.cz>
To: Z572 <873216071 <at> qq.com>
Cc: 70115 <at> debbugs.gnu.org
Subject: Re: [bug#70115] [PATCH] gnu: skopeo: Update to 1.15.0.
Date: Mon, 1 Apr 2024 15:21:03 +0200
[Message part 1 (text/plain, inline)]
On 2024-04-01 20:37:45 +0800, Z572 wrote:
>
> Tomas Volf <~@wolfsden.cz> writes:
>
> > The package is also converted to gnu-build-system in order to take advantage
> > of already existing Makefile instead of reinventing (parts) of it in Guile.
> >
> > * gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
> > [build-system]: Use gnu-build-system.
> > [native-inputs]: Add go-1.21, sort.
> > [inputs]: Add bash-minimal.
> > [arguments]<#:import-path, #:install-source?>: Delete.
> > <#:make-flags, #:test-target, #:imported-modules>: New arguments.
> > <#:phases>{'configure}: Delete.
> > {'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.
> >
> > Change-Id: I1010e1f4fbdc093646c2879bdf30125ab2e88bdd
> > ---
> > This commit updates the skopeo, and also converts it to use
> > gnu-build-system.  Both is done in one commit, since 1.15 did not
> > built just by straight-forward update, and due to the intended rewrite
> > the time spent debugging that would be wasted.
> >
> > This (gnu-build-system) matches how podman and buildah are done in #70112
> > bringing all github.com/containers/* projects on the same model.
> >
> >  gnu/packages/virtualization.scm | 80 ++++++++++++++++++++++-----------
> >  1 file changed, 54 insertions(+), 26 deletions(-)
> >
> > diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
> > index 251fe00aa0..60f43c19cf 100644
> > --- a/gnu/packages/virtualization.scm
> > +++ b/gnu/packages/virtualization.scm
> > @@ -151,6 +151,7 @@ (define-module (gnu packages virtualization)
> >    #:use-module (guix gexp)
> >    #:use-module (guix git-download)
> >    #:use-module (guix packages)
> > +  #:use-module (guix modules)
> >    #:use-module (guix utils)
> >    #:use-module (srfi srfi-1)
> >    #:use-module (srfi srfi-26)
> > @@ -2257,7 +2258,7 @@ (define-public umoci
> >  (define-public skopeo
> >    (package
> >      (name "skopeo")
> > -    (version "1.2.3")
> > +    (version "1.15.0")
> >      (source (origin
> >                (method git-fetch)
> >                (uri (git-reference
> > @@ -2266,12 +2267,15 @@ (define-public skopeo
> >                (file-name (git-file-name name version))
> >                (sha256
> >                 (base32
> > -                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
> > -    (build-system go-build-system)
> > +                "1f9n3ysdmll7vq8dmgpv03m8aqq3w9cfvbmxxpwmnv1nlfc67ihq"))))
> > +    (build-system gnu-build-system)
> >      (native-inputs
> > -     (list pkg-config go-github-com-go-md2man))
> > +     (list go-1.21
> > +           go-github-com-go-md2man
> > +           pkg-config))
> >      (inputs
> > -     (list btrfs-progs
> > +     (list bash-minimal
> > +           btrfs-progs
> >             eudev
> >             libassuan
> >             libselinux
> > @@ -2280,27 +2284,51 @@ (define-public skopeo
> >             glib
> >             gpgme))
> >      (arguments
> > -     '(#:import-path "github.com/containers/skopeo"
> > -       #:install-source? #f
> > -       #:tests? #f                                ; The tests require Docker
> > -       #:phases
> > -       (modify-phases %standard-phases
> > -         (replace 'build
> > -           (lambda* (#:key import-path #:allow-other-keys)
> > -             (with-directory-excursion (string-append "src/" import-path)
> > -               (invoke "make" "bin/skopeo"))))
> > -         (add-after 'build 'build-docs
> > -           (lambda* (#:key import-path #:allow-other-keys)
> > -             (with-directory-excursion (string-append "src/" import-path)
> > -               (invoke "make" "docs"))))
> > -         (replace 'install
> > -           (lambda* (#:key import-path outputs #:allow-other-keys)
> > -             (with-directory-excursion (string-append "src/" import-path)
> > -               (let ((out (assoc-ref outputs "out")))
> > -                 (install-file "default-policy.json"
> > -                               (string-append out "/etc/containers"))
> > -                 (invoke "make" "install-binary" "install-completions" "install-docs"
> > -                         (string-append "PREFIX=" out)))))))))
> > +     (list
> > +      #:make-flags
> > +      #~(list (string-append "CC=" #$(cc-for-target))
> > +              "PREFIX="
> > +              (string-append "DESTDIR=" #$output)
> > +              (string-append "GOMD2MAN="
> > +                             #$go-github-com-go-md2man "/bin/go-md2man"))
> > +      #:tests? #f                       ; The tests require Docker
> > +      #:test-target "test-unit"
> > +      #:imported-modules
> > +      (source-module-closure `(,@%gnu-build-system-modules
> > +                               (guix build go-build-system)))
> > +      #:phases
> > +      #~(modify-phases %standard-phases
> > +          (delete 'configure)
> > +          (add-after 'unpack 'set-env
> > +            (lambda _
> > +              ;; When running go, things fail because HOME=/homeless-shelter.
> > +              (setenv "HOME" "/tmp")
> > +              ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
> > +              ;; Make <4.4 causing CC not to be propagated into $(shell ...)
> > +              ;; calls.  Can be removed once we update to >4.3.
> > +              ;;
> > +              ;; This techically does nothing *now*, but after upstream
> > +              ;; issue[1] is solved and 'cc-to-gcc phase is removed, it will
> > +              ;; start being required.
> > +              ;; 1: https://github.com/containers/skopeo/issues/2278
> > +              (setenv "CC" #$(cc-for-target))))
> > +          (add-after 'unpack 'cc-to-gcc
> > +            (lambda _
> > +              (for-each (lambda (file)
> > +                          (substitute* file
> > +                            (("^cc -" all)
> > +                             (string-append "g" all))))
>
> I don't think this is a good idea. Why not "$(CC)", this env can get
> from set-env phase.

I mean, sure, I could do that.  I do not think it really matters, since I *know*
we are building with gcc, but will change it.

>
> > +                        '("hack/btrfs_tag.sh"
> > +                          "hack/btrfs_installed_tag.sh"
> > +                          "hack/libdm_tag.sh"
> > +                          "hack/libsubid_tag.sh"))))
> > +          (add-after 'install 'wrap-skopeo
> > +            (lambda _
> > +              (wrap-program (string-append #$output "/bin/skopeo")
> > +                `("PATH" suffix
> > +                  ("/run/setuid-programs")))))
>
> It would be nice to add some comments about why need wrap /run/setuid-programs .

Will do.

>
> > +          (add-after 'install 'remove-go-references
> > +            (@@ (guix build go-build-system) remove-go-references)))))
> >      (home-page "https://github.com/containers/skopeo")
> >      (synopsis "Interact with container images and container image registries")
> >      (description
>

Thanks for review :)

Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#70115; Package guix-patches. (Mon, 01 Apr 2024 13:54:01 GMT) Full text and rfc822 format available.

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

From: Tomas Volf <~@wolfsden.cz>
To: 70115 <at> debbugs.gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH v2] gnu: skopeo: Update to 1.15.0.
Date: Mon,  1 Apr 2024 15:51:29 +0200
The package is also converted to gnu-build-system in order to take advantage
of already existing Makefile instead of reinventing (parts) of it in Guile.

* gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
[build-system]: Use gnu-build-system.
[native-inputs]: Add go-1.21, sort.
[inputs]: Add bash-minimal.
[arguments]<#:import-path, #:install-source?>: Delete.
<#:make-flags, #:test-target, #:imported-modules>: New arguments.
<#:phases>{'configure}: Delete.
{'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.

Change-Id: I1010e1f4fbdc093646c2879bdf30125ab2e88bdd
---
v2:
- Use "$CC" instead of hard-coding gcc.
- Add comment why /run/setuid-programs is required.

 gnu/packages/virtualization.scm | 81 ++++++++++++++++++++++-----------
 1 file changed, 55 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 251fe00aa0..34cccd6550 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -151,6 +151,7 @@ (define-module (gnu packages virtualization)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
+  #:use-module (guix modules)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -2257,7 +2258,7 @@ (define-public umoci
 (define-public skopeo
   (package
     (name "skopeo")
-    (version "1.2.3")
+    (version "1.15.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -2266,12 +2267,15 @@ (define-public skopeo
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0n22sdif437ddg5ch0ipwim3fg0n6ihc9bfi52qkhy3r1grz04hs"))))
-    (build-system go-build-system)
+                "1f9n3ysdmll7vq8dmgpv03m8aqq3w9cfvbmxxpwmnv1nlfc67ihq"))))
+    (build-system gnu-build-system)
     (native-inputs
-     (list pkg-config go-github-com-go-md2man))
+     (list go-1.21
+           go-github-com-go-md2man
+           pkg-config))
     (inputs
-     (list btrfs-progs
+     (list bash-minimal
+           btrfs-progs
            eudev
            libassuan
            libselinux
@@ -2280,27 +2284,52 @@ (define-public skopeo
            glib
            gpgme))
     (arguments
-     '(#:import-path "github.com/containers/skopeo"
-       #:install-source? #f
-       #:tests? #f                                ; The tests require Docker
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'build
-           (lambda* (#:key import-path #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (invoke "make" "bin/skopeo"))))
-         (add-after 'build 'build-docs
-           (lambda* (#:key import-path #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (invoke "make" "docs"))))
-         (replace 'install
-           (lambda* (#:key import-path outputs #:allow-other-keys)
-             (with-directory-excursion (string-append "src/" import-path)
-               (let ((out (assoc-ref outputs "out")))
-                 (install-file "default-policy.json"
-                               (string-append out "/etc/containers"))
-                 (invoke "make" "install-binary" "install-completions" "install-docs"
-                         (string-append "PREFIX=" out)))))))))
+     (list
+      #:make-flags
+      #~(list (string-append "CC=" #$(cc-for-target))
+              "PREFIX="
+              (string-append "DESTDIR=" #$output)
+              (string-append "GOMD2MAN="
+                             #$go-github-com-go-md2man "/bin/go-md2man"))
+      #:tests? #f                       ; The tests require Docker
+      #:test-target "test-unit"
+      #:imported-modules
+      (source-module-closure `(,@%gnu-build-system-modules
+                               (guix build go-build-system)))
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (add-after 'unpack 'set-env
+            (lambda _
+              ;; When running go, things fail because HOME=/homeless-shelter.
+              (setenv "HOME" "/tmp")
+              ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
+              ;; Make <4.4 causing CC not to be propagated into $(shell ...)
+              ;; calls.  Can be removed once we update to >4.3.
+              ;;
+              ;; This techically does nothing *now*, but after upstream
+              ;; issue[1] is solved and 'cc-to-gcc phase is removed, it will
+              ;; start being required.
+              ;; 1: https://github.com/containers/skopeo/issues/2278
+              (setenv "CC" #$(cc-for-target))))
+          (add-after 'unpack 'cc-to-gcc
+            (lambda _
+              (for-each (lambda (file)
+                          (substitute* file
+                            (("^cc( -.*)" all rest)
+                             (string-append "\"$CC\"" rest))))
+                        '("hack/btrfs_tag.sh"
+                          "hack/btrfs_installed_tag.sh"
+                          "hack/libdm_tag.sh"
+                          "hack/libsubid_tag.sh"))))
+          (add-after 'install 'wrap-skopeo
+            (lambda _
+              (wrap-program (string-append #$output "/bin/skopeo")
+                `("PATH" suffix
+                  ;; We need at least newuidmap, newgidmap and mount.
+                  ("/run/setuid-programs")))))
+          (add-after 'install 'remove-go-references
+            (@@ (guix build go-build-system) remove-go-references)))))
     (home-page "https://github.com/containers/skopeo")
     (synopsis "Interact with container images and container image registries")
     (description
--
2.41.0




Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 05 Apr 2024 11:32:02 GMT) Full text and rfc822 format available.

Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. (Fri, 05 Apr 2024 11:32:02 GMT) Full text and rfc822 format available.

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

From: Christopher Baines <mail <at> cbaines.net>
To: Tomas Volf <~@wolfsden.cz>
Cc: 70115-done <at> debbugs.gnu.org
Subject: Re: [bug#70115] [PATCH v2] gnu: skopeo: Update to 1.15.0.
Date: Fri, 05 Apr 2024 12:31:51 +0100
[Message part 1 (text/plain, inline)]
Tomas Volf <~@wolfsden.cz> writes:

> The package is also converted to gnu-build-system in order to take advantage
> of already existing Makefile instead of reinventing (parts) of it in Guile.
>
> * gnu/packages/virtualization.scm (skopeo)[version]: Update to 1.15.0.
> [build-system]: Use gnu-build-system.
> [native-inputs]: Add go-1.21, sort.
> [inputs]: Add bash-minimal.
> [arguments]<#:import-path, #:install-source?>: Delete.
> <#:make-flags, #:test-target, #:imported-modules>: New arguments.
> <#:phases>{'configure}: Delete.
> {'set-env, 'cc-to-gcc, 'wrap-skopeo, 'remove-go-references}: New phases.

Thanks both, I've pushed this to master as
142e1c2cf0de55ea7803f1f175a6022c24fa467f.

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

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 May 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified today.

Previous Next


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