New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.5.0: test suite is failing #76
Comments
This testsuite passed: https://github.com/legionus/kbd/runs/6709846783?check_suite_focus=true#step%3A7%3A155= This testcase is architecture specific. On what architecture are you running your tests? |
x86/64 |
Here is a log:
Hm. For some reason, test did not find the |
@kloczek Is there a possibility that something in the rpm spec-file removed or moved it? |
Yeah, I hit the same thing on Gentoo just now, and it looks like both Fedora (and us in Gentoo) are renaming some of them. Fedora's spec file:
And in our ebuild in Gentoo:
|
My own spec file initially based on Fedora one. VCS: https://github.com/legionus/kbd/
Source0: %{VCS}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-latsun-fonts.tar.bz2
Source2: %{name}-latarcyrheb-32.tar.bz2
Source3: %{name}-xml2lst.pl
Source4: %{name}-vlock.pamd
Source5: %{name}info.1
Source6: %{name}-cz-map.patch
Patch00: %{name}-keycodes-man.patch
Patch01: %{name}-sparc.patch
Patch02: %{name}-unicode_start.patch
Patch03: %{name}-dumpkeys-man.patch
Patch04: %{name}-sg-decimal-separator.patch
Patch05: %{name}-loadkeys-search-path.patch
Patch06: %{name}-unicode-start-font.patch
Patch07: %{name}-remove_using_compiler_warning_flags.patch
Patch08: %{name}-POTFILES.in.patch
Patch09: %{VCS}/commit/3cd7aa69.patch#/%{name}-Added-braces-to-IT-keyboard-map.patch
Patch10: %{VCS}/commit/1be18aa6.patch#/%{name}-src-libkeymap-better-error-message-on-unsupported-un.patch
Patch11: %{VCS}/commit/df07510a.patch#/%{name}-setfont-propagate-error-exit-code.patch
Patch12: %{VCS}/commit/f0af5384.patch#/%{name}-libkeymap-check-get_sym-return-value.patch
Patch13: %{VCS}/commit/ef2893f5.patch#/%{name}-libkbdfile-fix-memory-leak.patch
Patch14: %{VCS}/commit/8da81cc6.patch#/%{name}-libkbdfile-make-sure-there-is-space-for-terminating-.patch
Patch15: %{VCS}/commit/28afe8b8.patch#/%{name}-libkeymap-fix-memory-leak.patch
Patch16: %{VCS}/commit/42bd43c7.patch#/%{name}-libkfont-fix-memory-leak.patch
Patch17: %{VCS}/commit/24256f90.patch#/%{name}-data-keymaps-i386-neo-use-Delete-instead-of-Backspac.patch
Patch18: %{name}-fa.map-drop-high-codepoint-character-that-chokes-loa.patch
[..]
%prep
%setup -q -a1 -a2
%autopatch -p1
%__cp -fp %{S:3} xml2lst.pl
%__cp -fp %{S:6} .
cd data/keymaps/i386
%__cp qwerty/pt-latin9.map qwerty/pt.map
%__cp qwerty/sv-latin1.map qwerty/se-latin1.map
%__mv azerty/fr.map azerty/fr-old.map
%__cp azerty/fr-latin9.map azerty/fr.map
%__cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias
%__mv fgGIod/trf.map fgGIod/trf-fgGIod.map
%__mv olpc/es.map olpc/es-olpc.map
%__mv olpc/pt.map olpc/pt-olpc.map
%__mv qwerty/cz.map qwerty/cz-qwerty.map
cd -
%build
autoreconf -fiv
%configure \
%{nil}
%make_build -C po update-po
%make_build
%install
%make_install
%__install %{S:4} -Dm644 %{buildroot}/etc/pam.d/vlock
%__install %{S:5} %{buildroot}/%{_mandir}/man1/kbdinfo.1
%__ln_s sr-cy.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/sr-latin.map.gz
%__ln_s us.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/ko.map.gz
%__ln_s fa.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/ara.map.gz
# Some microoptimization
%__sed -i 's,\<kbd_mode\>,%{_bindir}/kbd_mode,g;s,\<setfont\>,%{_bindir}/setfont,g' \
%{buildroot}%{_bindir}/unicode_start
%__mkdir_p %{buildroot}%{_datadir}/keymaps/legacy
%__mv %{buildroot}%{_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} %{buildroot}%{_datadir}/keymaps/legacy
# Convert X keyboard layouts to console keymaps
%__mkdir_p %{buildroot}%{_datadir}/keymaps/xkb
%__perl xml2lst.pl < %{_datadir}/X11/xkb/rules/base.xml > layouts-variants.lst
while read line; do
XKBLAYOUT=`echo "$line" | cut -d " " -f 1`
echo "$XKBLAYOUT" >> layouts-list.lst
XKBVARIANT=`echo "$line" | cut -d " " -f 2`
ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > %{buildroot}%{_datadir}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
done < layouts-variants.lst
# Convert X keyboard layouts (plain, no variant)
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do
ckbcomp "$line" | gzip > %{buildroot}%{_datadir}/keymaps/xkb/"$line".map.gz
done < layouts-list-uniq.lst
# wipe converted layouts which cannot input ASCII (#1031848)
zgrep -L "U+0041" %{buildroot}%{_datadir}/keymaps/xkb/* | xargs %__rm -fv
%__gzip -d %{buildroot}%{_datadir}/keymaps/xkb/cz.map.gz
%__patch %{buildroot}%{_datadir}/keymaps/xkb/cz.map < %{S:6}
%__gzip %{buildroot}%{_datadir}/keymaps/xkb/cz.map
%find_lang %{name}
%check
%make_build check The best situation would be to be able completely skip almost everything to have only something like %prep
%autosetup -p1
%build
autoreconf -fiv
%configure \
%{nil}
%make_build -C po update-po
%make_build
%install
%make_install Fedora has as well some patches which I'm using as well. It would be good to have situation in which none of those patches or additional steps on source tree preparation, build and install will be necessary. |
Ups I've copied my kbd.spec for 2.4. VCS: https://github.com/legionus/kbd/
Source0: %{VCS}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-latsun-fonts.tar.bz2
Source2: %{name}-latarcyrheb-32.tar.bz2
Source3: %{name}-xml2lst.pl
Source4: %{name}-vlock.pamd
Source5: %{name}info.1
Source6: %{name}-cz-map.patch
Patch: %{name}-keycodes-man.patch
Patch: %{name}-sparc.patch
Patch: %{name}-unicode_start.patch
Patch: %{name}-sg-decimal-separator.patch
Patch: %{name}-loadkeys-search-path.patch
Patch: %{name}-unicode-start-font.patch
Patch: %{name}-remove_using_compiler_warning_flags.patch
Patch: %{name}-POTFILES.in.patch
[..]
%prep
%setup -q -a1 -a2
%autopatch -p1
%__cp -fp %{S:3} xml2lst.pl
%__cp -fp %{S:6} .
cd data/keymaps/i386
%__cp qwerty/pt-latin9.map qwerty/pt.map
%__cp qwerty/sv-latin1.map qwerty/se-latin1.map
%__mv azerty/fr.map azerty/fr-old.map
%__cp azerty/fr-latin9.map azerty/fr.map
%__cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias
%__mv fgGIod/trf.map fgGIod/trf-fgGIod.map
%__mv olpc/es.map olpc/es-olpc.map
%__mv olpc/pt.map olpc/pt-olpc.map
%__mv qwerty/cz.map qwerty/cz-qwerty.map
cd -
%build
autoreconf -fiv
%configure \
%{nil}
%make_build -C po update-po
%make_build
%install
%make_install
%__install %{S:4} -Dm644 %{buildroot}/etc/pam.d/vlock
%__install %{S:5} %{buildroot}/%{_mandir}/man1/kbdinfo.1
%__ln_s sr-cy.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/sr-latin.map.gz
%__ln_s us.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/ko.map.gz
%__ln_s fa.map.gz %{buildroot}%{_datadir}/keymaps/i386/qwerty/ara.map.gz
# Some microoptimization
%__sed -i 's,\<kbd_mode\>,%{_bindir}/kbd_mode,g;s,\<setfont\>,%{_bindir}/setfont,g' \
%{buildroot}%{_bindir}/unicode_start
%__mkdir_p %{buildroot}%{_datadir}/keymaps/legacy
%__mv %{buildroot}%{_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} %{buildroot}%{_datadir}/keymaps/legacy
# Convert X keyboard layouts to console keymaps
%__mkdir_p %{buildroot}%{_datadir}/keymaps/xkb
%__perl xml2lst.pl < %{_datadir}/X11/xkb/rules/base.xml > layouts-variants.lst
while read line; do
XKBLAYOUT=`echo "$line" | cut -d " " -f 1`
echo "$XKBLAYOUT" >> layouts-list.lst
XKBVARIANT=`echo "$line" | cut -d " " -f 2`
ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > %{buildroot}%{_datadir}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
done < layouts-variants.lst
# Convert X keyboard layouts (plain, no variant)
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do
ckbcomp "$line" | gzip > %{buildroot}%{_datadir}/keymaps/xkb/"$line".map.gz
done < layouts-list-uniq.lst
# wipe converted layouts which cannot input ASCII (#1031848)
zgrep -L "U+0041" %{buildroot}%{_datadir}/keymaps/xkb/* | xargs %__rm -fv
%__gzip -d %{buildroot}%{_datadir}/keymaps/xkb/cz.map.gz
%__patch %{buildroot}%{_datadir}/keymaps/xkb/cz.map < %{S:6}
%__gzip %{buildroot}%{_datadir}/keymaps/xkb/cz.map
%find_lang %{name}
%check
%{!?with_check:exit 0}
%make_build check |
So my understanding is that line %__mv qwerty/cz.map qwerty/cz-qwerty.map can be skipped. Am I right? |
Just tested and after remove that one line from my %prep test suite is OK now. |
FWIW I've just moved them before/after tests as a cheesy hack (so in %check for you). But I'd welcome advice too! Also, thanks @kloczek for always filing these test failure bugs. Often I go to do it and you've beaten me! 💯 |
Since you are all renaming keymaps inplace, I think it's best for me not to use data/keymaps in tests. I will copy what I use in the tests. Coming back to the spec file question, it's very strange that you rename keymaps to %prep and %install to %buildroot. My advice to you is to move all renames to %install. All renames will be in one place and will not change the source tree. |
Question is a bit deeper.
That is what we inherited from older version of packaging procedures. %prep
%%autosetup -p1
%build
autoreconf -fiv
%configure \
%{nil}
%make_build -C po update-po
%make_build
%install
%make_install
%find_lang %{name}
%check
%make_build check We (you and all packagers) don't need to move to that state in single step so please take your time to review:
IMO more topics will be discussed now related to packaging procedure than maintenance of the kbd will be easier and less costly (man/hour) in future). I'm really not able to answer on some questions which are bouncing in my head so I would prefer to listen some people opinions with better expertise on kbd area 😝 |
BTW what is still possible to review https://github.com/OpenMandrivaAssociation/kbd |
So here is my first patch which I would like to see review. It is --- a/po/POTFILES.in~ 2020-12-15 14:32:21.000000000 +0000
+++ b/po/POTFILES.in 2021-01-16 04:02:40.015662396 +0000
@@ -18,7 +18,7 @@
src/libcommon/version.c
src/libkbdfile/init.c
src/libkbdfile/kbdfile.c
-src/libkeymap/analyze.c
+src/libkeymap/analyze.l
src/libkeymap/array.c
src/libkeymap/common.c
src/libkeymap/diacr.c
@@ -29,7 +29,7 @@
src/libkeymap/ksyms.c
src/libkeymap/loadkeys.c
src/libkeymap/modifiers.c
-src/libkeymap/parser.c
+src/libkeymap/parser.y
src/libkeymap/summary.c
src/libkfont/context.c
src/libkfont/kdfontop.c It solves precessing by gettext files just after only execute configure. |
Another though .. as currently IIRC Linux console in any currently used language should use unicode key mapping I have suspicion that most (if not all) latin mappings files can be dropped in kbd source tree. |
I don't think it makes sense other than backwards compatibility. See below.
To be honest, I don’t know why the maintainers do these renames. I am not the original author of kbd. Created by Andries E. Brouwer. He also wrote the part in the linux kernel that is responsible for keymaps. After he gave me the project and when I started to understand the utilities, I realized that almost everyone does not understand how to use loadkeys correctly. Let me explain. Many maintainers rename keymaps because there are duplicate names in keymaps:
If you execute the
This is done so that the user can do But according to the idea of the original author, loadkeys takes not just a file name, but a subpath. So the user can always specify When I refactored the code I wrote few tests to not break this behavior. https://github.com/legionus/kbd/blob/master/tests/libkbdfile/libkbdfile-test11.c
There are no renames in the distribution where I maintain a kbd rpm package. I only have dances around backwards compatibility.
As far as I know they add some additional fonts. Periodically, redhat's maintainer updates the same(?) font in kbd. That's all I know about it.
This issue deserves a separate discussion. I had an idea to rename all keymaps and bring them all to On the other hand, I've started work on adding support for xkb keymaps to loadkeys[1][2]. Not a replacement, but an addition. This could be a step towards unifying keymaps. We have hand made keymaps and we have xkb generated ones with less creative freedom. Unfortunately, there are problems here too. The xkbcommon does not provide an API to iterate over the compose table. I talked to the developers of xkbcommon about extending the API and they agreed to do it[3]. But work somehow stalled. But in any case, this functionality is in my plans for kbd-2.6.0. [1] https://lore.altlinux.org/kbd/20220214124918.r7vjp7epspvw35jd@example.org/T/#u
pam configuration differs from distribution to distribution. It would be better to consult Dmitry Levin (@ldv-alt) here.
Are you talking about https://src.fedoraproject.org/rpms/kbd/blob/rawhide/f/kbd.spec#_19 or are we talking about some other distribution? If we are talking about fedora, then this patch is superimposed on the result of converting xkb keymaps. These are not keymaps from kbd: https://src.fedoraproject.org/rpms/kbd/blob/rawhide/f/kbd.spec#_167
We can of course continue discussing these issues here on github, but consider subscribing to the mailing list. |
Yes. Please. |
github offers "discussion" tab. |
OK. Let's do it here. Discussions enabled. |
I'm an oldfag. I do not consider github as a convenient forum for discussions. But I understand that many will not agree with this. I've never tried github discussions and if they aren't much better than the issues, I'll turn them back off. |
Done #77 Just added kbd discussions to my watch list 😋 IMO it wold be good to open another dummy topic like "What do you want to see in next kbd version X.X.X?"
Thank you 😃 |
@kloczek FYI I know that the guys from suse, redhat, altlinux, frugalware and gentoo are subscribed to the mailing list :) |
Just stested new 2.5.0 and looks like test suite is failing in one unit.
Content of the tests/testsuite.log in attachment
testsuite.log.txt
The text was updated successfully, but these errors were encountered: