[Top][All Lists]

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

Re: [PING] [PATCH] Escape space in path to $SHELL

From: Torbjorn SVENSSON
Subject: Re: [PING] [PATCH] Escape space in path to $SHELL
Date: Thu, 13 Jul 2023 18:30:54 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

Thanks for the reply Paul.

On 2023-07-12 17:19, Paul Smith wrote:
On Wed, 2023-07-12 at 17:11 +0200, Torbjorn SVENSSON wrote:
* src/job.c (construct_command_argv_internal): Escape space in

Unfortunately this is so simple.  Currently the spaces in the SHELL
variable are not escaped, and things like this work:

     SHELL := /bin/sh -x

and do what you expect.  Or, perhaps you use a different shell than
/bin/sh and you add options that way.

I see.

I fully agree with you that it is not great that we have this, plus
.SHELLFLAGS, plus poor support for whitespace in pathnames (including
in the path of the SHELL program) but it is what it is.

My suspicion is that this non-backward-compatible change will break
some number of makefiles.

I would prefer to avoid doing this until we can make a comprehensive
and complete set of changes around show shells are managed and invoked,
so that we don't need to make backward-incompatible changes across
multiple releases (if they are needed).

In short, the fact that GNU Make doesn't work well with pathnames
containing whitespace is not limited to targets and prerequisites: it's
also true for programs that make invokes including the value of SHELL.

From what I can tell, this is possible to work around by quoting the path in the makefile (so that the quoted string is parsed by the shell and not make).

I have a lot of other things going on right now, but I will return to this subject in the future and try to figure out a way that would be compatible with the use-case you mentioned above, while still support space in the path part.

reply via email to

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