I just upgraded to MacTeX 2021 and now nothing that uses my custom LaTeX class complies any more. The cause appears to be that when you load a file and there are two possibilities with the same name, it now prefers the "local" one instead of the one in the "central" texmf, whereas in the past it has always been the reverse.
A minimal example is create two files, one in a subdirectory:
test.tex prob/article.cls
where test.tex is
\documentclass{prob/article}
\begin{document}
Some text
\end{document}
and prob/article.cls is:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{prob/article}
\LoadClass{article}
Then pdflatex test.tex works fine with TeXLive 2020 and earlier but not TeXLive 2021, where I get:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18> (./prob/article.cls
Document Class: prob/article WTF edition
) (/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./test.aux)
! LaTeX Error: The font size command \normalsize is not defined:
there is probably something wrong with the class file.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.2 \begin{document}
In retrospect, having files with same names as ones in the standard library was asking for trouble, but is this new behavior intensional and is there any way to turn it off? The with either version of TeXLive, kpsewhich -all article.cls gives the same output (in particular, the files come in the same order).
article.cls” inside yourprob/article.clsby using something like this, but you really shouldn't: use a different name – Phelype Oleinik Apr 28 '21 at 17:28\@nameundef{ver@article.cls}before the LoadClass. Should I post this as the answer, or would you prefer too? (With regards to the better solution of just using a different name, I'd prefer not to edit the documentclass line of a few hundred of my ownTeX files.) – Nathan Dunfield Apr 28 '21 at 18:05sed, for example, to make things automatically), but I added a way to work around that with a visible don't-do-this note for future readers – Phelype Oleinik Apr 28 '21 at 18:27