[PATCH] gnu: buildah: Add 'buildah' package

  • Done
  • quality assurance status badge
Details
3 participants
  • Liliana Marie Prikler
  • Ludovic Courtès
  • Zongyuan Li
Owner
unassigned
Submitted by
Zongyuan Li
Severity
normal
Z
Z
Zongyuan Li wrote on 21 Feb 2023 15:35
(address . guix-patches@gnu.org)(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
20230221143500.42127-1-zongyuan.li@c0x0o.me
* gnu/packages/containers.scm: New 'buildah' package

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

Toggle diff (83 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 80c4aaa400..731a56075c 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -41,6 +41,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
@@ -405,3 +406,70 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list #$(string-append "CC="
+ (cc-for-target))
+ (string-append "PREFIX="
+ #$output))
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'set-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "HOME" "/tmp")))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^docs: install\\.tools")
+ "docs:"))))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^all: .*")
+ "all: bin/buildah docs"))))
+ (add-after 'unpack 'use-doc-tools
+ (lambda _
+ (substitute* "docs/Makefile"
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (invoke "make" "install.completions"
+ (string-append "PREFIX="
+ #$output)))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ go-github-com-go-md2man
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs (list bats git go-1.18 perl pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.37.1 (Apple Git-137.1)
Z
Z
Zongyuan Li wrote on 23 Feb 2023 08:04
[PATCH v2] gnu: buildah: Add 'buildah' package
(address . 61682@debbugs.gnu.org)(address . zongyuan.li@c0x0o.me)
20230223070338.51564-1-zongyuan.li@c0x0o.me
Introduce new 'buildah' package

Changes since v1:

* fix phase-name typo in modify-phases

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 68 +++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 50dfa88421..3844e4e700 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -41,6 +41,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
@@ -406,3 +407,70 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list #$(string-append "CC="
+ (cc-for-target))
+ (string-append "PREFIX="
+ #$output))
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'set-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "HOME" "/tmp")))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^docs: install\\.tools")
+ "docs:"))))
+ (add-after 'unpack 'avoid-unnecessary-targets
+ (lambda _
+ (substitute* "Makefile"
+ (("^all: .*")
+ "all: bin/buildah docs"))))
+ (add-after 'unpack 'use-doc-tools
+ (lambda _
+ (substitute* "docs/Makefile"
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (invoke "make" "install.completions"
+ (string-append "PREFIX="
+ #$output)))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ go-github-com-go-md2man
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs (list bats git go-1.18 perl pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.37.1 (Apple Git-137.1)
Z
Z
Zongyuan Li wrote on 23 Feb 2023 13:50
(address . guix-patches@gnu.org)(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
20230223125018.54412-1-zongyuan.li@c0x0o.me
Introduce new 'buildah' package

Changes since v1:

* fix phase-name typo in modify-phases

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 68 +++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 50dfa88421..3844e4e700 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -41,6 +41,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
@@ -406,3 +407,70 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list #$(string-append "CC="
+ (cc-for-target))
+ (string-append "PREFIX="
+ #$output))
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'set-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "HOME" "/tmp")))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^docs: install\\.tools")
+ "docs:"))))
+ (add-after 'unpack 'avoid-unnecessary-targets
+ (lambda _
+ (substitute* "Makefile"
+ (("^all: .*")
+ "all: bin/buildah docs"))))
+ (add-after 'unpack 'use-doc-tools
+ (lambda _
+ (substitute* "docs/Makefile"
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (invoke "make" "install.completions"
+ (string-append "PREFIX="
+ #$output)))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ go-github-com-go-md2man
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs (list bats git go-1.18 perl pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.39.1
Z
Z
Zongyuan Li wrote on 23 Feb 2023 12:31
[PATCH v2] gnu: buildah: Add 'buildah' package
(address . 61682@debbugs.gnu.org)(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
20230223113014.53355-1-zongyuan.li@c0x0o.me
Introduce new 'buildah' package

Changes since v1:

* fix phase-name typo in modify-phases

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 68 +++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 50dfa88421..3844e4e700 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -41,6 +41,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
@@ -406,3 +407,70 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list #$(string-append "CC="
+ (cc-for-target))
+ (string-append "PREFIX="
+ #$output))
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'set-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "HOME" "/tmp")))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^docs: install\\.tools")
+ "docs:"))))
+ (add-after 'unpack 'avoid-unnecessary-targets
+ (lambda _
+ (substitute* "Makefile"
+ (("^all: .*")
+ "all: bin/buildah docs"))))
+ (add-after 'unpack 'use-doc-tools
+ (lambda _
+ (substitute* "docs/Makefile"
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (invoke "make" "install.completions"
+ (string-append "PREFIX="
+ #$output)))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ go-github-com-go-md2man
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs (list bats git go-1.18 perl pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.39.1
Z
Z
Zongyuan Li wrote on 23 Feb 2023 13:26
(address . zongyuan.li@c0x0o.me)(address . 61682@debbugs.gnu.org)
20230223122508.53978-1-zongyuan.li@c0x0o.me
Introduce new 'buildah' package

Changes since v1:

* fix phase-name typo in modify-phases

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 68 +++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (83 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 50dfa88421..3844e4e700 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -41,6 +41,7 @@ (define-module (gnu packages containers)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages golang)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages python)
#:use-module (gnu packages networking)
#:use-module (gnu packages pkg-config)
@@ -406,3 +407,70 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list #$(string-append "CC="
+ (cc-for-target))
+ (string-append "PREFIX="
+ #$output))
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'set-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "HOME" "/tmp")))
+ (add-after 'unpack 'avoid-building-tools
+ (lambda _
+ (substitute* "Makefile"
+ (("^docs: install\\.tools")
+ "docs:"))))
+ (add-after 'unpack 'avoid-unnecessary-targets
+ (lambda _
+ (substitute* "Makefile"
+ (("^all: .*")
+ "all: bin/buildah docs"))))
+ (add-after 'unpack 'use-doc-tools
+ (lambda _
+ (substitute* "docs/Makefile"
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))))
+ (add-after 'install 'install-completions
+ (lambda _
+ (invoke "make" "install.completions"
+ (string-append "PREFIX="
+ #$output)))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ go-github-com-go-md2man
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs (list bats git go-1.18 perl pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.39.1
L
L
Liliana Marie Prikler wrote on 24 Feb 2023 06:20
(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)(address . 61682@debbugs.gnu.org)
bc757ac0a445738883d52e1cd722af7b15461573.camel@gmail.com
Am Donnerstag, dem 23.02.2023 um 12:26 +0000 schrieb Zongyuan Li:
Toggle quote (45 lines)
> Introduce new 'buildah' package
>
> Changes since v1:
>
>    * fix phase-name typo in modify-phases
>
> * gnu/packages/containers.scm: New 'buildah' package
> ---
>  gnu/packages/containers.scm | 68
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 68 insertions(+)
>
> diff --git a/gnu/packages/containers.scm
> b/gnu/packages/containers.scm
> index 50dfa88421..3844e4e700 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -41,6 +41,7 @@ (define-module (gnu packages containers)
>    #:use-module (gnu packages gnupg)
>    #:use-module (gnu packages golang)
>    #:use-module (gnu packages linux)
> +  #:use-module (gnu packages perl)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages networking)
>    #:use-module (gnu packages pkg-config)
> @@ -406,3 +407,70 @@ (define-public podman
>  volumes mounted into those containers, and pods made from groups of
>  containers.")
>      (license license:asl2.0)))
> +
> +(define-public buildah
> +  (package
> +    (name "buildah")
> +    (version "1.29.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/containers/buildah")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
> +    (build-system gnu-build-system)
As fun as it sounds to build Go stuff with just a Makefile, you have a
lot of vendored code unaccounted for.
Toggle quote (47 lines)
> +    (arguments
> +     (list #:make-flags #~(list #$(string-append "CC="
> +                                                 (cc-for-target))
> +                                (string-append "PREFIX="
> +                                               #$output))
> +           #:tests? #f
> +           #:phases #~(modify-phases %standard-phases
> +                        (delete 'configure)
> +                        (add-after 'unpack 'set-env
> +                          (lambda* (#:key inputs #:allow-other-keys)
> +                            (setenv "HOME" "/tmp")))
> +                        (add-after 'unpack 'avoid-building-tools
> +                          (lambda _
> +                            (substitute* "Makefile"
> +                              (("^docs: install\\.tools")
> +                               "docs:"))))
> +                        (add-after 'unpack 'avoid-unnecessary-
> targets
> +                          (lambda _
> +                            (substitute* "Makefile"
> +                              (("^all: .*")
> +                               "all: bin/buildah docs"))))
> +                        (add-after 'unpack 'use-doc-tools
> +                          (lambda _
> +                            (substitute* "docs/Makefile"
> +                              (("../tests/tools/build/go-md2man")
> +                               (which "go-md2man")))))
> +                        (add-after 'install 'install-completions
> +                          (lambda _
> +                            (invoke "make" "install.completions"
> +                                    (string-append "PREFIX="
> +                                                   #$output)))))))
> +    (inputs (list btrfs-progs
> +                  cni-plugins
> +                  conmon
> +                  eudev
> +                  glib
> +                  go-github-com-go-md2man
> +                  gpgme
> +                  libassuan
> +                  libseccomp
> +                  lvm2
> +                  runc))
> +    (native-inputs (list bats git go-1.18 perl pkg-config))
> +    (synopsis
> +     "Facilitates building Open Container Initiative (OCI) container
> images")
Try to stay short in your synopsis.
Toggle quote (2 lines)
> +    (description
> +     "Buildah is an open source,
Buzzword.
Toggle quote (2 lines)
> Linux-based tool used to build Open Container
> +Initiative (OCI)-compatible containers.  
Perhaps use @abbrev?

Toggle quote (3 lines)
> With Buildah, you can use your
> +favorite tools to create efficient container images from an existing
> base image
Can I use Guix to do that?

Cheers
Z
Z
Zongyuan Li wrote on 24 Feb 2023 08:12
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 61682@debbugs.gnu.org)
ADB411B1-39B9-41B9-B6AA-1EA6FB10D0C7@c0x0o.me
Thanks your review! I will try to use go-build-system.

I noticed that ‘podman’ package also uses makefile. Maybe we could improve that later too?

Li

Toggle quote (111 lines)
> On Feb 24, 2023, at 13:20, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:
>
> Am Donnerstag, dem 23.02.2023 um 12:26 +0000 schrieb Zongyuan Li:
>> Introduce new 'buildah' package
>>
>> Changes since v1:
>>
>> * fix phase-name typo in modify-phases
>>
>> * gnu/packages/containers.scm: New 'buildah' package
>> ---
>> gnu/packages/containers.scm | 68
>> +++++++++++++++++++++++++++++++++++++
>> 1 file changed, 68 insertions(+)
>>
>> diff --git a/gnu/packages/containers.scm
>> b/gnu/packages/containers.scm
>> index 50dfa88421..3844e4e700 100644
>> --- a/gnu/packages/containers.scm
>> +++ b/gnu/packages/containers.scm
>> @@ -41,6 +41,7 @@ (define-module (gnu packages containers)
>> #:use-module (gnu packages gnupg)
>> #:use-module (gnu packages golang)
>> #:use-module (gnu packages linux)
>> + #:use-module (gnu packages perl)
>> #:use-module (gnu packages python)
>> #:use-module (gnu packages networking)
>> #:use-module (gnu packages pkg-config)
>> @@ -406,3 +407,70 @@ (define-public podman
>> volumes mounted into those containers, and pods made from groups of
>> containers.")
>> (license license:asl2.0)))
>> +
>> +(define-public buildah
>> + (package
>> + (name "buildah")
>> + (version "1.29.0")
>> + (source (origin
>> + (method git-fetch)
>> + (uri (git-reference
>> + (url "https://github.com/containers/buildah")
>> + (commit (string-append "v" version))))
>> + (file-name (git-file-name name version))
>> + (sha256
>> + (base32
>> +
>> "16kc19m5in819624c3np4aqb9hkjc93d34y4958jqy1k3p2p5rir"))))
>> + (build-system gnu-build-system)
> As fun as it sounds to build Go stuff with just a Makefile, you have a
> lot of vendored code unaccounted for.
>> + (arguments
>> + (list #:make-flags #~(list #$(string-append "CC="
>> + (cc-for-target))
>> + (string-append "PREFIX="
>> + #$output))
>> + #:tests? #f
>> + #:phases #~(modify-phases %standard-phases
>> + (delete 'configure)
>> + (add-after 'unpack 'set-env
>> + (lambda* (#:key inputs #:allow-other-keys)
>> + (setenv "HOME" "/tmp")))
>> + (add-after 'unpack 'avoid-building-tools
>> + (lambda _
>> + (substitute* "Makefile"
>> + (("^docs: install\\.tools")
>> + "docs:"))))
>> + (add-after 'unpack 'avoid-unnecessary-
>> targets
>> + (lambda _
>> + (substitute* "Makefile"
>> + (("^all: .*")
>> + "all: bin/buildah docs"))))
>> + (add-after 'unpack 'use-doc-tools
>> + (lambda _
>> + (substitute* "docs/Makefile"
>> + (("../tests/tools/build/go-md2man")
>> + (which "go-md2man")))))
>> + (add-after 'install 'install-completions
>> + (lambda _
>> + (invoke "make" "install.completions"
>> + (string-append "PREFIX="
>> + #$output)))))))
>> + (inputs (list btrfs-progs
>> + cni-plugins
>> + conmon
>> + eudev
>> + glib
>> + go-github-com-go-md2man
>> + gpgme
>> + libassuan
>> + libseccomp
>> + lvm2
>> + runc))
>> + (native-inputs (list bats git go-1.18 perl pkg-config))
>> + (synopsis
>> + "Facilitates building Open Container Initiative (OCI) container
>> images")
> Try to stay short in your synopsis.
>> + (description
>> + "Buildah is an open source,
> Buzzword.
>> Linux-based tool used to build Open Container
>> +Initiative (OCI)-compatible containers.
> Perhaps use @abbrev?
>
>> With Buildah, you can use your
>> +favorite tools to create efficient container images from an existing
>> base image
> Can I use Guix to do that?
>
> Cheers
Z
Z
Zongyuan Li wrote on 24 Mar 2023 11:14
[PATCH v3 1/1] gnu: buildah: Add 'buildah' package
(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
29eeb5f527c4eb6f966e5d0365b459f980dbb0b9.1679652457.git.zongyuan.li@c0x0o.me
gnu: buildah: Add 'buildah' package

Introduce new 'buildah' package

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 73 +++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)

Toggle diff (81 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index b316588ea2..c20bcdaba3 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -406,3 +406,76 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1mcqkz68fjccdla1bgxw57w268a586brm6x28fcm6x425ah0w07h"))))
+ (build-system go-build-system)
+ (arguments
+ (list #:import-path "github.com/containers/buildah/cmd/buildah"
+ #:unpack-path "github.com/containers/buildah"
+ ; Some dependencies require go-1.18 to build
+ #:go go-1.18
+ #:tests? #f
+ #:build-flags
+ ; These information is constructed in 'buildah' Makefile.
+ #~(list (string-append "-ldflags=-X main.GitCommit="
+ "faf0d4fcbaede00f4e615dc5cc2ccc816f240cfe"
+ " -X main.cniVersion=v1.1.2"))
+ #:install-source? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'prepare-install-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (substitute* (string-append "src/"
+ unpack-path
+ "/docs/Makefile")
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))
+ (substitute* (string-append "src/"
+ unpack-path
+ "/docs/Makefile")
+ (("/usr/local") (string-append #$output)))))
+ (add-after 'build 'build-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (let*
+ ((doc-path (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc-path))))
+ (add-after 'install 'install-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (let*
+ ((doc-path (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc-path "install")))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs
+ (list go-github-com-go-md2man
+ gnu-make
+ pkg-config))
+ (synopsis
+ "Facilitates building Open Container Initiative (OCI) container images")
+ (description
+ "Buildah is an open source, Linux-based tool used to build Open Container
+Initiative (OCI)-compatible containers. With Buildah, you can use your
+favorite tools to create efficient container images from an existing base image
+or from scratch using an empty image.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.37.1 (Apple Git-137.1)
Z
Z
Zongyuan Li wrote on 24 Mar 2023 11:14
[PATCH v3 0/1] gnu: buildah: Add 'buildah' package
(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
cover.1679652457.git.zongyuan.li@c0x0o.me
Introduce new 'buildah' package

Changes since v2:
* Use go-build-system to avoid vendered code in Makefile
* Bump version to the latest v1.29.1
* Remove some unused dependencies

Zongyuan Li (1):
gnu: buildah: Add 'buildah' package

gnu/packages/containers.scm | 73 +++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)

--
2.37.1 (Apple Git-137.1)
L
L
Liliana Marie Prikler wrote on 24 Mar 2023 19:00
Re: [PATCH v3 1/1] gnu: buildah: Add 'buildah' package
2b0a6af1211460dbf82f8e09997ad2de1f6ec0ea.camel@gmail.com
Am Freitag, dem 24.03.2023 um 10:14 +0000 schrieb Zongyuan Li:
Toggle quote (42 lines)
> gnu: buildah: Add 'buildah' package
>
> Introduce new 'buildah' package
>
> * gnu/packages/containers.scm: New 'buildah' package
> ---
>  gnu/packages/containers.scm | 73
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>
> diff --git a/gnu/packages/containers.scm
> b/gnu/packages/containers.scm
> index b316588ea2..c20bcdaba3 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -406,3 +406,76 @@ (define-public podman
>  volumes mounted into those containers, and pods made from groups of
>  containers.")
>      (license license:asl2.0)))
> +
> +(define-public buildah
> +  (package
> +    (name "buildah")
> +    (version "1.29.1")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/containers/buildah")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "1mcqkz68fjccdla1bgxw57w268a586brm6x28fcm6x425ah0w07h"))))
> +    (build-system go-build-system)
> +    (arguments
> +      (list #:import-path
> "github.com/containers/buildah/cmd/buildah"
> +            #:unpack-path "github.com/containers/buildah"
> +            ; Some dependencies require go-1.18 to build
> +            #:go go-1.18
> +            #:tests? #f
#:tests? #f always needs an explanation
Toggle quote (6 lines)
> +            #:build-flags
> +            ; These information is constructed in 'buildah'
> Makefile.
> +            #~(list (string-append "-ldflags=-X main.GitCommit="
> +                                  
> "faf0d4fcbaede00f4e615dc5cc2ccc816f240cfe"
I think we should either look towards dropping this flag, or
alternatively let-bind the git commit and use it in the version and
origin as well.
Toggle quote (44 lines)
> +                                   " -X main.cniVersion=v1.1.2"))
> +            #:install-source? #f
> +            #:phases
> +            #~(modify-phases %standard-phases
> +                (add-after 'unpack 'prepare-install-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (substitute* (string-append "src/"
> +                                                unpack-path
> +                                                "/docs/Makefile")
> +                      (("../tests/tools/build/go-md2man")
> +                       (which "go-md2man")))
> +                    (substitute* (string-append "src/"
> +                                                unpack-path
> +                                                "/docs/Makefile")
> +                      (("/usr/local") (string-append #$output)))))
> +                (add-after 'build 'build-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (let*
> +                      ((doc-path (string-append "src/" unpack-path
> "/docs")))
> +                      (invoke "make" "-C" doc-path))))
> +                (add-after 'install 'install-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (let*
> +                      ((doc-path (string-append "src/" unpack-path
> "/docs")))
> +                      (invoke "make" "-C" doc-path "install")))))))
> +    (inputs (list btrfs-progs
> +                  cni-plugins
> +                  conmon
> +                  eudev
> +                  glib
> +                  gpgme
> +                  libassuan
> +                  libseccomp
> +                  lvm2
> +                  runc))
> +    (native-inputs
> +     (list go-github-com-go-md2man
> +           gnu-make
> +           pkg-config))
> +    (synopsis
> +     "Facilitates building Open Container Initiative (OCI) container
> images")
Simplify to "Build Open Container Initiative images"
Toggle quote (3 lines)
> +    (description
> +     "Buildah is an open source, Linux-based tool used to build Open
> Container
Drop open source and Linux-based, they're meaningless filler.
Toggle quote (1 lines)
> +Initiative (OCI)-compatible containers.  With Buildah, you can use
Use @acronym{OCI, Open Container Initiative}. Avoid invoking the
department of redundancy department, also known as the redundant
acronym syndrome syndrome.
Toggle quote (4 lines)
> your
> +favorite tools to create efficient container images from an existing
> base image
> +or from scratch using an empty image.")
This second sentence is still as empty as the first time I reviewed it.
Consider dropping it as well.

Cheers
Z
Z
Zongyuan Li wrote on 25 Mar 2023 11:23
[PATCH v4 0/1] gnu: buildah: Add 'buildah' package
(address . 61682@debbugs.gnu.org)
cover.1679739400.git.zongyuan.li@c0x0o.me
gnu: buildah: Add 'buildah' package

We do not run any tests because buildah needs 'root' user
to make tests work.

Changes since v3:
* Remove build flags
* Simplify synopsis and description

Zongyuan Li (1):
gnu: buildah: Add 'buildah' package

gnu/packages/containers.scm | 66 +++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)

--
2.37.1 (Apple Git-137.1)
L
L
Liliana Marie Prikler wrote on 25 Mar 2023 11:46
Re: [PATCH v3 1/1] gnu: buildah: Add 'buildah' package
(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)(address . 61682@debbugs.gnu.org)
b5aecaf88b3d2397711ba50290cf54195310b70f.camel@gmail.com
Am Samstag, dem 25.03.2023 um 09:15 +0000 schrieb Zongyuan Li:
Toggle quote (2 lines)
> Tests of buildah requires root user to run. Is there any way for us
> to do that?
Can we try with fakeroot or something?
L
L
Liliana Marie Prikler wrote on 25 Mar 2023 12:09
Re: [PATCH v4 1/1] gnu: buildah: Add 'buildah' package
c9fcb8ac8ffd85428fbdf853982f68f9474fcce5.camel@gmail.com
Am Samstag, dem 25.03.2023 um 10:25 +0000 schrieb Zongyuan Li:
Toggle quote (5 lines)
> gnu: buildah: Add 'buildah' package
>
> Introduce new 'buildah' package
>
> * gnu/packages/containers.scm: New 'buildah' package
gnu: Add buildah.

* gnu/packages/containers.scm (buildah): New variable.

Toggle quote (35 lines)
> ---
>  gnu/packages/containers.scm | 66
> +++++++++++++++++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>
> diff --git a/gnu/packages/containers.scm
> b/gnu/packages/containers.scm
> index b316588ea2..43d215ea6a 100644
> --- a/gnu/packages/containers.scm
> +++ b/gnu/packages/containers.scm
> @@ -406,3 +406,69 @@ (define-public podman
>  volumes mounted into those containers, and pods made from groups of
>  containers.")
>      (license license:asl2.0)))
> +
> +(define-public buildah
> +  (package
> +    (name "buildah")
> +    (version "1.29.1")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/containers/buildah")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "1mcqkz68fjccdla1bgxw57w268a586brm6x28fcm6x425ah0w07h"))))
> +    (build-system go-build-system)
> +    (arguments
> +      (list #:import-path
> "github.com/containers/buildah/cmd/buildah"
> +            #:unpack-path "github.com/containers/buildah"
> +            ; Some dependencies require go-1.18 to build
Single ; comments go on the same line.
Toggle quote (2 lines)
> +            #:go go-1.18
> +            #:tests? #f
Again, no comment for #:tests? #f?
Toggle quote (45 lines)
> +            #:install-source? #f
> +            #:phases
> +            #~(modify-phases %standard-phases
> +                (add-after 'unpack 'prepare-install-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (substitute* (string-append "src/"
> +                                                unpack-path
> +                                                "/docs/Makefile")
> +                      (("../tests/tools/build/go-md2man")
> +                       (which "go-md2man")))
> +                    (substitute* (string-append "src/"
> +                                                unpack-path
> +                                                "/docs/Makefile")
> +                      (("/usr/local") (string-append #$output)))))
> +                (add-after 'build 'build-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (let*
> +                      ((doc-path (string-append "src/" unpack-path
> "/docs")))
> +                      (invoke "make" "-C" doc-path))))
> +                (add-after 'install 'install-docs
> +                  (lambda* (#:key unpack-path #:allow-other-keys)
> +                    (let*
> +                      ((doc-path (string-append "src/" unpack-path
> "/docs")))
> +                      (invoke "make" "-C" doc-path "install")))))))
> +    (inputs (list btrfs-progs
> +                  cni-plugins
> +                  conmon
> +                  eudev
> +                  glib
> +                  gpgme
> +                  libassuan
> +                  libseccomp
> +                  lvm2
> +                  runc))
> +    (native-inputs
> +     (list go-github-com-go-md2man
> +           gnu-make
> +           pkg-config))
> +    (synopsis
> +     "Build Open Container Initiative images")
> +    (description
> +     "Buildah is used to build Open Container Initiative
> +@acronym{OCI, Open Container Initiative} compatible containers.")
Open Container Initiative Open Container Initiative compatible
containers.

Cheers
Z
Z
Zongyuan Li wrote on 25 Mar 2023 10:15
Re: [PATCH v3 1/1] gnu: buildah: Add 'buildah' package
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 61682@debbugs.gnu.org)
1C372797-C516-4551-9DF1-5B8B2BAB9843@c0x0o.me
Tests of buildah requires root user to run. Is there any way for us to do that?

Thanks
Z
Z
Zongyuan Li wrote on 25 Mar 2023 12:02
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 61682@debbugs.gnu.org)
E0333AC2-CAF5-4B4C-94E6-B9F5DCABA4F2@c0x0o.me
Toggle quote (4 lines)
> On Mar 25, 2023, at 18:46, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:
>
> Can we try with fakeroot or something?

I did some research on source code, and find following code under buildah tests:

Toggle quote (9 lines)
> func failTestIfNotRoot(t *testing.T) {
> u, err := user.Current()
> if err != nil {
> t.Log("Could not determine user. Running without root may cause tests to fail")
> } else if u.Uid != "0" {
> t.Fatal("tests will fail unless run as root")
> }
> }

There’s an hard coded uid. I haven’t seen any way to workaround it. Do we have any
facility to run ‘check’ phase under an isolated environment(eg. container)?

Thanks
Z
Z
Zongyuan Li wrote on 25 Mar 2023 11:25
[PATCH v4 1/1] gnu: buildah: Add 'buildah' package
(address . 61682@debbugs.gnu.org)
e526a59655eadcf95343fd7030c3157b867f7261.1679739400.git.zongyuan.li@c0x0o.me
gnu: buildah: Add 'buildah' package

Introduce new 'buildah' package

* gnu/packages/containers.scm: New 'buildah' package
---
gnu/packages/containers.scm | 66 +++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)

Toggle diff (74 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index b316588ea2..43d215ea6a 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -406,3 +406,69 @@ (define-public podman
volumes mounted into those containers, and pods made from groups of
containers.")
(license license:asl2.0)))
+
+(define-public buildah
+ (package
+ (name "buildah")
+ (version "1.29.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/containers/buildah")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1mcqkz68fjccdla1bgxw57w268a586brm6x28fcm6x425ah0w07h"))))
+ (build-system go-build-system)
+ (arguments
+ (list #:import-path "github.com/containers/buildah/cmd/buildah"
+ #:unpack-path "github.com/containers/buildah"
+ ; Some dependencies require go-1.18 to build
+ #:go go-1.18
+ #:tests? #f
+ #:install-source? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'prepare-install-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (substitute* (string-append "src/"
+ unpack-path
+ "/docs/Makefile")
+ (("../tests/tools/build/go-md2man")
+ (which "go-md2man")))
+ (substitute* (string-append "src/"
+ unpack-path
+ "/docs/Makefile")
+ (("/usr/local") (string-append #$output)))))
+ (add-after 'build 'build-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (let*
+ ((doc-path (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc-path))))
+ (add-after 'install 'install-docs
+ (lambda* (#:key unpack-path #:allow-other-keys)
+ (let*
+ ((doc-path (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc-path "install")))))))
+ (inputs (list btrfs-progs
+ cni-plugins
+ conmon
+ eudev
+ glib
+ gpgme
+ libassuan
+ libseccomp
+ lvm2
+ runc))
+ (native-inputs
+ (list go-github-com-go-md2man
+ gnu-make
+ pkg-config))
+ (synopsis
+ "Build Open Container Initiative images")
+ (description
+ "Buildah is used to build Open Container Initiative
+@acronym{OCI, Open Container Initiative} compatible containers.")
+ (home-page "https://buildah.io")
+ (license license:asl2.0)))
--
2.37.1 (Apple Git-137.1)
L
L
Ludovic Courtès wrote on 8 Jun 2023 23:27
Re: bug#61682: [PATCH] gnu: buildah: Add 'buildah' package
(name . Zongyuan Li)(address . zongyuan.li@c0x0o.me)
87edmlzltg.fsf_-_@gnu.org
Hi,

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

Toggle quote (6 lines)
> gnu: buildah: Add 'buildah' package
>
> Introduce new 'buildah' package
>
> * gnu/packages/containers.scm: New 'buildah' package

Finally applied with the changes below, most of which were suggested by
Liliana.

Thanks,
Ludo’.
Toggle diff (63 lines)
diff --git a/gnu/packages/containers.scm b/gnu/packages/containers.scm
index 839d81cd0e..eb7699c505 100644
--- a/gnu/packages/containers.scm
+++ b/gnu/packages/containers.scm
@@ -414,8 +414,10 @@ (define-public buildah
(arguments
(list #:import-path "github.com/containers/buildah/cmd/buildah"
#:unpack-path "github.com/containers/buildah"
- ; Some dependencies require go-1.18 to build
+
+ ;; Some dependencies require go-1.18 to build.
#:go go-1.18
+
#:tests? #f
#:install-source? #f
#:phases
@@ -433,14 +435,12 @@ (define-public buildah
(("/usr/local") (string-append #$output)))))
(add-after 'build 'build-docs
(lambda* (#:key unpack-path #:allow-other-keys)
- (let*
- ((doc-path (string-append "src/" unpack-path "/docs")))
- (invoke "make" "-C" doc-path))))
+ (let ((doc (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc))))
(add-after 'install 'install-docs
(lambda* (#:key unpack-path #:allow-other-keys)
- (let*
- ((doc-path (string-append "src/" unpack-path "/docs")))
- (invoke "make" "-C" doc-path "install")))))))
+ (let ((doc (string-append "src/" unpack-path "/docs")))
+ (invoke "make" "-C" doc "install")))))))
(inputs (list btrfs-progs
cni-plugins
conmon
@@ -455,10 +455,23 @@ (define-public buildah
(list go-github-com-go-md2man
gnu-make
pkg-config))
- (synopsis
- "Build Open Container Initiative images")
+ (synopsis "Build @acronym{OCI, Open Container Initiative} images")
(description
- "Buildah is used to build Open Container Initiative
-@acronym{OCI, Open Container Initiative} compatible containers.")
+ "Buildah is a command-line tool to build @acronym{OCI, Open Container
+Initiative} container images. More generally, it can be used to:
+
+@itemize
+@item
+create a working container, either from scratch or using an image as a
+starting point;
+@item
+create an image, either from a working container or via the instructions
+in a @file{Dockerfile};
+@item
+mount a working container's root filesystem for manipulation;
+@item
+use the updated contents of a container's root filesystem as a filesystem
+layer to create a new image.
+@end itemize")
(home-page "https://buildah.io")
(license license:asl2.0)))
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 61682@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 61682
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch