Closed Apteryks closed 1 year ago
gentle ping ..
I cannot reproduce your issue.
Anthy.GContext.set_logger(0);
AttributeError: type object 'GContext' has no attribute 'set_logger'
If you check ibus-anthy/gir/Anthy-9000.gir
, you will notice GContext.set_logger is implemented.
- GI_TYPELIB_PATH=/gnu/store/cdf6vh704xcirxvirarwszxil2fj9axv-profile/lib/girepository-1.0:/home/maxim/.guix-profile/lib/girepository-1.0:./../gir
This value is storange.
If you check ibus-anthy/tests/test-build.sh
, it includes export GI_TYPELIB_PATH=$BUILDDIR/../gir
, i.e. GI_TYPELIB_PATH should have one path only but your result has several path separted by ':'.
Did you modify the script?
Re-attempting to enable the test suite now, I see:
phase `build' succeeded after 1.5 seconds
starting phase `check'
Making check in m4
make[1]: Entering directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/m4'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/m4'
Making check in po
make[1]: Entering directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/po'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/po'
Making check in data
make[1]: Entering directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/data'
S_YEAR=`date '+%Y'`; \
M_YEAR=`echo $S_YEAR | sed 'y/0123456789/0123456789/'`; \
grep -q $M_YEAR ./era.t; \
if test $? -ne 0 ; then \
echo "This year $M_YEAR is not included in era.y"; \
exit 1; \
fi;
This year 2023 is not included in era.y
make[1]: *** [Makefile:699: check] Error 1
make[1]: Leaving directory '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/data'
make: *** [Makefile:526: check-recursive] Error 1
Test suite failed, dumping logs.
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("check" "-j" "24") exit-status: 2 term-signal: #f stop-signal: #f>
phase `check' failed after 0.0 seconds
command "make" "check" "-j" "24" failed with status 2
After patching S_YEAR to use 2021 and adding util-linux, I now get:
#### Starting Python3 API test
+ env IBUS_ANTHY_ENGINE_PATH=./../engine/python3 IBUS_ANTHY_SETUP_PATH=./../setup/python3 python3 -u ./anthytest.py
Traceback (most recent call last):
File "/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14/tests/./anthytest.py", line 8, in <module>
gi_require_version('Gdk', '3.0')
File "/gnu/store/c6n7h131fdckr39yv1rc7z9fbm0yk177-python-pygobject-3.42.2/lib/python3.10/site-packages/gi/__init__.py", line 126, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gdk not available
+ test 1 -ne 0
+ exit -1
Guix is not a FHS distribution, looks things from the environment including GI_TYPELIB_PATH
, which probably explains my previous attempts to mess with it in test-build.sh:
modified tests/test-build.sh
@@ -119,8 +119,8 @@ run_ibus_daemon()
run_test_suite()
{
- export GSETTINGS_SCHEMA_DIR=$SCHEMA_TMPDIR;
- export GI_TYPELIB_PATH=$BUILDDIR/../gir;
+ export GSETTINGS_SCHEMA_DIR=$GSETTINGS_SCHEMA_DIR${GSETTINGS_SCHEMA_DIR:+:}$SCHEMA_TMPDIR;
+ export GI_TYPELIB_PATH=$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}$BUILDDIR/../gir;
LD_LIBRARY_PATH=$BUILDDIR/../gir/.libs;
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$BUILDDIR/../gir;
export GTK_IM_MODULE=ibus;
Something which appears in the build earlier is this:
nixbld 1 0 2 12:41 ? 00:00:00 guile --no-auto-compile -L /gnu/store/9n6j7cqh0fygzxwa6s04r0i4ic5s17fg-module-import -C /gnu/store/08dmis7kmcp7qg35pymmv0m9bjwlmmxd-module-import-compiled /gnu/store/vf6qkjzg5n648apj4zfmihlxmsk94wvx-ibus-anthy-1.5.14-builder
nixbld 5465 5464 0 12:41 ? 00:00:00 /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash -c fail=; \ if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if { if test -z '0'; then false; elif test -n 'x86_64-unknown-linux-gnu'; then true; elif test -n '4.3' && test -n '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14'; then true; else false; fi; }; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \?]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs?]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in *=*|--*) continue;; -*I) strip_trailopt 'I'; skip_next=yes;; -*I?*) strip_trailopt 'I';; -*O) strip_trailopt 'O'; skip_next=yes;; -*O?*) strip_trailopt 'O';; -*l) strip_trailopt 'l'; skip_next=yes;; -*l?*) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in *$target_option*) has_opt=yes; break;; esac; done; test $has_opt = yes); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo check-recursive | sed s/-recursive//`; \ case "check-recursive" in \ distclean-* | maintainer-clean-*) list='m4 po data gir engine icons setup tests ' ;; \ *) list='m4 po data gir engine icons setup tests ' ;; \ esac; \ for subdir in $list; do \ echo "Making $target in $subdir"; \ if test "$subdir" = "."; then \ dot_seen=yes; \ local_target="$target-am"; \ else \ local_target="$target"; \ fi; \ (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \ || eval $failcom; \ done; \ if test "$dot_seen" = "no"; then \ make "$target-am" || exit 1; \ fi; test -z "$fail"
nixbld 5509 5465 0 12:41 ? 00:00:00 /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash -c fail=; \ if (target_option=k; case ${target_option-} in ?) ;; *) echo "am__make_running_with_option: internal error: invalid" "target option '${target_option-}' specified" >&2; exit 1;; esac; has_opt=no; sane_makeflags=$MAKEFLAGS; if { if test -z '0'; then false; elif test -n 'x86_64-unknown-linux-gnu'; then true; elif test -n '4.3' && test -n '/tmp/guix-build-ibus-anthy-1.5.14.drv-0/ibus-anthy-1.5.14'; then true; else false; fi; }; then sane_makeflags=$MFLAGS; else case $MAKEFLAGS in *\\[\ \?]*) bs=\\; sane_makeflags=`printf '%s\n' "$MAKEFLAGS" | sed "s/$bs$bs[$bs $bs?]*//g"`;; esac; fi; skip_next=no; strip_trailopt () { flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`; }; for flg in $sane_makeflags; do test $skip_next = yes && { skip_next=no; continue; }; case $flg in *=*|--*) continue;; -*I) strip_trailopt 'I'; skip_next=yes;; -*I?*) strip_trailopt 'I';; -*O) strip_trailopt 'O'; skip_next=yes;; -*O?*) strip_trailopt 'O';; -*l) strip_trailopt 'l'; skip_next=yes;; -*l?*) strip_trailopt 'l';; -[dEDm]) skip_next=yes;; -[JT]) skip_next=yes;; esac; case $flg in *$target_option*) has_opt=yes; break;; esac; done; test $has_opt = yes); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo check-recursive | sed s/-recursive//`; \ case "check-recursive" in \ distclean-* | maintainer-clean-*) list='m4 po data gir engine icons setup tests ' ;; \ *) list='m4 po data gir engine icons setup tests ' ;; \ esac; \ for subdir in $list; do \ echo "Making $target in $subdir"; \ if test "$subdir" = "."; then \ dot_seen=yes; \ local_target="$target-am"; \ else \ local_target="$target"; \ fi; \ (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make $local_target) \ || eval $failcom; \ done; \ if test "$dot_seen" = "no"; then \ make "$target-am" || exit 1; \ fi; test -z "$fail"
I don't think it's related, but I wasn't able to make that error disappear even by regenerating the build system from scratch (autoreconf -vif
).
EDIT: Ah, nevermind, these are just echoed commands run, not actual errors.
OK, I was able to get to get the test environment happy with the following patches (also with: https://github.com/ibus/ibus-anthy/pull/35):
(add-after 'unpack 'fix-check
(lambda _
(substitute* "data/Makefile.in"
;; Use a year current at the time the release was made, to
;; avoid the "This year 2023 is not included in era.y"
;; error.
(("`date '\\+%Y'`")
"2021"))))
(add-after 'unpack 'do-not-override-GI_TYPELIB_PATH
;; Do not override the GI_TYPELIB_PATH to avoid the pygobject
;; error: "ValueError: Namespace Gdk not available".
(lambda _
(substitute* "tests/test-build.sh"
(("GI_TYPELIB_PATH=\\$BUILDDIR/../gir" all)
(string-append all ":$GI_TYPELIB_PATH")))))
(add-before 'check 'prepare-for-tests
(lambda _
;; IBus requires write access to the HOME directory.
(setenv "HOME" "/tmp")))
But it seems there's only one test and that it was skipped:
+ run_test_suite
+ export GSETTINGS_SCHEMA_DIR=/tmp/guix-build-ibus-anthy-1.5.14.drv-0/tmp.FCZqh5cFXp
+ GSETTINGS_SCHEMA_DIR=/tmp/guix-build-ibus-anthy-1.5.14.drv-0/tmp.FCZqh5cFXp
+ export GI_TYPELIB_PATH=./../gir:/gnu/store/2n2kprz35a19ibs5kbjsb3k4cdl69q2w-gtk+-3.24.37/lib/girepository-1.0:/gnu/store/8hg2jn404m2b9vng77n398wy3vh4d8yx-ibus-1.5.27/lib/girepository-1.0:/gnu/store/v0jyv9qjycr5lcc9m018g2g73gv7wv1g-gobject-introspection-1.72.0/lib/girepository-1.0:/gnu/store/rr1vbf04j27z5465wsm1kdfaw3iriz2k-pango-1.50.10/lib/girepository-1.0:/gnu/store/bb8ijpv1y3wpppfqd7r0pkk25xckag19-librsvg-2.54.5/lib/girepository-1.0:/gnu/store/ams35jy7lmxw5xas4b33zznwdx7m1d18-at-spi2-core-2.45.90/lib/girepository-1.0:/gnu/store/n7vynkl0rkqmvahxji6530n8hmfscxsd-harfbuzz-5.3.1/lib/girepository-1.0:/gnu/store/1ig678c8vqxvr60x8swmc5wriga7sjf3-gdk-pixbuf-2.42.8/lib/girepository-1.0
+ GI_TYPELIB_PATH=./../gir:/gnu/store/2n2kprz35a19ibs5kbjsb3k4cdl69q2w-gtk+-3.24.37/lib/girepository-1.0:/gnu/store/8hg2jn404m2b9vng77n398wy3vh4d8yx-ibus-1.5.27/lib/girepository-1.0:/gnu/store/v0jyv9qjycr5lcc9m018g2g73gv7wv1g-gobject-introspection-1.72.0/lib/girepository-1.0:/gnu/store/rr1vbf04j27z5465wsm1kdfaw3iriz2k-pango-1.50.10/lib/girepository-1.0:/gnu/store/bb8ijpv1y3wpppfqd7r0pkk25xckag19-librsvg-2.54.5/lib/girepository-1.0:/gnu/store/ams35jy7lmxw5xas4b33zznwdx7m1d18-at-spi2-core-2.45.90/lib/girepository-1.0:/gnu/store/n7vynkl0rkqmvahxji6530n8hmfscxsd-harfbuzz-5.3.1/lib/girepository-1.0:/gnu/store/1ig678c8vqxvr60x8swmc5wriga7sjf3-gdk-pixbuf-2.42.8/lib/girepository-1.0
+ LD_LIBRARY_PATH=./../gir/.libs
+ export LD_LIBRARY_PATH=./../gir/.libs:./../gir
+ LD_LIBRARY_PATH=./../gir/.libs:./../gir
+ export GTK_IM_MODULE=ibus
+ GTK_IM_MODULE=ibus
+ for i in 3
+ echo '#### Starting Python3 API test '
#### Starting Python3 API test
+ env IBUS_ANTHY_ENGINE_PATH=./../engine/python3 IBUS_ANTHY_SETUP_PATH=./../setup/python3 python3 -u ./anthytest.py
## Load pycotap
s
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK (skipped=1)
+ test 0 -ne 0
+ test x = x
+ rm -r /tmp/.anthy
rm: cannot remove '/tmp/.anthy': No such file or directory
+ rm -r /tmp/.config/anthy
rm: cannot remove '/tmp/.config/anthy': No such file or directory
+ finit
+ rm -rf /tmp/guix-build-ibus-anthy-1.5.14.drv-0/tmp.FCZqh5cFXp
+ ibus exit
OK, seems it wants a Xorg display to run. When I modify the prepare-for-tests
phase to become:
(add-before 'check 'prepare-for-tests
(lambda _
;; IBus requires write access to the HOME directory.
(setenv "HOME" "/tmp")
;; The single test is skipped if no actual display is found.
(system "Xvfb :1 -noreset +extension GLX +extension RANDR \
+extension RENDER -screen 0 1280x1024x24 &")
(setenv "DISPLAY" ":1")))
(i.e., manually start a virtual display in the container), the test suite appears to hang.
Any tip to get the test suite going?
Which distribution and version?: Guix System, current
Which desktop environment and version?: ratpoison WM
Which session type?: X11
Which application and version?: anthy itself
IBus version?: IBus 1.5.24
ibus-anthy version?: 1.5.14
Issue description:
Running the test suite fails with the output:
Steps to reproduce: