Re: [PATCH] generate-configlist: collapse depfile for older Ninja
- From
Toon Claes <toon@iotcl.com>
- Date
- Apr 22, 2026, 07:09 UTC
- Message-ID
- <878qafeait.fsf@toon--20250203-5JQV3.mail-host-address-is-not-set>
- In-Reply-To
- <aehsikCfPm83M9dN@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 5 quoted lines
> Do we really have to make the logic conditional? I would expect that > this works just fine for newer versions of Ninja and for Make, so it > feels rather pointless to me to have two modes to worry about. > > So wouldn't the below simplified version be sufficient?
I considered that, but I wasn't sure. I went all-in to show what it could be, but I'm happy to see simplifications.
Now your version doesn't remove the no-op targets from config-list.h.d. I did some testing, and while Ninja doesn't need those no-op target, they are also harmless to keep them. Thus I agree your version is simpler and better. Let me roll another version.
Thanks!
Show 15 quoted lines
> diff --git a/tools/generate-configlist.sh b/tools/generate-configlist.sh
> index e28054f9e0..f5f42492c6 100755
> --- a/tools/generate-configlist.sh
> +++ b/tools/generate-configlist.sh
> @@ -44,7 +44,9 @@ then
> {
> printf '%s\n' "$SOURCE_DIR"/Documentation/*config.adoc \
> "$SOURCE_DIR"/Documentation/config/*.adoc |
> - sed -e 's/[# ]/\\&/g' -e "s/^/$QUOTED_OUTPUT: /"
> + sed -e 's/[# ]/\\&/g' |
> + tr '\n' ' ' |
> + sed -e "s/^/$QUOTED_OUTPUT: /" -e 's/ $/\n/'
> printf '%s:\n' "$SOURCE_DIR"/Documentation/*config.adoc \
> "$SOURCE_DIR"/Documentation/config/*.adoc |
> sed -e 's/[# ]/\\&/g'-- Cheers, Toon