From: Phillip Wood Date: Wed, 11 Feb 2026 14:05:10 GMT Subject: Re: [PATCH] meson: regenerate config-list.h when Documentation changes Message-ID: <171c0724-7891-41d7-8a70-94fbbf8b43b2@gmail.com> In-Reply-To: On 11/02/2026 10:58, Patrick Steinhardt wrote: > On Wed, Feb 11, 2026 at 09:44:48AM +0000, Phillip Wood wrote: >> On 11/02/2026 07:42, Patrick Steinhardt wrote: >>> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote: >>>>> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote: >>> [snip] >>>> Only, things are behaving oddly. For example: >>>> >>>> λ meson setup build2 >>>> λ ninja -C build2 >>>> >>>> works fine, but >>>> >>>> λ ls -l build2/config* >>>> -rw-r--r-- 1 benknoble benknoble 17169 9 févr. 16:39 build2/config-list.h >>>> >>>> I don't see the dependency file. >>> >>>> Further, re-building seems to get stuck (I get >>>> similar symptoms if I add or remove a relevant config.adoc file, but let's keep >>>> it simple for now): >>>> >>>> λ ninja -C build2 >>>> ninja: Entering directory `build2' >>>> [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env) >>> >>> With "stuck" you mean that it doesn't do anything, or that it doesn't >>> actually rebuild? >>> >>> I guess it kind of makes sense that a new file wouldn't trigger a >>> rebuild, even though I would have expected a removed one to trigger one. >>> After all, the dependency file only tracks the set of _existing_ files >>> so that we know when to rebuild, and of course the dependency file only >>> gets regenerated in case any of those files changes. >> >> If anyone adds a new file under Documentation/config/ they will need to >> update Documentation/config.adoc which should then trigger the rebuild. That >> rebuld will then add the new file to the list of dependencies. If they >> remove a file we should pick that up with the dependencies that are already >> listed. > > Oh? Well, if that's the case then the additional changes should indeed > not be required. I think so. The only problem I can think of is that if you delete a file, build, restore the file without changing anything else and build again then config-list.h will not be rebuilt because the deleted file would have been removed from the list of dependencies by the previous build. >> >> It would be really nice if we can avoid regenerating the depfile with every >> build. > > Agreed. So maybe the first patch I sent is sufficient after all? We need to add the script to the list of dependencies and reading the comments in https://github.com/ninja-build/ninja/blob/master/src/depfile_parser.in.cc we should be backslash escaping space, hash and backslash in the filename when we write the dependencies. Apart from that I think it is ok. I guess the alternative is to bite the bullet and list these dependencies explicitly as we do for other targets. Thanks Phillip