cplusplus/draft

Latest texlive packages under Ubuntu 24.10 (Oracular Oriole) fail to compile std.tex

Closed this issue · 6 comments

The latest texlive packages, version 2024.20240401, under Ubuntu 24.10 (Oracular Oriole) fail to compile std.tex. In particular, running the following sequence of commands stops with an error:

git clone https://github.com/cplusplus/draft.git
cd draft/source
make

Running that sequence under texlive 2024.20240401 gives:

... [output trimmed -- see attached log file]
) (./styles.tex) (./macros.tex
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty)
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty)
(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty)) (./tables.tex)
Started index file generalindex
Started index file grammarindex
Started index file headerindex
Started index file libraryindex
Started index file conceptindex
Started index file impldefindex
Writing glossary file xrefindex.glo 
Writing glossary file xrefdelta.glo 
(./std.aux)
isodate: babel.sty has been loaded
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)

! LaTeX Error: Loading a class or package in a group.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.95 \begin{document}
                     
?

At this point, entering H and pressing Enter gives:

Classes and packages should only be loaded at the top level

I have not debugged this problem further at this time, although I will try to do so. A quick Internet search suggests that, with the newer version of texlive, \RequirePackage or \usepackage, or in this case \begin{document}, inside a \begingroup is what causes this error (see, for example, the first response to this question on StackExchange).

Attached is the std.log file after typing X to exit.

By the way, I filed this bug as sooner or later your CI environment will also move to a version of TeXLive that will enforce the same restrictions!

The following patch hacks around the hard error for now:

--- latex.ltx-orig      2024-12-12 23:09:51.401480650 +0100
+++ latex.ltx   2024-12-14 22:40:42.590609752 +0100
@@ -16926,9 +16926,8 @@
   #2}
 \def\@fileswithoptions#1{%
     \ifnum\currentgrouplevel>\z@
-     \@latex@error
-      {Loading a class or package in a group}%
-      {Classes and packages should only be loaded at the top level}%
+     \@latex@warning
+      {Loading jmaurer-XA1 a class or package in a group}%
   \fi
   \@ifnextchar[%]
     {\@fileswith@ptions#1}%

Then, recreate the .fmt files using "fmtutil -sys --all". Double-check the .fmt files have been updated with "find /var/lib/texmf/web2c -name "*.fmt" -ls"

Could this be related to the "uninished group" error we've been getting for ages? I think that one had to do with the indexer or something like that.

Yeah, it's loading the extract package that's breaking this.

Maybe we can replace the entire extract system with the new hooks system (https://texdoc.org/serve/lthooks-doc.pdf/0).

Fixed by 561a43b.