bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in texi2dvi, on Windows/Msys2 it cannot find tex


From: Tomas Kalibera
Subject: Re: bug in texi2dvi, on Windows/Msys2 it cannot find tex
Date: Fri, 8 Apr 2022 15:15:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0


On 4/8/22 14:56, Gavin Smith wrote:
On Wed, Apr 06, 2022 at 05:24:01PM +0300, Eli Zaretskii wrote:
Date: Wed, 6 Apr 2022 14:39:30 +0200
From: Tomas Kalibera <tomas.kalibera@gmail.com>

texi2dvi on Msys2 doesn't find tex, because it incorrectly detects ";"
as path separator (it is ":").

The problem is in the following code. With Msys2, OSTYPE is "msys", but
MSYSTEM is upper-case "MSYS" and uname needs it that way:

# In the case of Msys, uname returns a value derived from MSYSTEM, as
# MSYSTEM is user configurable, it is not so safe to use it to detect
# Msys. It is safer to use OSTYPE, this is why we set MSYSTEM to
# $OSTYPE before calling uname
if test -n "$COMSPEC$ComSpec" \
     && MSYSTEM=$OSTYPE uname | $EGREP -iv 'cygwin|msys' >/dev/null; then
    path_sep=";"
else
    path_sep=":"
fi

I've reported this with more detail for Msys2
(https://github.com/msys2/MSYS2-packages/issues/2901) but perhaps it is
worth fixing upstream as the code was meant to support MSYS.
MSYS is already supported; it is MSYS2 that deviated from the original
MSYS behavior, and now support for MSYS2 needs to be _added_.

IOW, whatever is done here to ensure support for MSYS2, please do NOT
remove the current test, which does work with the original MSYS.
Please tweak the test so that it accepts both flavors.

What happens if we don't set MSYSTEM at all?

diff --git a/util/texi2dvi b/util/texi2dvi
index 1f42b41907..c506bbad37 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -85,7 +85,7 @@ IFS="$space$tab$newline"
  # Msys. It is safer to use OSTYPE, this is why we set MSYSTEM to
  # $OSTYPE before calling uname
  if test -n "$COMSPEC$ComSpec" \
-   && MSYSTEM=$OSTYPE uname | $EGREP -iv 'cygwin|msys' >/dev/null; then
+   && uname | $EGREP -iv 'cygwin|msys' >/dev/null; then
    path_sep=";"
  else
    path_sep=":"

It works with Msys2 and cygwin for me, but breaks with MSYSTEM, where

$ uname
MINGW32_NT-6.2

$ MSYSTEM=$OSTYPE uname
msys_NT-6.2

$ uname -a
MINGW32_NT-6.2 DESKTOP-G858KME 1.0.19(0.48/3/2) 2016-07-13 17:45 i686 Msys

Tomas


This was added on 2015-09-23 in what is now git commit 02cc28bb352be.

Link to discussion at that time:

https://lists.gnu.org/archive/html/bug-texinfo/2015-09/msg00078.html

I didn't see an explanation there to state that setting MSYSTEM was
actually necessary, just the comment that it is "safer", which it transpires
it is not.

I don't actually understand what the thinking was behind setting MSYSTEM
in the first place or what problem this was meant to solve.

Methinks if MSYSTEM needs to be set correctly for uname to have the correct
output, then the user will already have this set in their environment.
Otherwise it is a broken system that we don't need to worry about supporting.
Am I wrong?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]