Skip to content
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

dnf5-5.1.11 FTBFS in openSUSE due to msgmerge failure #1158

Closed
Conan-Kudo opened this issue Jan 11, 2024 · 10 comments · Fixed by #1162 or rpm-software-management/dnf5-l10n#2
Closed

dnf5-5.1.11 FTBFS in openSUSE due to msgmerge failure #1158

Conan-Kudo opened this issue Jan 11, 2024 · 10 comments · Fixed by #1162 or rpm-software-management/dnf5-l10n#2
Assignees
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@Conan-Kudo
Copy link
Member

I tried to build dnf5-5.1.11, but it fails due to a msgmerge failure:

[   24s] [  1%] Generating sv.gmo
[   24s] cd /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build/libdnf5-cli/po && /usr/bin/msgmerge --quiet --update --backup=none -s /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build/libdnf5-cli/po/sv.po /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/libdnf5-cli/po/libdnf5-cli.pot
[   24s] /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build/libdnf5-cli/po/sv.po: warning: Charset "CHARSET" is not a portable encoding name.
[   24s]                                                                              Message conversion to user's charset might not work.
[   24s] /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build/libdnf5-cli/po/sv.po:124: duplicate message definition...
[   24s] /home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build/libdnf5-cli/po/sv.po:3: ...this is the location of the first definition
[   24s] /usr/bin/msgmerge: found 1 fatal error
[   24s] make[2]: *** [libdnf5-cli/po/CMakeFiles/translations_2.dir/build.make:84: libdnf5-cli/po/sv.gmo] Error 1
[   24s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/dnf5-5.1.11/build'
[   24s] make[1]: *** [CMakeFiles/Makefile2:1608: libdnf5-cli/po/CMakeFiles/translations_2.dir/all] Error 2
@Conan-Kudo
Copy link
Member Author

@ppisar
Copy link
Contributor

ppisar commented Jan 12, 2024

I confirm that libdnf5-cli/po/sv.po file is invalid since:

commit 22be22bdf2296446db4ee59a5146f3188136d17d
Author: GitHub Workflow <github-actions@github.com>
Date:   Thu Jan 11 13:02:52 2024 +0000

    Update translations from weblate

The broken file contains duplicate messages at the end.

@ppisar ppisar added Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Jan 12, 2024
@ppisar
Copy link
Contributor

ppisar commented Jan 12, 2024

This broken file is copied from https://github.com/rpm-software-management/dnf5-l10n repository and there the libdnf5-cli/sv.po file was broken with:

commit c035e03cb554497a16a79906a8427e03811984be
Author: Rafael Fontenelle <rafaelff@gnome.org>
Date:   Thu Jan 11 11:54:12 2024 +0100

    Added translation using Weblate (Swedish)

Commits into dnf5-l10n repository are performed by https://translate.fedoraproject.org/projects/dnf5/libdnf5-cli/sv/ web service. It seems that the service can produce files invalid from GNU gettext msgmerge point of view and we blindly accept all files.

@ppisar
Copy link
Contributor

ppisar commented Jan 12, 2024

Something somewhere should run msgfmt --check -o /dev/null libdnf5-cli/sv.po to catch there errors.

@Conan-Kudo
Copy link
Member Author

Probably should be done for all locales so we don't hit this elsewhere.

@ppisar
Copy link
Contributor

ppisar commented Jan 12, 2024

I uploaded a new file to the web service without any effect. Then I tried pushing to dnf5-cli repository, but I don't have the permissions.

@m-blaha, you are admin on Weblate. Can you fix it? We need this fix rpm-software-management/dnf5-l10n#1.

@m-blaha
Copy link
Member

m-blaha commented Jan 12, 2024

I think the problem is here:

SilentCommandExitError::SilentCommandExitError(int exit_code) : Error(M_("")), exit_code(exit_code) {}

This adds an empty string to the translation template, which probably conflicts with empty string automatically added by xgettext.

@ppisar
Copy link
Contributor

ppisar commented Jan 12, 2024

Indeed.

@ppisar ppisar self-assigned this Jan 12, 2024
@ppisar ppisar added this to DNF team Jan 12, 2024
@ppisar ppisar moved this from Backlog to In Progress in DNF team Jan 12, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DNF team Jan 12, 2024
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
An empty string has a special meaning in gettext and marking such
string produces invalid catalogs with a duplicate message ID entry.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
An empty string has a special meaning in gettext and marking such
string produces invalid catalogs with a duplicate message ID entry.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
The duplicates breaks msgmerge on the broken catalogs in CI.
This patch fixes them.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
An empty string has a special meaning in gettext and marking such
string produces invalid catalogs with a duplicate message ID entry.

We cannot use simply Error("") necause Error() expects
BgettextMessage argument. Therefore I added EMPTY_MESSAGE macro which
expands to the same as M_(""), but is not caught by xgettext. I think
is cleaner solution then overriding xgettext behaviour for that line
of code.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
The duplicates breaks msgmerge on the broken catalogs in CI.
This patch fixes them.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
An empty string has a special meaning in gettext and marking such
string produces invalid catalogs with a duplicate message ID entry.

We cannot use simply Error("") necause Error() expects
BgettextMessage argument. Therefore I added EMPTY_MESSAGE macro which
expands to the same as M_(""), but is not caught by xgettext.

I think it's cleaner solution than overriding xgettext behaviour for
that line of code. For aesthetic reasons I also disabled clang-format
at two places.

Fixes: rpm-software-management#1158
ppisar added a commit to ppisar/dnf5 that referenced this issue Jan 12, 2024
The duplicates breaks msgmerge on the broken catalogs in CI.
This patch fixes them.

Fixes: rpm-software-management#1158
github-merge-queue bot pushed a commit that referenced this issue Jan 12, 2024
An empty string has a special meaning in gettext and marking such
string produces invalid catalogs with a duplicate message ID entry.

We cannot use simply Error("") necause Error() expects
BgettextMessage argument. Therefore I added EMPTY_MESSAGE macro which
expands to the same as M_(""), but is not caught by xgettext.

I think it's cleaner solution than overriding xgettext behaviour for
that line of code. For aesthetic reasons I also disabled clang-format
at two places.

Fixes: #1158
github-merge-queue bot pushed a commit that referenced this issue Jan 12, 2024
The duplicates breaks msgmerge on the broken catalogs in CI.
This patch fixes them.

Fixes: #1158
@github-project-automation github-project-automation bot moved this from In Progress to Done in DNF team Jan 12, 2024
@inknos
Copy link
Collaborator

inknos commented Jan 12, 2024

@Conan-Kudo, since you are building dnf5 in SUSE, would you like to have a new tarball or are you ok with patching downstream? I am patching dnf5 downstream, but I am also ok to rebase to a new release

@Conan-Kudo
Copy link
Member Author

@inknos I would prefer a new release please.

kontura added a commit to kontura/dnf5 that referenced this issue Dec 6, 2024
The old `ubuntu-22.04` uses version `swig4.0` which fails on C++11 attributes.
We have started to use them in: rpm-software-management#1793
and the readthedocs build has been failing since then.

Use `24.04` (https://about.readthedocs.com/blog/2024/06/ubuntu-24-04/)
because it uses `swig_4.2.0` which atleast ignores the attributes.

According to the changelog the attributes should be ingnored since
version 4.1.0: https://www.swig.org/Release/CHANGES
```
2022-07-07: jmarrec
	    rpm-software-management#1158 #2286 Add basic support for C++11 attributes.  These are now
	    crudely ignored by SWIG's parser's tokeniser, which is better than
	    failing with a parse error.
```
kontura added a commit to kontura/dnf5 that referenced this issue Dec 6, 2024
The old `ubuntu-22.04` uses version `swig4.0` which fails on C++11 attributes.
We have started to use them in: rpm-software-management#1793
and the readthedocs build has been failing since then.

Use `24.04` (https://about.readthedocs.com/blog/2024/06/ubuntu-24-04/)
because it uses `swig_4.2.0` which at least ignores the attributes.

According to the changelog the attributes should be ignored since
version 4.1.0: https://www.swig.org/Release/CHANGES
```
2022-07-07: jmarrec
	    rpm-software-management#1158 #2286 Add basic support for C++11 attributes.  These are now
	    crudely ignored by SWIG's parser's tokeniser, which is better than
	    failing with a parse error.
```
github-merge-queue bot pushed a commit that referenced this issue Dec 19, 2024
The old `ubuntu-22.04` uses version `swig4.0` which fails on C++11 attributes.
We have started to use them in: #1793
and the readthedocs build has been failing since then.

Use `24.04` (https://about.readthedocs.com/blog/2024/06/ubuntu-24-04/)
because it uses `swig_4.2.0` which at least ignores the attributes.

According to the changelog the attributes should be ignored since
version 4.1.0: https://www.swig.org/Release/CHANGES
```
2022-07-07: jmarrec
	    #1158 #2286 Add basic support for C++11 attributes.  These are now
	    crudely ignored by SWIG's parser's tokeniser, which is better than
	    failing with a parse error.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: HIGH Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Archived in project
4 participants