On Thu, Apr 17, 2025 at 08:08:18PM +0000, Vincent Belaïche wrote:
> Hello,
> 
> Lately I tried to compile some document on MsW10 with texi2pdf, and  it 
> failed both on an MSYS2 MINGW64 console and on a WSL2 console.
> 
> With MSYS2 the reason was that $OSTYPE is cygwin, and not msys when the 
> console is MINGW64 and not MSYS.
> 
> With WSL2 the reason is that to call a non-WSL executable, the .exe extension 
> shall not be omitted.
> 
> Ok, the attached patch proposes a fix. WSL2 will still fail absolute paths. 
> But it is still better with this patch than w/o it.

It's not clear which parts of your patch fix which problem.  I would guess
that the part for the MSYS2 console is the following:

 if test -n "$COMSPEC$ComSpec" \
    && uname | $EGREP -iv 'cygwin|msys' >/dev/null \
-   && test "$OSTYPE" != msys ; then
+   && test "$OSTYPE" != msys \
+   && test "$OSTYPE" != cygwin ; then
   path_sep=";"
 else
   path_sep=":"
 fi

That seems like a harmless patch to apply, as it mean that cygwin and
msys were treated the same.

Am I correct in saying for this MSYS2 console, OSTYPE is "cygwin", but
the output of "uname" does not contain the string "cygwin"?  Does the
output of "uname" contain anything else that we could check for in addition
to "cygwin" and "msys"?

In regards to the WSL2 problem:-  I am much less happy with the rest of the
patch as the use of the ${exe_ext} suffix is more pervasive (needing
changes anywhere that 'findprog' is called), complicating the code for
the sake of a rare use case on a proprietary operating system.  I would
like a simpler, more limited way of allowing this to work.  Perhaps
we could change the 'findprog' function somehow (maybe 'findprog' itself
could set a shell variable to the invocation name of the program).

You also duplicate the error message "You don't have a working TeX binary..."
in the code.

Perhaps there are ways to allow your use case for WSL2 that don't
entail changing WSL2.  For example, I found webpages that discussed
making symlinks to the Windows *.exe files, named without the .exe
extension.

Do you think it is a good idea for texi2dvi, running on WSL2, to
run the .exe files without the user having done anything to allow this,
such as creating symlinks?  (I am not knowledgeable about WSL2 and have
never used it.)  You say that there are problems with absolute file
names but is it ok otherwise?

I understand that a user might not want to install a TeX distribution
on WSL2 so it could be useful to be able to easily use the native Windows
.exe programs.

I found that a version of the 'findprog' function was also
present in Texinfo in install-info/tests/defs.in so I guess that one
could be changed too, if we decide to change it.



> 
> Happy Easter,
>    Vincent/



Reply via email to