Skip to content

Commit

Permalink
fix rollback errors generated from \NewSocket or \NewSocketPlug; spli…
Browse files Browse the repository at this point in the history
…t one release tests into two as it deliberately generated an error (#1648)
  • Loading branch information
FrankMittelbach authored Jan 31, 2025
1 parent 3175d45 commit c93624f
Show file tree
Hide file tree
Showing 14 changed files with 3,430 additions and 99 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-01-31 Frank Mittelbach <[email protected]>

* latexrelease.dtx (subsection{Ignoring \texttt{\string_new} errors when rolling back}):
Silence \cs{NewSocket} and \cs{NewSocketPlug} in rollback

2025-01-29 Frank Mittelbach <[email protected]>

* ltoutput.dtx (subsubsection{Float control}):
Expand Down
15 changes: 14 additions & 1 deletion base/latexrelease.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
%<*latexrelease>
% \fi
% \ProvidesFile{latexrelease.dtx}
[2024/08/11 v1.0p LaTeX release emulation and tests
[2025/01/31 v1.0q LaTeX release emulation and tests
(including releases up to \latexreleaseversion)]
% \iffalse
%</latexrelease>
Expand Down Expand Up @@ -754,6 +754,14 @@ of this package available from CTAN}
\msg_redirect_name:nnn { mark } { class-already-defined }{ none }
% \end{macrocode}
%
% The same is also needed for \cs{NewSocket} and \cs{NewSocketPlug}.
% \changes{v1.0q}{2025/01/31}
% {Silence \cs{NewSocket} and \cs{NewSocketPlug} in rollback}
% \begin{macrocode}
\msg_redirect_name:nnn { socket } { already-declared } { none }
\msg_redirect_name:nnn { socket } { plug-already-declared } { none }
% \end{macrocode}
%
% Now a one-off for |ltcmd.dtx|: we need to make \cs{NewDocumentCommand}
% not complain on an already existing command, but it has to be done
% after \cs{NewDocumentCommand} is defined, so this is separate from
Expand Down Expand Up @@ -806,9 +814,14 @@ of this package available from CTAN}
% And restore the silenced error messages.
% \changes{v1.0p}{2022/11/14}
% {Unsilence \cs{NewMarkClass} error message after rollback (gh/955)}
% \changes{v1.0q}{2025/01/31}
% {Unsilence \cs{NewSocket} and \cs{NewSocketPlug} error message
% after rollback}
% \begin{macrocode}
\msg_redirect_name:nnn { hooks } { exists } { }
\msg_redirect_name:nnn { mark } { class-already-defined } { }
\msg_redirect_name:nnn { socket } { already-declared } { }
\msg_redirect_name:nnn { socket } { plug-already-declared } { }
% \end{macrocode}
%
% \begin{macrocode}
Expand Down
988 changes: 988 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-004.luatex.tlg

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-004.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%
% Rolling back to a previous release without hitting errors
% There should be one test for every earlier main release
%
\input{test2e}

\START

\RequirePackage[2022/06/01]{latexrelease}

\typeout{Test if errors are correctly restored:}

\NewHook {begindocument}
\NewMarkClass {2e-right}

\OMIT
\documentclass{article}
\TIMO
\begin{document}
\end{document}

1,412 changes: 1,412 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-004.tlg

Large diffs are not rendered by default.

983 changes: 983 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-004.xetex.tlg

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions base/testfiles/tlb-latexrelease-rollback-2022-06-01.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -955,21 +955,6 @@ Already applied: [....-..-..] Preload glyphtounicode on input line ....
Applying: [....-..-..] UTF-8 default on input line ....
Already applied: [....-..-..] UTF-8 default on input line ....
)
test if errors are restored:
! LaTeX hooks Error: Hook 'begindocument' has already been declared.
For immediate help type H <return>.
...
l. ...\NewHook {begindocument}
There already exists a hook declaration with this name.
Please use a different name for your hook.
! LaTeX mark Error: Mark class '2e-right' already defined
For immediate help type H <return>.
...
l. ...\NewMarkClass {2e-right}
This is a coding error.
LaTeX was asked to define a new mark class called '2e-right': this mark class already exists.
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
(tlb-latexrelease-rollback-....-..-...aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line ....
LaTeX Font Info: ... okay on input line ....
Expand Down
5 changes: 0 additions & 5 deletions base/testfiles/tlb-latexrelease-rollback-2022-06-01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

\RequirePackage[2022/06/01]{latexrelease}

\typeout{test if errors are restored:}

\NewHook {begindocument}
\NewMarkClass {2e-right}

\OMIT
\documentclass{article}
\TIMO
Expand Down
15 changes: 0 additions & 15 deletions base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -1379,21 +1379,6 @@ Now handling font encoding U ...
)
Already applied: [....-..-..] UTF-8 default on input line ....
)
test if errors are restored:
! LaTeX hooks Error: Hook 'begindocument' has already been declared.
For immediate help type H <return>.
...
l. ...\NewHook {begindocument}
There already exists a hook declaration with this name.
Please use a different name for your hook.
! LaTeX mark Error: Mark class '2e-right' already defined
For immediate help type H <return>.
...
l. ...\NewMarkClass {2e-right}
This is a coding error.
LaTeX was asked to define a new mark class called '2e-right': this mark class already exists.
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
(tlb-latexrelease-rollback-....-..-...aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line ....
LaTeX Font Info: ... okay on input line ....
Expand Down
15 changes: 0 additions & 15 deletions base/testfiles/tlb-latexrelease-rollback-2022-06-01.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -950,21 +950,6 @@ Already applied: [....-..-..] Preload glyphtounicode on input line ....
Applying: [....-..-..] UTF-8 default on input line ....
Already applied: [....-..-..] UTF-8 default on input line ....
)
test if errors are restored:
! LaTeX hooks Error: Hook 'begindocument' has already been declared.
For immediate help type H <return>.
...
l. ...\NewHook {begindocument}
There already exists a hook declaration with this name.
Please use a different name for your hook.
! LaTeX mark Error: Mark class '2e-right' already defined
For immediate help type H <return>.
...
l. ...\NewMarkClass {2e-right}
This is a coding error.
LaTeX was asked to define a new mark class called '2e-right': this mark class already exists.
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
LaTeX Font Info: Trying to load font information for TU+lmr on input line ....
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line ....
LaTeX Font Info: ... okay on input line ....
Expand Down
16 changes: 0 additions & 16 deletions base/testfiles/tlb-latexrelease-rollback-2024-11-01.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -527,22 +527,6 @@ Already applied: [....-..-..] Add starred reference commands on input line ....
Applying: [....-..-..] store five label arguments on input line ....
Applying: [....-..-..] Add starred version on input line ....
Applying: [....-..-..] set theHcounter representation on input line ....
! LaTeX socket Error: Socket 'refstepcounter' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter}{1}
A socket can only be declared once. The name 'refstepcounter' is already taken. Use \ShowSocket {refstepcounter} to see its definition.
! LaTeX socket Error: Socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter/target}{1}
A socket can only be declared once. The name 'refstepcounter/target' is already taken. Use \ShowSocket {refstepcounter/target} to see its definition.
! LaTeX socket Error: Plug 'kernel' for socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ......urrentHref {#1.\csname theH#1\endcsname}}
%
You can't change an existing plug with \NewSocketPlug and it is normally not sensible to do so. Use the L3 programming layer function \socket_set_plug:nnn if you really have to.
Already applied: [....-..-..] set theHcounter representation on input line ....
Already applied: [....-..-..] Add starred version on input line ....
Already applied: [....-..-..] store five label arguments on input line ....
Expand Down
16 changes: 0 additions & 16 deletions base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -516,22 +516,6 @@ Already applied: [....-..-..] Add starred reference commands on input line ....
Applying: [....-..-..] store five label arguments on input line ....
Applying: [....-..-..] Add starred version on input line ....
Applying: [....-..-..] set theHcounter representation on input line ....
! LaTeX socket Error: Socket 'refstepcounter' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter}{1}
A socket can only be declared once. The name 'refstepcounter' is already taken. Use \ShowSocket {refstepcounter} to see its definition.
! LaTeX socket Error: Socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter/target}{1}
A socket can only be declared once. The name 'refstepcounter/target' is already taken. Use \ShowSocket {refstepcounter/target} to see its definition.
! LaTeX socket Error: Plug 'kernel' for socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ......rentHref {#1.\csname theH#1\endcsname}}
%
You can't change an existing plug with \NewSocketPlug and it is normally not sensible to do so. Use the L3 programming layer function \socket_set_plug:nnn if you really have to.
Already applied: [....-..-..] set theHcounter representation on input line ....
Already applied: [....-..-..] Add starred version on input line ....
Already applied: [....-..-..] store five label arguments on input line ....
Expand Down
16 changes: 0 additions & 16 deletions base/testfiles/tlb-latexrelease-rollback-2024-11-01.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -516,22 +516,6 @@ Already applied: [....-..-..] Add starred reference commands on input line ....
Applying: [....-..-..] store five label arguments on input line ....
Applying: [....-..-..] Add starred version on input line ....
Applying: [....-..-..] set theHcounter representation on input line ....
! LaTeX socket Error: Socket 'refstepcounter' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter}{1}
A socket can only be declared once. The name 'refstepcounter' is already taken. Use \ShowSocket {refstepcounter} to see its definition.
! LaTeX socket Error: Socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ...\NewSocket{refstepcounter/target}{1}
A socket can only be declared once. The name 'refstepcounter/target' is already taken. Use \ShowSocket {refstepcounter/target} to see its definition.
! LaTeX socket Error: Plug 'kernel' for socket 'refstepcounter/target' already declared!
For immediate help type H <return>.
...
l. ......rentHref {#1.\csname theH#1\endcsname}}
%
You can't change an existing plug with \NewSocketPlug and it is normally not sensible to do so. Use the L3 programming layer function \socket_set_plug:nnn if you really have to.
Already applied: [....-..-..] set theHcounter representation on input line ....
Already applied: [....-..-..] Add starred version on input line ....
Already applied: [....-..-..] store five label arguments on input line ....
Expand Down
7 changes: 7 additions & 0 deletions base/update-rollback-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ l3build save -epdftex,xetex,luatex \
tlb-latexrelease-rollback-2023-11-01 \
tlb-latexrelease-rollback-2024-06-01 \
tlb-latexrelease-rollback-2024-11-01 \
tlb-latexrelease-rollback-2025-05-01 \
tlb-latexrelease-rollback-003-often \
tlb-rollback-004-often \
tlb-rollback-005 \
Expand All @@ -20,5 +21,11 @@ l3build save -c config-lthooks \
lthooks-rollback-args


echo ""
echo "*************************************************"
echo "* Unexpected errors in release rollbacks if any:"
echo "*************************************************"
grep '^!' testfiles/tlb-latexrelease-rollback-2*tlg # tests with rollback-0... can contain errors

exit

0 comments on commit c93624f

Please sign in to comment.