Undesirable nul file with tlmgr.bat under Windows

Reinhard Kotucha reinhard.kotucha at web.de
Fri Jul 19 20:24:57 CEST 2019

On 2019-07-18 at 22:19:15 -0400, Ken Brown wrote:

 > On 7/18/2019 9:34 PM, Norbert Preining wrote:
 > > Hi Torsten,
 > >
 > > thanks for your debugging, this is all strange.
 > >
 > >> DEBUG cmd = wget http://mirror.ctan.org --timeout=30 -O nul 2>&1
 > >
 > >>      my $cmd = "$wget $mirror --timeout=$NetworkTimeout -O "
 > >> !              . (win32() ? "nul" : "/dev/null")
 > >> !              . " 2>&1 >" . (win32() ? "nul" : "/dev/null");
 > >
 > > So you *DO* get win32() == true ... in contrast to what you send me.
 > >
 > > It seems that
 > > - if the program is started via tlmgr.bat, perl detects is a Windows.
 > > - the redirection in the .bat file to nul works
 > > - the -O nul does NOT work because wget thinks different
 > >
 > > So this is really messed up situation, and now I somehow agree
 > > with Reinhard that mixing .bat Windows files with cygwin seems
 > > not an optimal solution.
 > >
 > > What puzzles me is that with the abov change one should *still*
 > > get the nul file from the -O, so maybe my theory is still not
 > > correct.
 > >
 > >> DEBUG cmd = wget http://mirror.ctan.org --timeout=30 -O nul 2>&1 >nul
 > >> than it seems to work. At least for this test case. Here is the diff
 > >
 > > Very very strange ...
 > >
 > > Any cygwin knowledgable participants here?
 > I've been casually following this discussion, as the maintainer of
 > TeX Live on Cygwin, and I too agree with Reinhard.  Using Cygwin
 > tools to install Win32 TeX Live is asking for trouble.

Installation is not a problem.  TeX Live allows installation for more
than one platform already.  The post-install steps are done on the
current platform and the binaries for other platforms are just
extracted from the archives.  The only thing you can't do is to
install Unix binaries on Windows because Windows doesn't support Unix

But it's possible nowadays to install Cygwin binaries under Windows
because Cygwin symlinks are regular files.  What worked for me is to
install TeX Live on a Linux system at home with additional binaries
for Windows and Cygwin, create a .tar.xz file of the whole tree on a
USB stick, and extract the archive under Cygwin.  After setting PATH
on Cygwin and Windows everything works as expected.

As far as I understand, Torsten has a Windows installation and uses
Cygwin for convenient maintenance.  What IMO can't work reliably is
that his Cygwin PATH contains the bin/win32 binaries.  Even if this
worked in the past, if Cygwin binaries are linked against the cygwin
DLLs and Windows binaries are linked against against MSVCRT.DLL, there
*must* be differences in behavior.

tlmgr is a Perl script and works the same way on all platforms.  At
least until external programs are called.  If tlmgr calls an external
program under Cygwin with bin/win32 in PATH, this program assumes that
you're under Windows, not Cygwin.  Same problem with Perl modules.
There are binary modules which are linked against .so files on Cygwin
and .dll files on Windows.

Norbert, you already spent a lot of time in order to find out how to
fix tlmgr.  I don't think that tlmgr is the culprit.

If this works for Torsten

  * tlmgr platform add cygwin

  * prepend /cygdrive/c/TeX/bin/cygwin to the Cygwin PATH

everything is fine.  It's at least the only *correct* solution and I
don't see any reason to support anything else.  I also don't expect
that my x86_64-linux binaries work on my Rapberry Pi.

And there is no need to install anything from scratch.  Only the
binaries for Cygwin have to be added to the existing installation.

Torsten, does what I suggest work for you?


Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de

More information about the tex-live mailing list