mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Bagas Sanjaya' <bagasdotme@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	"linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Richard Purdie <richard.purdie@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Michal Marek <michal.lkml@markovi.net>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC PATCH 2/3] kconfig: allow to choose the shell for $(shell ) functions
Date: Fri, 19 Aug 2022 21:37:29 +0000	[thread overview]
Message-ID: <a1b0c5a396fa454183b730cacfb173b0@AcuMS.aculab.com> (raw)
In-Reply-To: <831ebaf6-6fea-65ea-aa60-c47f6f05dbb0@gmail.com>

From: Bagas Sanjaya
> Sent: 19 August 2022 09:59
> 
> On 8/19/22 13:56, Masahiro Yamada wrote:
> > GNU Make uses /bin/sh by default for running recipe lines and $(shell )
> > functions. You can change the shell by setting the 'SHELL' variable.
> > Unlike most variables, 'SHELL' is never set from the environment. [1]
> >
> > Currently, Kconfig does not provide any way to change the default shell.
> > /bin/sh is always used for running $(shell,...) because do_shell() is
> > implemented by using popen(3).
> >
> > This commit allows users to change the shell for Kconfig in a similar
> > way to GNU Make; you can set the 'SHELL' variable in a Kconfig file to
> > override the default shell. It is not taken from the environment. The
> > change is effective only for $(shell,...) invocations called after the
> > 'SHELL' assignment.
> >
> 
> Hmmm...
> 
> Can we say that if we run SHELL=/bin/bash make nconfig, Kconfig will use
> $SHELL but we can't set it as environment variable?

That just puts it into the environment for the single command.
You'd need to pass it as a command line argument to make.

(Or pass it in a different environment variable and then assign
it within the makefile.)

Or just remove the crappy bashisms and write portable shell scripts.
Just be glad you're not trying to use the SYSV /bin/sh.
(And avoid the other bugs that make dash fail to run most of the
scripts I write.)

Compex echo requests can be replaced by printf (without penalty
since it will be a shell builtin).

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2022-08-19 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  6:56 [RFC PATCH 0/3] kbuild: change the default shell to bash Masahiro Yamada
2022-08-19  6:56 ` [RFC PATCH 1/3] kconfig: move declarations for prepossessing to internal.h Masahiro Yamada
2022-08-19  6:56 ` [RFC PATCH 2/3] kconfig: allow to choose the shell for $(shell ) functions Masahiro Yamada
2022-08-19  8:58   ` Bagas Sanjaya
2022-08-19 21:37     ` David Laight [this message]
2022-08-19  6:56 ` [RFC PATCH 3/3] kbuild: use bash as the default shell for Make and Kconfig Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1b0c5a396fa454183b730cacfb173b0@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bagasdotme@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=rdunlap@infradead.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome