unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: kiasoc5--- via Guix-patches via <guix-patches@gnu.org>
To: 53040@debbugs.gnu.org
Cc: ludo@gnu.org
Subject: [bug#53040] [PATCH] gnu: bubblewrap: Update to 0.5.0.
Date: Tue, 11 Jan 2022 00:14:19 +0100 (CET)	[thread overview]
Message-ID: <Mt4VcpI--3-2@tutanota.com> (raw)
In-Reply-To: <MsgRpG_--3-2@tutanota.com>

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Fixed locale in tests, thanks Ludo for the suggestion via email. Also fixed more test substitutions and simplified inputs.

[-- Attachment #2: 0001-gnu-bubblewrap-Update-to-0.5.0.patch --]
[-- Type: text/x-patch, Size: 5930 bytes --]

From f5c56100d62d315c3ed860898998a7c8afc78d50 Mon Sep 17 00:00:00 2001
From: kiasoc5 <kiasoc5@tutanota.com>
Date: Mon, 10 Jan 2022 17:58:35 -0500
Subject: [PATCH] gnu: bubblewrap: Update to 0.5.0.

* gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch: Add it.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/virtualization.scm (bubblewrap): Update to 0.5.0.
[source]: Add patch.
[arguments]: Adjust test substitutions.
[inputs]: Remove labels.
[native-inputs]: Remove labels.
---
 gnu/local.mk                                  |  1 +
 .../bubblewrap-fix-locale-in-tests.patch      | 34 +++++++++++++++++++
 gnu/packages/virtualization.scm               | 24 ++++++++-----
 3 files changed, 50 insertions(+), 9 deletions(-)
 create mode 100644 gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index fe21cf8062..c511d78c07 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -910,6 +910,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/binutils-mingw-w64-deterministic.patch	\
   %D%/packages/patches/bpftrace-disable-bfd-disasm.patch	\
   %D%/packages/patches/byobu-writable-status.patch		\
+  %D%/packages/patches/bubblewrap-fix-locale-in-tests.patch	\
   %D%/packages/patches/cabal-install-base16-bytestring1.0.patch		\
   %D%/packages/patches/cabal-install-ghc8.10.patch		\
   %D%/packages/patches/cairo-CVE-2018-19876.patch		\
diff --git a/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch b/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch
new file mode 100644
index 0000000000..bd5924ef87
--- /dev/null
+++ b/gnu/packages/patches/bubblewrap-fix-locale-in-tests.patch
@@ -0,0 +1,34 @@
+From 9282223de4b511aeda3b7d2caf3810a56a865710 Mon Sep 17 00:00:00 2001
+From: kiasoc5 <kiasoc5@tutanota.com>
+Date: Mon, 10 Jan 2022 14:16:32 -0500
+Subject: [PATCH] Use C locale unconditionally for tests.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The ‘en_US.utf8’ locale is available. However, the ‘locale -a’ command won’t list it.
+---
+ tests/libtest-core.sh | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/tests/libtest-core.sh b/tests/libtest-core.sh
+index 9632e90..82951dd 100644
+--- a/tests/libtest-core.sh
++++ b/tests/libtest-core.sh
+@@ -41,12 +41,7 @@ assert_not_reached () {
+ #
+ # If we can't find the locale command assume we have support for C.UTF-8
+ # (e.g. musl based systems)
+-if type -p locale >/dev/null; then
+-    export LC_ALL=$(locale -a | grep -iEe '^(C|en_US)\.(UTF-8|utf8)$' | head -n1 || true)
+-    if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi
+-else
+-    export LC_ALL=C.UTF-8
+-fi
++export LC_ALL=en_US.utf8
+ # A GNU extension, used whenever LC_ALL is not C
+ unset LANGUAGE
+ 
+-- 
+2.34.1
+
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 6a40955dbb..39acb90570 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1927,7 +1927,7 @@ (define-public python-vagrant
 (define-public bubblewrap
   (package
     (name "bubblewrap")
-    (version "0.4.1")
+    (version "0.5.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/containers/bubblewrap/"
@@ -1935,7 +1935,8 @@ (define-public bubblewrap
                                   version ".tar.xz"))
               (sha256
                (base32
-                "00ycgi6q2yngh06bnz50wkvar6r2jnjf3j158grhi9k13jdrpimr"))))
+                "0608l2sjwhnb1c0mslah1h6yjvqr17wk60by6i710qwxg4rszz8n"))
+               (patches (search-patches "bubblewrap-fix-locale-in-tests.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -1951,7 +1952,9 @@ (define-public bubblewrap
                (substitute* "tests/test-run.sh"
                  (("/var/tmp") tmp-dir)
                  ;; Tests create a temporary python script, so fix its shebang.
-                 (("/usr/bin/env python") (which "python"))
+                 (("/usr/bin/env python3") (which "python3"))
+                 ;; Tests call /usr/bin/env, so fix its path.
+                 (("/usr/bin/env") (which "env"))
                  ;; Some tests try to access /usr, but that doesn't exist.
                  ;; Give them /gnu instead.
                  (("/usr") "/gnu")
@@ -1960,18 +1963,21 @@ (define-public bubblewrap
                  (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")
                  (("  */bin/bash") (which "bash"))
                  (("/bin/sh") (which "sh"))
-                 (("findmnt") (which "findmnt"))))
+                 (("findmnt") (which "findmnt")))
+               (substitute* "tests/libtest.sh"
+                 (("/var/tmp") tmp-dir)
+                 (("/usr") "/gnu")
+                 (("--ro-bind /bin /bin") "--ro-bind /gnu /bin")
+                 (("--ro-bind /sbin /sbin") "--ro-bind /gnu /sbin")
+                 (("--ro-bind /lib /lib") "--ro-bind /gnu /lib")))
              #t))
          ;; Remove the directory we gave to tests to have a clean package.
          (add-after 'check 'remove-tmp-dir
            (lambda* (#:key outputs #:allow-other-keys)
              (delete-file-recursively (string-append (assoc-ref outputs "out") "/tmp"))
              #t)))))
-    (inputs
-     (list libcap))
-    (native-inputs
-     `(("python" ,python-wrapper)
-       ("util-linux" ,util-linux)))
+    (inputs (list libcap))
+    (native-inputs (list python-wrapper util-linux))
     (home-page "https://github.com/containers/bubblewrap")
     (synopsis "Unprivileged sandboxing tool")
     (description "Bubblewrap is aimed at running applications in a sandbox,

base-commit: 19a4759cadf601f40d2a32efdbf6190d7341a8ca
-- 
2.34.1


  parent reply	other threads:[~2022-01-10 23:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 22:54 [bug#53040] [PATCH] gnu: bubblewrap: Update to 0.5.0 kiasoc5--- via Guix-patches via
2022-01-09 21:50 ` Ludovic Courtès
2022-01-12 16:42   ` Josselin Poiret via Guix-patches via
2022-01-10 23:14 ` kiasoc5--- via Guix-patches via [this message]
2022-01-11 17:52   ` Ludovic Courtès
2022-01-11 21:46     ` kiasoc5--- via Guix-patches via
2022-01-13 21:55       ` bug#53040: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Mt4VcpI--3-2@tutanota.com \
    --to=guix-patches@gnu.org \
    --cc=53040@debbugs.gnu.org \
    --cc=kiasoc5@tutanota.com \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).