git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] generate-configlist: collapse depfile for older Ninja

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 22, 2026, 06:36 UTC
Message-ID
<aehsikCfPm83M9dN@pks.im>
In-Reply-To
<20260421-toon-fix-almalinux8-v1-1-aec1d54addde@iotcl.com>
On Tue, Apr 21, 2026 at 09:17:25PM +0200, Toon Claes wrote:
Show 9 quoted lines
> For the Makefile build system this works great. And since
> ebeea3c471 (build: regenerate config-list.h when Documentation changes,
> 2026-02-24) this script is also called from the Meson build system.
> Nevertheless, on AlmaLinux 8 the following build failure is seen:
> 
>     ninja: error: dependency cycle: config-list.h -> config-list.h
> 
> This version of this distro uses Ninja 1.8.2 and it seems to have some
> issues with the format of the `config-list.h.d` file.
Right, I can reproduce the issue with that version indeed:
    $ meson setup -Ddocs=man build
    $ ninja -C build
    ... successful build ...
    $ ninja -C build
    ninja: error: dependency cycle: config-list.h -> config-list.h
Show 15 quoted lines
> Ninja versions before 1.10.0 do not reset the depfile parser state on
> newlines. This causes issues when the depfile has one dependency per
> line, like we have in `config-list.h.d`:
> 
>     config-list.h: Documentation/config.adoc
>     config-list.h: Documentation/config/add.adoc
> 
> The parser only recognizes the first "config-list.h:" as a target. On
> subsequent lines it is still in dependency-parsing mode, so the repeated
> output name is recorded as an input. This causes the error mentioned
> above.
> 
> The bug in Ninja is fixed in 1.10, with commit
> ninja-build/ninja@1daa7470ab7e (depfile_parser: remove restriction on
> multiple outputs, 2019-11-20).
Good find.
Show 9 quoted lines
> To be compatible with older versions of Ninja, add a fourth optional
> argument to `generate-configlist.sh` that can be empty or "collapse".
> When this argument is "collapse", there is a post-processing step on
> `config-list.h.d` to put the dependencies for `config-list.h` on a
> single line, like:
> 
>     config-list.h: Documentation/config.adoc Documentation/config/add.adoc ...
> 
> This works around the bug in older versions of Ninja.

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?
Thanks!
Patrick
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'
Previous: Toon ClaesNext: Toon Claes
Message 2 of 12 in “generate-configlist: collapse depfile for older Ninja”
  1. generate-configlist: collapse depfile for older NinjaToon Claes, Apr 21, 2026
  2. Patrick SteinhardtApr 22, 2026
  3. Toon ClaesApr 22, 2026
  4. generate-configlist: collapse depfile for older NinjaToon Claes, Apr 22, 2026
  5. Patrick SteinhardtApr 22, 2026
  6. Phillip WoodApr 22, 2026
  7. Phillip WoodApr 22, 2026
  8. Toon ClaesMay 15, 2026
  9. generate-configlist: collapse depfile for older NinjaToon Claes, May 15, 2026
  10. Phillip WoodMay 15, 2026
  11. Patrick SteinhardtMay 21, 2026
  12. D. Ben KnobleApr 22, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.