Quoted paths on Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Quoted paths on Windows

Jeroen Ooms
The GNU R project provides a toolchain (gcc 4.9.3 / mingw-w64) with
utils in a bundle called Rtools [1] for Windows users to compile
contributed packages

The current Rtools includes make 3.79.1. We are trying to upgrade to a
newer version, however the behavior of 'make' seems to have changed in
a way that breaks our infrastructure.

The main issue is how 'make' parses quoted paths. R generates rules like this:

c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.1/include"
-DNDEBUG -Iyajl/api    -I"d:/Compiler/gcc-4.9.3/local330/include"  -O2
-Wall  -std=gnu99 -mtune=core2 -c base64.c -o base64.o

The line above works with the old 'make', however with make 4.2.1 this
gives an error that headers cannot be found. The problem seems to be
the quotation of paths. It looks like make does not parse the quotes
and assumes the path as is, with the quotes. If I take away the
quotes, the problem disappears. However given that there are over 10k
R packages with hardcoded windows make files, altering behavior at
this point is not an option.

I am already compiling 'make' with ac_cv_dos_paths=yes. Are there any
other configure options required to build a version that parses the
quotes as our old 'make' does it, so that we can upgrade 'make'
without massive disruptions?


[1] https://cran.r-project.org/bin/windows/Rtools/

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make
Reply | Threaded
Open this post in threaded view
|

Re: Quoted paths on Windows

Eli Zaretskii
> From: Jeroen Ooms <[hidden email]>
> Date: Tue, 20 Sep 2016 15:24:49 +0200
>
> The current Rtools includes make 3.79.1. We are trying to upgrade to a
> newer version, however the behavior of 'make' seems to have changed in
> a way that breaks our infrastructure.

It has changed, allright, but the change wasn't supposed to break
anything.

> The main issue is how 'make' parses quoted paths. R generates rules like this:
>
> c:/Rtools/mingw_64/bin/gcc  -I"C:/PROGRA~1/R/R-33~1.1/include"
> -DNDEBUG -Iyajl/api    -I"d:/Compiler/gcc-4.9.3/local330/include"  -O2
> -Wall  -std=gnu99 -mtune=core2 -c base64.c -o base64.o
>
> The line above works with the old 'make', however with make 4.2.1 this
> gives an error that headers cannot be found. The problem seems to be
> the quotation of paths. It looks like make does not parse the quotes
> and assumes the path as is, with the quotes.

I cannot reproduce this on my system.  I used a simple program that
simply echoes its argv[] array, and invoked that program with a
command such as the one you show above.  The command-line arguments
displayed by the program were devoid of any quotes, as expected.

So I think there's some factor involved here that you didn't
describe.  Some relevant factors might be:

  . what shell is being used by Make?
  . is c:/Rtools/mingw_64/bin/gcc.exe a native Windows program, or is
    it a Cygwin or MSYS program? or maybe it is some wrapper script?

> I am already compiling 'make' with ac_cv_dos_paths=yes.

I'm not sure I understand what that means.  Could you try the binaries
from here:

  https://sourceforge.net/projects/ezwinports/files/make-4.2-without-guile-w32-bin.zip/download

and see if the problem persists?  (If you need Make with Guile
support, you will find one right near the above one.)

> Are there any other configure options required to build a version
> that parses the quotes as our old 'make' does it, so that we can
> upgrade 'make' without massive disruptions?

The official MinGW Make build does not use the Posix configury stuff,
it uses a dedicated batch file, build_w32.bat, so there's no simple
answer to your question.  I myself never used the configure script and
the Posix Makefiles it creates to build the native Windows port of GNU
Make, I always use that batch file.

_______________________________________________
Help-make mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-make