From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IAnGFQk5AWLRjwAAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 16:21:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id SNf6Egk5AWKdowAA9RJhRA (envelope-from ) for ; Mon, 07 Feb 2022 16:21:45 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AD75313FF6 for ; Mon, 7 Feb 2022 16:21:44 +0100 (CET) Received: from localhost ([::1]:41166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH5pm-00042Q-R7 for larch@yhetil.org; Mon, 07 Feb 2022 10:21:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH5MV-0000tK-A6 for guix-patches@gnu.org; Mon, 07 Feb 2022 09:51:30 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nH5M5-0002c2-R4 for guix-patches@gnu.org; Mon, 07 Feb 2022 09:51:26 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nH5M5-0007xu-Jt for guix-patches@gnu.org; Mon, 07 Feb 2022 09:51:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52576] About the upgrade of ibus-anthy Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Feb 2022 14:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52576 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Taiju HIGASHI Cc: 52576@debbugs.gnu.org, Liliana Marie Prikler Received: via spool by 52576-submit@debbugs.gnu.org id=B52576.164424545530602 (code B ref 52576); Mon, 07 Feb 2022 14:51:01 +0000 Received: (at 52576) by debbugs.gnu.org; 7 Feb 2022 14:50:55 +0000 Received: from localhost ([127.0.0.1]:41401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nH5Lu-0007xP-1O for submit@debbugs.gnu.org; Mon, 07 Feb 2022 09:50:55 -0500 Received: from lepiller.eu ([89.234.186.109]:46816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nH5Lr-0007xF-BH for 52576@debbugs.gnu.org; Mon, 07 Feb 2022 09:50:48 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id b9be17c7; Mon, 7 Feb 2022 14:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=oyHgMmL1fLfydVm7vhvcK3iTE9YxjO7OCwP4u6 uDuM8=; b=CGV6ZaENH7eQu1lo7bDA5XEFBa+ZcoYLtzBLr2DgfRk5FB5FJOQqHD U175okh6znB76qaCQTmgBDocBS2G5+JJqe3kJE2Kx/W0kUW/Nkd0GmW1HnmVZW/B QIe5KjaB6IOEGtZw0lN3IeXrLrZfFWhcxWUYJO5PJGBcLYpm3d+XmYDb0g/1RTKL iEdKKk9avhTtTqj/LJF9A5Z2mVFAYW2yVvDoazsEQhL9jxFfCkd2pUFMvb7WvcKM dljn29EOaI7naxfdZNKfdP+ngc1pGDYtKKFz/7c+Vil3Ifkyg9LXjNMH5EFl0S1a ab9py9+Zvzslmk+gHwOkoCATSYD3dUwg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ec040d51 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 7 Feb 2022 14:50:44 +0000 (UTC) Date: Mon, 7 Feb 2022 15:50:16 +0100 From: Julien Lepiller Message-ID: <20220207155016.1381bf8c@tachikoma.lepiller.eu> In-Reply-To: <87v8xr1iph.fsf@taiju.info> References: <87czk02dkt.fsf@taiju.info> <9329dd1b4adc0e060d06dcc7ab9e97c7d50ec427.camel@gmail.com> <87v8xr1iph.fsf@taiju.info> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Z7MZguIHSJcwVPvXpgPm03b" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644247304; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=pMI3B2JWE+5XfS+LxEMYv2jxNCFXsfG63CusY8nYNLg=; b=e7PY0Hb5YkGpqEjU5nzWxtMKY2P+9RwzjPCiH4Ylp7j5ByQaQ7V5S2dxrtKGnA6+HvFHzJ TInyrRmSrkUWqbdqCM6nAR4ndWdK7HRtUaqObYWilvQTJfDZX25Geq9Xz8ydI/Ywz1MNTH y3Muz8i4ijSB6T9PIaWNOgU/Q4kVkrCUC6AICAngATNCnAtI270pGIlFK3wE6zd6HnCBNF 8ZJCt7nfw+tFSRKpgDvMJnHy9+h13i9K+hMMe+zLCZhyyEIyooFJ+KBm8h34+9USubESL3 qGfJtKTeoMjtrk6D5Wzk3sv9kaIbngSMv2oMI90il+2vh4lIHizKw194gDpq8w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644247304; a=rsa-sha256; cv=none; b=Wr2d2pw08bmoTJyw6/Lgr9ovf6jNVtqVw1eAUENPGJXQJYqCvwORVxL0tEZXCn35eSPnwy c5+ttN8ElUPPbghPHEXSfKVlJMxX1EHy36thzPg9rnLrq+zVCpsHTYa2ZG3bnlN8IWnsTD x9HeJIuMeaMVZ56ieP9bsrxlIiglU0C22VXkdbsST0Os8IjbqY0rlz8nUj92ziQTN+z1hS hnaDFtCU8F2Sbxh73hZrHIwt/D8WDKICTSgSYrVz00H+dlVI/ztoSHXomk97L3hTShdW9n j0t+3uG38vbYBKBDDTb7IUVWNc9Rs2ZgKJhDZVzYYy4i4f8ThT3fmg+7u3q+UA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=CGV6ZaEN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=CGV6ZaEN; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: AD75313FF6 X-Spam-Score: -2.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: sSz0jVQoMHS9 --MP_/Z7MZguIHSJcwVPvXpgPm03b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Mon, 07 Feb 2022 12:03:38 +0900, Taiju HIGASHI a =C3=A9crit : > Hi Liliana, >=20 > Thank you for your response. >=20 > You are right. My attitude of expecting someone else to solve the > problem was no good. >=20 > So far, I haven't even been able to get the tests to run properly on > Guix. Therefore, I can't even properly mention which test is the > problem. >=20 > I think it will take a long time to solve this problem due to my lack > of skills. > In particular, I think I will have a hard time reading the intent of > the test code. Also, other distributions skip the tests, so I have no > source to refer to. >=20 > I don't know if I will be able to start working on it right away, but > I would like to take the time to tackle it properly. >=20 >=20 >=20 Hi! I gave a look at the test failures and found a few issues. I attached the current diff I have, but it's still not working. The first test checks that the current year is present is a data file that helps converting gregorian years to Japanese era (such as 2022 -> =E3=82=8C=E3=81=84=E3=82=8F=EF=BC=94). However, the file stops at 2021. I f= ixed that by setting a fixed year in the test, 2021. Adding 2022 to the data file would have fixed the issue for now, but in 2023 it would have failed again, and the time-machine wouldn't work either. That's a time bomb :) The next test is much more important, and much more difficult to make it work. First, it needs to open an xorg session, and it needs a bus session to start ibus. I do that by replacing the check phase with a call to start dbus and xfvb. Then, the test fails to find some data in the installation directory, so I moved the tests after the install phase. It's probably not a real issue, but it avoids a few warnings. One remains. The python script that runs the tests fails to use GDK, because the script that runs it redefines a few variables that are required in a guix environment, to find gi libraries. I changed the script to only augment these variables. Then, the python script tries to open a window on the graphical display and waits for focus before it starts the tests. Since there is no interaction possible, I changed the test code to ensure the window is focused when opened. When creating the window, I use GLib.idle_add to add an action to run when the main event loop is idle. After that, the main event loop is started (a call to Gtk.main()). As soon as it starts, the window is focused and the test starts. After the window gets focus, the python script starts ibus and ibus-anthy-test. It complains about not being able to read /var/lib/dbus/machine-id, but this seems benign. It also complained about not finding the "profile directory", and after investigation, I modified anthy itself to introduce GUIX_ANTHY_HOME, which I set before ibus-anthy tests. After two test lines, the tests hang, either because of an issue with ibus-anthy, or the setup of ibus, or because it's waiting for ibus' window to get focus. At this point, I don't know how to investigate further. --MP_/Z7MZguIHSJcwVPvXpgPm03b Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=ibus-anthy.diff diff --git a/gnu/packages/anthy.scm b/gnu/packages/anthy.scm index 0d86347e88..b662d48d2c 100644 --- a/gnu/packages/anthy.scm +++ b/gnu/packages/anthy.scm @@ -48,7 +48,17 @@ (define-public anthy (replace 'check (lambda _ (with-directory-excursion "test" - (invoke "./anthy" "--all"))))))) + (invoke "./anthy" "--all")))) + (add-after 'unpack 'support-guix-anthy-home + (lambda _ + ;; This is required to test ibus-anthy + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute* "src-diclib/conf.c" + (("add_val\\(\"HOME\", pw->pw_dir") + "char* home = getenv(\"GUIX_ANTHY_HOME\"); +if(home == NULL) + home = pw->pw_dir; +add_val(\"HOME\", home")))))))) (home-page "https://anthy.osdn.jp/") (synopsis "Japanese input method") (description "Anthy is a Japanese input method for converting diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm index edaeb59641..b8a17df4b5 100644 --- a/gnu/packages/ibus.scm +++ b/gnu/packages/ibus.scm @@ -52,10 +52,12 @@ (define-module (gnu packages ibus) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages iso-codes) + #:use-module (gnu packages linux) #:use-module (gnu packages logging) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages python-web) #:use-module (gnu packages serialization) @@ -307,7 +309,7 @@ (define-public libpinyin (define-public ibus-anthy (package (name "ibus-anthy") - (version "1.5.9") + (version "1.5.14") (source (origin (method url-fetch) (uri (string-append @@ -315,7 +317,7 @@ (define-public ibus-anthy version "/ibus-anthy-" version ".tar.gz")) (sha256 (base32 - "1y8sf837rmp662bv6zakny0xcm7c9c5qda7f9kq9riv9ywpcbw6x")))) + "16vd0k8wm13s38869jqs3dnwmjvywgn0snnpyi41m28binhlssf8")))) (build-system gnu-build-system) (arguments '(#:configure-flags @@ -323,6 +325,46 @@ (define-public ibus-anthy (list (string-append "--libexecdir=" %output "/libexec")) #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-date + (lambda _ + (substitute* "data/Makefile.in" + ;; The test would get the current year and check if its data + ;; contains it. However, this will fail in the future, as + ;; running this test in a later year would fail. + ;; XXX: Future versions will have more recent years, change this + ;; to the most recent year in data/era.t (last line). + (("S_YEAR=.*;") "S_YEAR=2021;")))) + (add-before 'check 'pre-check + (lambda _ + ;; Fix running ibus + (substitute* "tests/test-build.sh" + (("export GSETTINGS_SCHEMA_DIR=") + "export GSETTINGS_SCHEMA_DIR=$GSETTINGS_SCHEMA_DIR${GSETTINGS_SCHEMA_DIR:+:}") + (("export GI_TYPELIB_PATH=") + "export GI_TYPELIB_PATH=$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}")) + ;; Do not wait for focus, but wait for the window to be available + (substitute* "tests/anthytest.py" + (("window =") "self.window =") + (("window\\.") "self.window.") + (("window.show_all\\(\\)") + "window.show_all() + GLib.idle_add(self.bring_to_front) + + def bring_to_front(self): + self.window.present()")))) + (delete 'check) + (add-after 'install 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "HOME" (getcwd)) + (setenv "GUIX_ANTHY_HOME" (getcwd)) + (setenv "XDG_DATA_HOME" (getcwd)) + (setenv "XVFB_SERVER_ARGS" "+iglx -noreset") + (setenv "XDG_RUNTIME_DIR" (string-append (getcwd) "/runtime-dir")) + (mkdir-p (getenv "XDG_RUNTIME_DIR")) + (invoke "dbus-run-session" "--" + "xvfb-run" "-a" "-s" (getenv "XVFB_SERVER_ARGS") + "make" "check")))) (add-after 'install 'wrap-programs (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -337,12 +379,18 @@ (define-public ibus-anthy '("ibus-engine-anthy" "ibus-setup-anthy")) #t)))))) (native-inputs - `(("gettext" ,gettext-minimal) + `(("dbus" ,dbus) + ("gettext" ,gettext-minimal) + ("glib" ,glib "bin") ;for glib-compile-schemas, used by tests ("intltool" ,intltool) ("pkg-config" ,pkg-config) - ("python" ,python))) + ("procps" ,procps) + ("python-pycotap" ,python-pycotap) + ("python-wrapper" ,python-wrapper) + ("util-linux" ,util-linux) ;for getopt, used by tests + ("xvfb-run" ,xvfb-run))) (inputs - (list anthy gtk+ ibus gobject-introspection python-pygobject)) + (list anthy gdk-pixbuf gtk+ ibus gobject-introspection python-pygobject python-pycairo)) (synopsis "Anthy Japanese language input method for IBus") (description "IBus-Anthy is an engine for the input bus \"IBus\"). It adds the Anthy Japanese language input method to IBus. Because most graphical diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm index 05a378601f..3d3067a770 100644 --- a/gnu/packages/python-check.scm +++ b/gnu/packages/python-check.scm @@ -2004,3 +2004,21 @@ (define-public python-xunitparser Python objects. It tries to use the objects available in the standard @code{unittest} module.") (license license:expat))) + +(define-public python-pycotap + (package + (name "python-pycotap") + (version "1.2.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pycotap" version)) + (sha256 + (base32 "1v69fxial9i5wlap6wc4igq3hydvxbak7dlgb7cikk8wjgafqf7r")))) + (build-system python-build-system) + (home-page "https://el-tramo.be/pycotap") + (synopsis "Tiny test runner that outputs TAP results to standard output.") + (description + "This package provides a tiny test runner that outputs TAP results to standard +output.") + (license license:expat))) --MP_/Z7MZguIHSJcwVPvXpgPm03b--