'make check' fails if there is a space in the filename

Christopher Jefferson chris at bubblescope.net
Fri Nov 13 12:07:40 UTC 2015


How about adding something similar to the following to GMP's configure
script (warning, not checked, not a configure expert), which would at
least produce a better error message to users?

case `pwd` in
  *\ *)
    AC_ERROR("can't build in a directory containing spaces")
  ;;
esac

On 13 November 2015 at 11:57, Vincent Lefevre <vincent at vinc17.net> wrote:
> On 2015-11-13 11:00:21 +0100, Niels Möller wrote:
>> Vincent Lefevre <vincent at vinc17.net> writes:
>> > 3. This is a very complex issue due to the way Bourne/POSIX-compatible
>> >    shells work, and it will probably never be fixed, in particular
>> >    because a proper fix would slow things down for everyone.
>>
>> My experience is that it's usually no big deal to write shell scripts
>> with proper quoting to support filenames with spaces. Highly
>> recommended.
>>
>> The larger problem is that make really wants space for a separator. Not
>> sure if it's possible at all to do proper quoting in make, and if it's
>> possible, it's not going to mix well with sh quoting.
>
> The first issue is a practical consequence of the second one. Quoting
> is not always used because the goal is to support list of filenames
> as well (the only safe separator would be \0, but this may not be
> supported by every tool).
>
> IMHO, the cleanest solution would be to using % escaping like in URL's.
> But this requires encoding/decoding at the right places. Not easy to
> add for an existing complex software like libtool.
>
>> And on top of that, there's Makefile conventions, like supporting
>> CC="gcc -m32", which is used without sh-quoting the Makefile, and that's
>> fundamentally incompatible with supporting CC="/tmp/a b/cc".
>
> Yes. To support "/tmp/a b/cc", one could write CC="/tmp/a?b/cc", but
> this is ambiguous and here in /tmp, not safe at all.
>
> IMHO, if people want spaces in filenames, they should use something
> like the non-break space (BTW, this was the RISC OS method to support
> them in filenames).
>
> --
> Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
> _______________________________________________
> gmp-bugs mailing list
> gmp-bugs at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-bugs


More information about the gmp-bugs mailing list