bug-texinfo
[Top][All Lists]
Advanced

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

[bug #46007] texi2dvi Msys support


From: Vincent Belaïche
Subject: [bug #46007] texi2dvi Msys support
Date: Wed, 23 Sep 2015 22:55:27 +0200

Dear Eli,

I have changed the email subject from ``Re: [bug #43122] texi2dvi does
not compile enough times to get toc'' to ``[bug #46007] texi2dvi Msys
support'', as that is what it is about.

This is the feedback to your first reply on this matter. My answers
inserted below...

Sorry that I have taken so long to reply, but since it was not clear at
all to me what was really going on when using MSYS+MikTeX I had first to
do some action on the MikTeX side (go on the forum, post bugs...)

Le 17/09/2015 21:20, Eli Zaretskii a écrit :
>> From: address@hidden (Vincent Belaïche)
>> Cc: Vincent Belaïche <address@hidden> ,
>>     Texinfo <address@hidden>, Karl Berry <address@hidden>
>> Date: Thu, 17 Sep 2015 18:35:01 +0200
>>
>>>> - replace all ${path_sep} or $path_sep by :
>>>> - remove the piece of code with uname | grep -iv 'gygwin|mingw|djgpp',
>>>>   that sets path_sep, so that there is no longer any path_sep stuff.
>>>
>>> That will certainly break DJGPP, where this stuff actually used to
>>> work at some point.
>>
>> Thank you Eli for pointing that this code used to work. But actually I
>> think that this code is currently no longer working because
>>
>> - it sets path_sep to `:' for cygwin|mingw|djgpp
>> - and to `;' otherwise (ie including Linux).
>
> In the beginning there was only 'test -n "$COMSPEC$ComSpec"', and the
> comment still says so.  Then someone wanted to exclude Cygwin from
> that (since Cygwin is a Posix emulation, so it uses ':' even though
> $ComSpec is set, as always on Windows).  But then someone added
> "mingw" and "djgpp" to that, which of course is a mistake, since they
> don't need the uname test to begin with.
>
> So just leave only cygwin there, and that's it.

Well you are meaning that there are only two alternatives cygwin (all in
`:') and djgpp (all in `;'), and MSYS is really a bastard case.

Well I would agree about MSYS, but in the end I think it is still
possible to support well MSYS with a little more twiggling in texi2dvi
(ie https://savannah.gnu.org/bugs/download.php?file_id=34966 already
pointed at by my previous email).

On MSW there are two major distroes: TL & MikTeX. With TL you are
naturally on Cygwin, so no question you would use the Cygwin bash.

On MikTeX you just has native MSW application, contrary to what I had
thought MikTeX is *NOT* an MSYS application. So the question is where to
get bash.

What I also realized is that the texi2dvi bundled with MikTeX is not a
thin wrapper of Texinfo's texi2dvi, but of MikTeX's texify.  Christian
Schenk (MikTeX main maintainer) thinks it was an error to do that. He
does not seem to have the will to continue this way, so probably in the
future MikTeX will have the thin wrapper of Texinfo's texi2dvi.

>
>> Anyway, if only djgpp is concerned and if it uses `;' as a filename
>> separator both for the TeX envvars and for the PATH envvar, then my code
>> could be made simpler (close to the original one, with only a few
>> remaining `:' replaced by `${path_sep}'). My code is more complex
>> because it supports the heterogenous case of texi2dvi running in MSYS
>> with TeX engines not being Msys applications. Such a thing is useless
>> for MikTeX as I realized experimentally that MikTeX is an MSys
>> application, that is why I proposed to simplify the code --- as anyway
>> the current one is bogous.
>
> If you want to support MSYS, then it's a mess: MSYS converts ':' to
> ';' in PATH, but it doesn't do anything about other variables, like
> TEXINPUTS.  So if you have an MSYS Bash and MinGW TeX, you are screwed
> anyway.
>

There are two possible ways to support at least partially MSYS:

1) either the users shall not configure TEXINPUTS-like envvars. In that
   case the conversion done by MSYS is enough for getting MikTeX work
   under texi2dvi, provided that you make a slight upgrade for texi2dvi
   findprog to check that TeX is there:

   1.1) one way is to set path_sep to ':' (not ';') in the case of MSYS
        (like for Cygwin). This is what my initial patch did:
        https://savannah.gnu.org/bugs/download.php?file_id=34939

   1.2) Another way (not tested) would be to keep path_sep=';' for MSYS,
        but change findprog so that `which' is used if it exists, and if
        not PATH is scanned like now.

2) or making a bigger upgrade of texi2dvi where you would have two path
   separators, one for PATH envvar, and one for the TEXINPUTS-like
   envvars. I.e. we assume that TEXINPUTS-like envvars are in MSW style
   when texi2dvi is called (ie no conversion from MSW to MSYS done by
   any wrapper or by ~/.profile file). This is what my latest patch
   does:

      https://savannah.gnu.org/bugs/download.php?file_id=34966

   This is simpler than my other patch for which there were explicit
   conversions both in texi2dvi, and possibly prior to calling it ---
   this other patch is the one about which you commented in the email to
   which I am answering, it was more complicate, as instead of working
   with TEXINPUTS-like envar in MSW style all along, it was assuming
   that they are in MSYS style when texi2dvi is called, and converting
   them explicitly from MSYS style to MSW style during texi2dvi
   execution.

> Based on that, I wouldn't recommend the Texinfo project to even try
> supporting MSYS, since the probability of having MSYS TeX program on a
> Windows machine is close to zero.
>

Yes, I agree that there aren't any MSYS TeX programs, but with some
upgrading texi2dvi/MSYS could work with native TeX programs like MikTeX.

>> +# and we what to be POSIX compatible.
>> +case `if test -n "$COMSPEC$ComSpec" ; then \
>> +   uname | $SED -e 
>> 's/^.*\([Mm][Ii][Nn][Gg][Ww]\|[Dd][Jj][Gg][Pp][Pp]\).*$/\1/1'; \
>
> Why did you go to Sed instead of Grep?  What's the point of that?

It was silly of me. The point was to strip off everything that is before
or after mingw|djgpp, but indeed that could have been achieved without
sed, just by wildcarding with surrounding *'s the cases tags inside case
... esac construct.

>
>> +else \
>> + echo linux; \
>> +fi` in
>> +  mingw)
>> +  path_sep=":"
>> +  tex_sep=";"
>> +  native_pwd="pwd -W"
>
> How is this going to work?  You effectively assume that PATH will only
> be treated by MSYS programs, while TEXINPUTS etc. will only be treated
> by MinGW programs.  That assumption is so fragile that even if it
> works now, it is going to break soon.

I am not sure what you call ``MinGW programs''. I assumed that TEXINPUTS
would be used only by MikTeX engines, as in the case of MSYS it does not
make sense to use TL (you would use the Cygwin bash instead).

>
> Like I said: I don't think texi2dvi can usefully support MSYS.

MSYS might be more likely to be already installed on the user machine
than djgpp, e.g. it comes with git bash also (you can see that by
opening a git bash console and typing pwd -W it will work whereas the -W
option exists only in MSYS. You can also do this test perl -e 'print
"$^O\n"' that will output msys).

I don't know what Christian's intentions are, but if he decides that in
the future MikTeX will come with a thin wrapper for texi2dvi, then I am
wondering whether it could try to reuse a bash (MSYS or djgpp) already
on the machine or if non is found get it on the fly from some MikTeX
repo. MikTeX already has this general policy to install on the fly
whatever is found missing.

   Vincent.



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
http://www.avast.com




reply via email to

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