reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
185 stars 52 forks source link

gloss-english.ldf (line 132) Use of \__prop_put_linked:wnnN doesn't match its definition. #626

Closed vipowueb closed 4 months ago

vipowueb commented 4 months ago

I just updated via the "TeX Live Utility" app to the version:

revision: 69093 sizes: src: 1049k, doc: 1037k, run: 1601k relocatable: No cat-version: 1.66

The minimal example

\documentclass{article}

\usepackage[protrusion=true]{microtype}
\usepackage{polyglossia}
\setmainlanguage[variant=british]{English}

\begin{document}
    Hello World!
\end{document}

generates a PDF containing the lines:

variantvariantukbritish Hello World!

My typesetter lists the following issues:

gloss-english.ldf (line 132) Use of __prop_put_linked:wnnN doesn't match its definition. (...as@values{english}{variant}{us}{american} ...)

gloss-english.ldf (line 132) LaTeX Error: Missing \begin{document}. (...as@values{english}{variant}{us}{american} ...)

and the log file

(/usr/local/texlive/2023/texmf-dist/tex/latex/polyglossia/gloss-latex.lde Package: gloss-latex 2023/12/11 v1.66 polyglossia: module for default language ) Package polyglossia Info: Default language is latex. ) (/usr/local/texlive/2023/texmf-dist/tex/latex/polyglossia/gloss-english.ldf File: gloss-english.ldf polyglossia: module for English Package polyglossia Info: Option: English, variant=american.

/usr/local/texlive/2023/texmf-dist/tex/latex/polyglossia/gloss-english.ldf:132: Use of __prop_put_linked:wnnN doesn't match its definition.

...alias@keyvals@english@american l.132 ...as@values{english}{variant}{us}{american} If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. /usr/local/texlive/2023/texmf-dist/tex/latex/polyglossia/gloss-english.ldf:132: LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.132 ...as@values{english}{variant}{us}{american} You're in trouble here. Try typing to proceed. If that doesn't work, type X to quit. ) Package polyglossia Info: Option: english variant=british. Package polyglossia Info: Option: english variant=british. Package polyglossia Info: Default language is english. Package polyglossia Info: Option: english variant=british.

Within a bigger document, the same line as above is generated, followed by a blank page and the actual content thereafter.

Thanks in advance.

LPR121 commented 4 months ago

I face the same issue since I updated TexLive yesterday from 2022 to 2023.

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[variant=german,spelling=new,babelshorthands=true]{german}

\begin{document}
    Test
\end{document}

Results in: [{ "resource": "/c:/texlive/2023/texmf-dist/tex/latex/polyglossia/gloss-german.ldf", "owner": "LaTeX", "severity": 8, "message": "Use of \__prop_put_linked:wnnN doesn't match its definition.\n \xpg@alias@keyvals@german@1996 \n", "source": "LaTeX", "startLineNumber": 165, "startColumn": 1, "endLineNumber": 165, "endColumn": 65536 }]

From gloss-german.ldf where the error links to:

% Register default options
\xpg@initialize@gloss@options{german}{variant=german,spelling=new,script=latin,babelshorthands=false}
% Register alias options
\xpg@set@alias@values{german}{spelling}{new}{1996}
\xpg@set@alias@values{german}{spelling}{old}{1901}
\xpg@set@alias@values{german}{script}{blackletter}{fraktur}
jspitz commented 4 months ago

Thanks, this is fixed for the next version.

jspitz commented 4 months ago

Workaround:

\documentclass{article}

\usepackage{polyglossia}

% work around a bug in polyglossia
\makeatletter
\ExplSyntaxOn
\pretocmd\xpg@set@alias@values{%
    \prop_if_exist:cF { xpg@alias@keyvals@#1@#4 }
    { \prop_new:c {xpg@alias@keyvals@#1@#4} }
}{}{}
\ExplSyntaxOff
\makeatother
% end of workaround

\setmainlanguage[variant=british]{english}

\begin{document}
    Hello World!
\end{document}
vipowueb commented 4 months ago

Works, thanks!

LPR121 commented 4 months ago

Thanks!

jspitz commented 4 months ago

Please keep open until the fix is released.

jspitz commented 4 months ago

The reason is a latex3 kernel change that seemed to have affected several packages who didn't check whether a property list is defined before attempting to write to it. See https://github.com/latex3/latex3/issues/1458

I suppose we need to make a soonish release as this hits users hard.

davidcarlisle commented 4 months ago

@jspitz sorry about the lack of notice. The check that prop variables are declared was always intended to be there (and all expl3 variables are documented as needing to be declared with \New.. ) but the check was missed in the code, a refactorisation caused the check to get enabled, but as we hadn't noticed the check was previously missing we didn't search contributed packages for affected use. If you could release before the texlive 2024 code freeze (2nd March) that would be really helpful, if you can't we could look at pushing out a first-aid, but if you could update that would be best

jspitz commented 4 months ago

@davidcarlisle no problem, after all, it was our own oversight. I am about to release now. The only concern I have is that we are in the midst of a major code rewrite and I would have loved to have that settled a bit more. But all checks pass, so I am rather confident.

reutenauer commented 4 months ago

On Sat, Feb 17, 2024 at 01:39:33AM -0800, David Carlisle wrote:

@jspitz sorry about the lack of notice. The check that prop variables are declared was always intended to be there (and all expl3 variables are documented as needing to be declared with \New.. ) but the check was missed in the code, a refactorisation caused the check to get enabled, but as we hadn't noticed the check was previously missing we didn't search contributed packages for affected use. If you could release before the texlive 2024 code freeze (2nd March) that would be really helpful, if you can't we could look at pushing out a first-aid, but if you could update that would be best

To be precise, 2 March is the code freeze for binary builds, CTAN updates continue until 10 March. But of course, the sooner, the better :-)

jspitz commented 4 months ago

Version 2.0 (sic!) has been uploaded to CTAN now. This might give us the opportunity to iron out remaining glitches or regressions of the code rewrite before the TL freeze.

reutenauer commented 4 months ago

On Sat, Feb 17, 2024 at 02:11:58AM -0800, Jürgen Spitzmüller wrote:

Version 2.0 (sic!) has been uploaded to CTAN now. This might give us the opportunity to iron out remaining glitches or regressions of the code rewrite before the TL freeze.

Great! Congratulations and well done :-)

Udi-Fogiel commented 3 days ago

@davidcarlisle would testing against latex-dev catch such problems in advance?

davidcarlisle commented 3 days ago

@Udi-Fogiel well it can't hurt: we encourage package developers to test against latex-dev as much as they can to avoid surprises all round. Of course we can't catch everything, in particuar I'm not sure if this would have been caught by the previous dev release (and don't want to try to build such a system to check) As I commented above this change wasn't exactly planned (as the documented behavior didn't change, just the old code didn't have the checks documented) so it's always possible that some problems only arise when everything is really put together for a release from the main branch, but in general testing latex-dev should give some months or weeks advance warning of any planned changes.