blefloch / latex-morewrites

Always room for a new write
6 stars 0 forks source link

[`2024/01/05` Regression] [xelatex] Writing customised content using `filecontents` is broken by `morewrites` #21

Open whisperity opened 5 months ago

whisperity commented 5 months ago

Hello!

Due to upgrading my TeXLive environment, I identified a regression caused by recent changes to morewrites.

Suddenly today, with no changes to my project, the builds started failing in the CI that uses ghcr.io/xu-cheng/texlive-full:20240201 (digest sha256:4c0f26c911625ba2eaef95a2350b1b0b5aef7cb434e0426786ad3d2fc6de6a71), and was not present in ghcr.io/xu-cheng/texlive-full:20240101 (digest sha256:0696f5112cd0dcccd692d3768f09e9419711990b65e56ed8b60b0a92339586b2).

The issue only appears with the xelatex compiler. pdflatex and lualatex are unaffected.

I was able to locally reproduce the issue. This version shows the error:

\ProvidesExplPackage
  {morewrites} {2024/01/05} {} {Always room for a new write}

while this older version I'm having locally on my machine does not:

\ProvidesExplPackage
  {morewrites} {2018/12/29} {} {Always room for a new write}

The issue came up by using customised fields in the bibliography, for which a custom data-model must be produced. The example at http://tex.stackexchange.com/questions/302968/biblatex-add-a-second-url-where-content-is-archived/303178#303178 no longer works once morewrites is updated.

MWE

\documentclass{article}

\usepackage{morewrites}
  \morewritessetup{verbose}

\begin{filecontents}[noheader,nosearch]{with-archivedat.dbx}
  Hello?
\end{filecontents}

\begin{document}

Hello!

\end{document}
$ xelatex test.tex
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
(/home/whisperity/opt/texlive/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/home/whisperity/opt/texlive/texlive/texmf-dist/tex/latex/base/size10.clo))
(/home/whisperity/opt/texlive/texlive/texmf-dist/tex/latex/morewrites/morewrite
s.sty
(/home/whisperity/opt/texlive/texlive/texmf-dist/tex/latex/morewrites/primargs.
sty))
morewrites: \immediate \write 0

LaTeX Info: Writing file `././with-archivedat.dbx'.

morewrites: \immediate \openout 15 = {"./with-archivedat.dbx"}
! I can't write on file `'"./with-archivedat.dbx"''.
<argument> ..._to_str:n {"./with-archivedat.dbx"}}

l.6 ...ts}[noheader,nosearch]{with-archivedat.dbx}

Irrespective of what filename is being used, an x.tex file is always produced:

$ cat ./x.tex
  Hello?

Proof of regression

Using an older TeXLive snapshot:

\documentclass{article}

\usepackage{morewrites}
  % \morewritessetup{verbose}  % Does not exist in 2018/12/29 version!

\begin{filecontents}[noheader,nosearch]{with-archivedat.dbx}
  Hello?
\end{filecontents}

\begin{document}

Hello!

\end{document}
$ xelatex test.tex
This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>

(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/base/size10.clo)
)
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/morewrites/morew
rites.sty
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/l3kernel/expl3.s
ty
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/l3backend/l3back
end-xetex.def))
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/morewrites/prima
rgs.sty))

LaTeX Info: Writing file `././with-archivedat.dbx'.

(./test.aux)
(/home/whisperity/opt/texlive.bak/texlive/texmf-dist/tex/latex/base/ts1cmr.fd)
[1] (./test.mw) (./test.aux) )
Output written on test.pdf (1 page).
Transcript written on test.log.
$ cat with-archivedat.dbx
  Hello?