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

sssd 2.3.0 buld errors due to issue with sv translation of man page #5186

Closed
joakim-tjernlund opened this issue Jun 1, 2020 · 16 comments
Closed
Assignees
Labels
Closed: Fixed Issue was closed as fixed.

Comments

@joakim-tjernlund
Copy link
Contributor

FYI, I get some nonfatal buil errors:

Note: Writing sssd-files.5
Note: Writing sssd-ifp.5
Note: Writing sssctl.8
Note: Writing sssd-ipa.5
Note: Writing sssd-ad.5
Note: Writing sssd-kcm.8
Note: Writing sssd-krb5.5
Note: Writing sssd-ldap-attributes.5
Note: Writing sssd-session-recording.5
Note: Writing sssd-secrets.5
sv/sssd.conf.5.xml:993: parser error : Premature end of data in tag refsect2 line 987
            
            ^
sv/sssd.conf.5.xml:993: parser error : Premature end of data in tag refsect1 line 587
            
            ^
sv/sssd.conf.5.xml:993: parser error : Premature end of data in tag refentry line 6
            
            ^
sv/sssd.conf.5.xml:993: parser error : Premature end of data in tag reference line 4
            
            ^
make[3]: *** [Makefile:977: sv/sssd.conf.5] Error 1
make[3]: *** Waiting for unfinished jobs....
Note: Writing sssd-simple.5
Note: Writing sssd-ldap.5
Note: Writing sssd-sudo.5
Note: Writing sssd-systemtap.5
Note: Writing sssd_krb5_locator_plugin.8
Note: Writing sssd.8
@joakim-tjernlund
Copy link
Contributor Author

ping?

@alexey-tikhonov
Copy link
Member

I can confirm that src/man/sv/sssd.conf.5.xml generated on my system unexpectedly ends at line 993 as well.

So far I don't understand the reason: src/man/po/sv.po seems to be fine in this part...

@alexey-tikhonov
Copy link
Member

Updating po/sv.po: 
msgmerge -U po/sv.po po/sssd-docs.pot  --previous --backup=none
...................................................................................................... done.
po/sv.po: 640 translated messages, 57 untranslated messages.
...
write(.../sssd/x86_64/src/man/sv/sssd.conf.5.xml)... done.

640+57 is an expected amount of messages (matches some other po-files)

But after this step a lot of strings in updated po/sv.po are commented out (#~) and resulting sv/sssd.conf.5.xml is truncated.

I added -vvv and -d options to po4a but that didn't help much. So far no idea what's wrong.

@pbrezina
Copy link
Member

pbrezina commented Jul 2, 2020

Hmm. It works for me on Fedora 31. Is it possible there is some issue with xsltproc or po4a?

$ rpm -q libxslt po4a
libxslt-1.1.34-1.fc31.x86_64
po4a-0.57-1.fc31.noarch

@alexey-tikhonov
Copy link
Member

$ rpm -q libxslt po4a
libxslt-1.1.34-1.fc30.x86_64
po4a-0.54-3.fc30.noarch

@joakim-tjernlund
Copy link
Contributor Author

dev-libs/libxslt-1.1.33-r1
app-text/po4a-0.57

@joakim-tjernlund
Copy link
Contributor Author

Hmm. It works for me on Fedora 31. Is it possible there is some issue with xsltproc or po4a?

$ rpm -q libxslt po4a
libxslt-1.1.34-1.fc31.x86_64
po4a-0.57-1.fc31.noarch

Are sure you are building sv ?

@pbrezina
Copy link
Member

pbrezina commented Jul 2, 2020

Ah, it fails for me as well. I was building sv but I expected the build to fail, but the build succeeded. I can see different error though:

/usr/bin/xsltproc -o sv/sssd.8  --catalogs --xinclude --nonet --stringparam profile.condition "with_false;with_sudo;with_autofs;with_ssh;with_pac_responder;with_ifp;gpo_default_enforcing;no_enable_files_domain;with_kcm;with_openssl" http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl sv/sssd.8.xml
sv/sssd.conf.5.xml:998: parser error : EndTag: '</' not found
            
            ^
make[3]: *** [Makefile:977: sv/sssd.conf.5] Error 1

@alexey-tikhonov
Copy link
Member

Ah, it fails for me as well. I was building sv but I expected the build to fail, but the build succeeded. I can see different error though:

/usr/bin/xsltproc -o sv/sssd.8  --catalogs --xinclude --nonet --stringparam profile.condition "with_false;with_sudo;with_autofs;with_ssh;with_pac_responder;with_ifp;gpo_default_enforcing;no_enable_files_domain;with_kcm;with_openssl" http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl sv/sssd.8.xml
sv/sssd.conf.5.xml:998: parser error : EndTag: '</' not found
            
            ^
make[3]: *** [Makefile:977: sv/sssd.conf.5] Error 1

That's just a little bit different diagnostic message. But reason seems to be the same: generated xml is truncated...

@pbrezina
Copy link
Member

pbrezina commented Jul 2, 2020

Running po4a directly yields the same incorrect result so po4a seems to be the cause. However, --debug and --verbose shows that the whole file is processed and it does not produce any error.

$ po4a --debug --verbose --option doctype=docbook --package-name sssd --variable builddir=/dev/shm/sssd/src/man --package-version 2.3.0 --msgid-bugs-address sssd-devel@redhat.com --copyright-holder "Red Hat" $SSSD_SOURCE/src/man/po/po4a.cfg

...
po4a::xml::treat_tag: sssd.conf.5.xml:3963: type=6 </reference>
po4a::transtractor::process: Done parse()
po4a::transtractor::process: Call write(/dev/shm/sssd/src/man/sv/sssd.conf.5.xml)
po4a::transtractor::process: Done write(/dev/shm/sssd/src/man/sv/sssd.conf.5.xml)
po4a::transtractor::process: Chdir . (calldir)
/dev/shm/sssd/src/man/sv/sssd.conf.5.xml is 91.53% translated (714 of 780 strings).

@mquinson could you help us debug this issue? The generated file is truncated in the middle.

@mquinson
Copy link

mquinson commented Jul 2, 2020

My guess is that the sv translation is producing an invalid XML file. You should try to open the produced file, and look at sv/sssd.conf.5.xml:998. Even if you don't speak swedish, you can fix the XML formatting. Once you understand the XML formatting issue, you should do your fix in the sv.po file, not in the XML file that is rebuilt each time po4a is run.

I did a similar operation for the doc of po4a itself in chineese yesterday night. I had to do mquinson/po4a@e18c73a and mquinson/po4a@2ca8d39 I guess that your fixes will be very similar.

I agree that po4a should try to sanitize the translations provided by the translators so that the reassembled document is not faulty. Other format than XML do that in po4a, but I confess that I have absolutely no idea on how to do that for XML. How would you validate XML fragments?

If my guess is wrong, please tell me and I'll have a closer look.

@mquinson
Copy link

mquinson commented Jul 2, 2020

You have many weird translations in this file: https://github.com/SSSD/sssd/blob/master/src/man/po/sv.po#L1351 https://github.com/SSSD/sssd/blob/master/src/man/po/sv.po#L1373

but I don't see no obvious formating error in the PO file: https://github.com/SSSD/sssd/blob/master/src/man/po/sv.po#L1515 You really should look at the produced XML file in swedish

@pbrezina
Copy link
Member

pbrezina commented Jul 2, 2020

What is weird about those translations?

There's no information in the xml file either, it just ends in the middle:

992         <refsect2 id='PAM'>
993             <title>PAM-konfigurationsalternativ</title>
994             <para>
995                 Dessa alternativ kan användas för att konfigurera tjänsten Pluggable
996 Authentication Module (PAM).
997             </para>
998 

@pbrezina
Copy link
Member

pbrezina commented Jul 8, 2020

I opened issue against po4a: mquinson/po4a#254

pbrezina added a commit to pbrezina/sssd that referenced this issue Jul 13, 2020
This made sssd.conf translation truncated in the middle.

Resolves:
SSSD#5186
@pbrezina pbrezina self-assigned this Jul 13, 2020
@pbrezina
Copy link
Member

See fix in #5242. po4a got a new commit that will produce nice error message in this case.

@alexey-tikhonov alexey-tikhonov changed the title sssd 2.3.0 buld errors sssd 2.3.0 buld errors due to issue with sv translation of man page Jul 13, 2020
@pbrezina
Copy link
Member

Pushed PR: #5242

  • master

@pbrezina pbrezina added the Closed: Fixed Issue was closed as fixed. label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Fixed Issue was closed as fixed.
Projects
None yet
Development

No branches or pull requests

4 participants