All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Gustavo Luiz Duarte <gustavold@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Breno Leitao <leitao@debian.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts: kconfig: merge_config.sh: keep temp file in the output dir
Date: Wed, 8 Jul 2026 20:47:25 +0200	[thread overview]
Message-ID: <ak6bPbhLtfBV5M0q@levanger> (raw)
In-Reply-To: <20260708-merge_config_output-v1-1-e35fa223d6f3@gmail.com>

On Wed, Jul 08, 2026 at 04:04:54AM -0700, Gustavo Luiz Duarte wrote:
> merge_config.sh currently creates a temporary file in the current
> directory. Create it under $OUTPUT instead, which allows running the
> script against a read-only source tree.
> 
> The default behavior is unchanged: $OUTPUT is "." so the file stays in
> the cwd.

Out of curiosity: in which situation do you need this fix?

> 
> Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
> ---
>  scripts/kconfig/merge_config.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index f08e0863b7128..a63250d4cbf12 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -122,7 +122,7 @@ fi
>  
>  MERGE_LIST=$*
>  
> -TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
> +TMP_FILE=$(mktemp "$OUTPUT/.tmp.config.XXXXXXXXXX")

<bike-shedding>
While this does as written in the commit message, I'd rather expected
something like

 mktemp --tmpdir="$OUTPUT" .tmp.config.XXXXXXXXXX

instead.
</bike-shedding>


When I am reading the help text for merge_config.sh's '-O', I think we
should adjust the default output directory as well:

  -O    dir to put generated output files.  Consider setting $KCONFIG_CONFIG instead.

With a read-only source tree in mind, KCONFIG_CONFIG probably has to be
set, otherwise we'd not need to put the temporary file somewhere else.
Might it be more consistent to use $(dirname ${KBUILD_KCONFIG}) as
default for OUTPUT instead of '.'?

So, once again: in which situation do you need the fix?  Is it really
sufficient as it is?


Nevertheless, I think it's a good idea, thanks for the patch.

Kind regards,
Nicolas

  parent reply	other threads:[~2026-07-08 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 11:04 [PATCH] scripts: kconfig: merge_config.sh: keep temp file in the output dir Gustavo Luiz Duarte
2026-07-08 12:18 ` Breno Leitao
2026-07-08 18:47 ` Nicolas Schier [this message]
2026-07-09 16:42   ` Gustavo Luiz Duarte

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=ak6bPbhLtfBV5M0q@levanger \
    --to=nsc@kernel.org \
    --cc=gustavold@gmail.com \
    --cc=leitao@debian.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.