latex3 / latex3

The expl3 (LaTeX3) Development Repository

Home Page:https://latex-project.org/latex3.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Win10(20H2) with TeXLive 2021 can't identify the system platform.

syvshc opened this issue · comments

Here is my code

\documentclass{article}
\begin{document}
\ExplSyntaxOn
\c_sys_platform_str\par
\sys_if_platform_windows:TF
  { True }
  { False }
\ExplSyntaxOff
\end{document}

and it will give output below

unknown
False

it looks as if the current directory is not in the search path in texlive2021 when a format is created and so \file_if_exist:nTF { nul: } fails, it works for me again if I use \file_if_exist:nTF { ./nul: }.

OS: Windows 10 20H2
TeX distribution: TeX Live 2021
MWE:

% !TeX program = pdfLaTeX

\ExplSyntaxOn

\str_show:N \c_sys_platform_str

\cs_undefine:N \c_sys_platform_str

%% The rest of the code is copied directly from expl3-code.tex
\sys_if_engine_luatex:TF
  {
    \str_const:Nx \c_sys_platform_str
      { \tex_directlua:D { tex.print(os.type) } }
  }
  {
    \file_if_exist:nTF { nul: }
      {
        \file_if_exist:nF { /dev/null }
          { \str_const:Nn \c_sys_platform_str { windows } }
      }
      {
        \file_if_exist:nT { /dev/null }
          { \str_const:Nn \c_sys_platform_str { unix } }
      }
  }
\cs_if_exist:NF \c_sys_platform_str
  { \str_const:Nn \c_sys_platform_str { unknown }  }

\str_show:N \c_sys_platform_str

\ExplSyntaxOff

\stop

Log:

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex 2021.4.4)  4 APR 2021 12:48
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**z.tex
(./z.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
> \c_sys_platform_str=unknown.
<recently read> }
                 
l.5 \str_show:N \c_sys_platform_str
                                   
? 
> \c_sys_platform_str=windows.
<recently read> }
                 
l.29 \str_show:N \c_sys_platform_str
                                    
? 
 ) 

It seems that there is something wrong when a format is build by TeX Live. But if we dump the format manually, say

pdftex -etex -ini pdflatex.ini

We can get the expected result:

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/W32TeX) (preloaded format=pdflatex 2021.4.4)  4 APR 2021 12:49
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**z.tex
(./z.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
> \c_sys_platform_str=windows.
<recently read> }
                 
l.5 \str_show:N \c_sys_platform_str
                                   
? 
> \c_sys_platform_str=windows.
<recently read> }
                 
l.29 \str_show:N \c_sys_platform_str
                                    
? 
 ) 

This issue will be raised again if the format if rebuild by fmtutil which is one of the infrastructure programs of TeX Live. Additionally, it only appears in TL 2021, TL 2020 is fine.

OS: Windows 10 20H2
TeX distribution: TeX Live 2011

TeX Live 2021

We can just change the test subtly: I think this is TeX Live specific as I'm fine with MiKTeX. No issues on Linux or the Mac - perhaps we should check with the TL team before a change?

As said on the ML, fmtutil hasn't changed at all since 2020, so the culprit isn't there I am quite sure.

Anything else that has changed on Windows?

That was a bug in Windows binaries. Windows binaries were updated in the TeX Live repository by fixing the bug.
I hope that the new binaries will be distributed in a few days.

With today's update works OK [Win10(20H2) TeX Live 2021]

With today's update works OK [Win10(20H2) TeX Live 2021]

Right, after updating all things works well :)

With today's update works OK [Win10(20H2) TeX Live 2021]

I still have a question... Which package's error leads to this problem? Here a friend updated packages via tlmgr update -self -all, but he still met this problem. I want to know which package you changed to solve this problem and it's easy for him to find if the problem was occurred by the old version of this "package"?

English is not my native tongue, so there may be some grammar errors above. :->

@syvshc The error was in the binaries. So changing a package won't help. Your friend needs the newest windows binaries.

English is not my native tongue, so there may be some grammar errors above. :->

Don't care about this. Writing perfect english is not a requirement to participate, if it were I wouldn't be here either.

@syvshc The error was in the binaries. So changing a package won't help. Your friend needs the newest windows binaries.

Well, how should I help him find the reason why this problem happened? He has updated all packages through tlmgr, but the problem still exists.
1b424579d422ff4b.jpg

He should add \showoutput to your example, compile and show the complete log of the compilation, then I can compare with mine.

maybe change the mirror for updating (or wait a day)? There have been 2 critical infra updates yesterday and this morning on the mirror I currently use and maybe that tuna...edu one is just lagging behind. I have seen that quite often in the past that one or the other mirror is one day behind.

@syvshc tell your friend to show the output of

tlmgr info pdftex.win32

this should show something like

package:     pdftex.win32
category:    TLCore
shortdesc:   win32 files of pdftex
installed:   Yes
revision:    58783
sizes:       
relocatable: No

Thanks for all of you! My friend chose reinstall texlive at last. We didn't find out why the problem happened. Maybe because the interruption during tlmgr update? Anyway thank you! :-)