Hi Reuben,

Reuben Thomas wrote:
> ...
> The problem appears to be that INSTALLDIR is passed to the compiler on the
> command line, and something in the mingw64 machinery says "aha! it's a
> path!" and transforms it to Windows style.

Yes, this is the same problem for which I am writing in the INSTALL.windows
file of all packages that I maintain:

   (*) Note: The MSYS2 environment as a development environment is *not*
       supported.  This environment contains an ignoble and ignominious hack:
       In a program invocation, the program *by default* receives different
       arguments than the ones that the caller has passed.  See
       <https://www.msys2.org/wiki/Porting/#filesystem-namespaces>.
       All program invocations in this environment are therefore unreliable.

> I tried setting "MSYS_NO_PATHCONV=1", but this caused the compilation of
> relocatable.c to hang!

AFAIU, MSYS_NO_PATHCONV=1 is the workaround for old (defunct) MSYS and
MSYS2_ARG_CONV_EXCL=* is the workaround for MSYS2. See
https://www.msys2.org/wiki/Porting/#filesystem-namespaces

> In the end my workaround was to use this way to set INSTALLDIR in the
> Makefile.am for gnulib:
> 
> AM_CPPFLAGS += -DINSTALLDIR=BINDIR -include configmake.h
> 
> Since I am using configmake anyway, this means I can get the right setting
> without exposing it to Mingw's command-line (or environment variable)
> transformation.
> 
> I don't know if there's anything to be done here, beyond perhaps warn about
> it?

I think the best action will be to document that the 'relocatable' modules
are not supported in MSYS2 as build environment.

Gnulib does not ban the MSYS2 environment outright, because it's up to the
package maintainer to decide which ports and which build environments they
support. But most of these packages don't use 'relocatable'. And since
the 'relocatable' module relies on passing directory names through -D
options (and it would be silly to spend time on a workaround), I would
propose to address this issue through documentation.

Bruno




Reply via email to