[sr #110901] libtool hangs indefinitely on windows when used in msys due to cmd.exe call bug

Evgeny Grin <[email protected]> Sun, 22 Jun 2025 07:48:53 -0400 (EDT)
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <[email protected]>
--8323329-1138779841-1750592933=:2915838
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

Follow-up Comment #16, sr #110901 (group libtool):=0A=0A[comment #12 =D0=BA=
=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B9 =E2=84=9612:]=
=0A> [comment #10 comment #10:]=0A>> Looks like MSys is still in (very inac=
tive) use.=0A>> The project page has two years old activity.=0A> Could you =
link the project page here? =0A> =0A=0AProbably the most current valid link=
 is =0Ahttps://sourceforge.net/projects/mingw/=0A=0A[comment #15 =D0=BA=D0=
=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B9 =E2=84=9615:]=0A>=
 I pushed a patch that should cache if cygpath is present with a simple che=
ck=0A> for the help message. If the check is successful,=0A> func_convert_c=
ore_msys_to_w32_with_cygpath will be used, but if it is not,=0A> the previo=
us implementation will be used, func_convert_core_msys_to_w32.=0A> =0A> Thi=
s should have the requested behaviour, where MSYS needs command line flags=
=0A> escaped, but MSYS2 can use cygpath.=0A> =0A> https://cgit.git.savannah=
.gnu.org/cgit/libtool.git/commit/?h=3Ddevelopment&id=3D9f4b6adea4403e38b0b1=
f75761563c103d7c0e03=0A=0AThis could be risky too.=0AIf double slash is not=
 converted (for any reason), then the command "cmd.exe=0A//c something" wil=
l start interactive shell.=0A=0AI'd suggest to use several workarounds.=0A*=
 check for cygpath and use it, if available. The best, the fastest and the=
=0Amost straightforward way.=0A* Without cygpath cmd may hang with a single=
 slash (when transforming) and may=0Ahang with two slashes (when not transf=
orming). The easy solution is:=0A_lt_result=3D`"${COMSPEC-cmd}" /c echo one=
-slash works. Not checked //c echo=0Atwo-slashes 2>/dev/null`=0AThe resulti=
ng string is started with "one-slash or "two-slashes".=0A=0AIt can be used =
like this:=0A=0AAS_CASE([$host],=0A  [*-*-mingw* | *-*-windows* | *-*-cygwi=
n*],=0A  [AS_CASE([$build],=0A    [*-*-mingw* | *-*-windows* | *-*-cygwin*]=
,=0A    [AC_MSG_CHECKING([whether cygpath is installed])=0A      AC_CACHE_V=
AL([lt_cv_cygpath_installed],=0A        [lt_cv_cygpath_installed=3Dignoring=
=0A          cygpath --help &> /dev/null=0A          _lt_result=3D$?=0A    =
      AS_IF([test 0 =3D=0A"$_lt_result"],[lt_cv_cygpath_installed=3Dyes],[l=
t_cv_cygpath_installed=3Dno])=0A        ])=0A      AC_MSG_RESULT([$lt_cv_cy=
gpath_installed])=0A      _LT_DECL([cygpath_installed], [lt_cv_cygpath_inst=
alled],=0A               [0], [whether cygpath is installed])dnl=0A      AS=
_IF([test "xyes" !=3D "x$lt_cv_cygpath_installed"],=0A        [=0A         =
 AC_MSG_CHECKING([whether to use cmd with one slash or two slashes])=0A    =
      AC_CACHE_VAL([lt_cv_cmd_slashes],=0A            [=0A              _lt=
_result=3D`"${COMSPEC-cmd}" /c echo one-slash works. Not=0Achecked //c echo=
 two-slashes 2>/dev/null`=0A              AS_IF([test 0 !=3D $?],[AC_MSG_ER=
ROR([Do not know how to convert=0Apaths])])=0A              AS_CASE([$_lt_r=
esult],=0A                [one-slash*],[lt_cv_cmd_slashes=3D"one"],=0A     =
           [two-slashes*],[lt_cv_cmd_slashes=3D"two"],=0A                [A=
C_MSG_ERROR([Do not know how to convert paths])]=0A              )=0A      =
      ])=0A          AC_MSG_RESULT([$lt_cv_cmd_slashes])=0A        ])=0A   =
 ])=0A  ]=0A)dnl=0A=0A=0AThe should be the most robust and reliable way of =
checking and using paths=0Aconversion.=0A=0A=0A    ________________________=
_______________________________=0A=0AReply to this item at:=0A=0A  <https:/=
/savannah.gnu.org/support/?110901>=0A=0A___________________________________=
____________=0A=D0=A1=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B5 =D0=
=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE =D0=BF=D0=BE Sava=
nnah=0Ahttps://savannah.gnu.org/=0A
--8323329-1138779841-1750592933=:2915838
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaFftpQAKCRCqLAuaBUf3
TlxiAP4xqeUotDMUfHicLfhSVpS2SrSMoq4tA2jmcZtqhevrdgEA5k/SGbcgFqvN
OHCKMUwhAmBEX3FsrzqDmrKqs74PwwQ=
=fibR
-----END PGP SIGNATURE-----

--8323329-1138779841-1750592933=:2915838--