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

Re: [PATCH v2 2/5] gitweb: fix generation of "gitweb.js"

From
Patrick Steinhardt <ps@pks.im>
Date
Apr 2, 2025, 06:40 UTC
Message-ID
<Z-zb7yPcPgJRhhXR@pks.im>
In-Reply-To
<e9ea3630-a831-dec5-e461-3f550ceb7ec3@gmx.de>
On Tue, Apr 01, 2025 at 06:30:01PM +0200, Johannes Schindelin wrote:
Show 20 quoted lines
> Hi Patrick,
> 
> On Mon, 31 Mar 2025, Patrick Steinhardt wrote:
> 
> > diff --git a/gitweb/Makefile b/gitweb/Makefile
> > index d5748e93594..26a683d4421 100644
> > --- a/gitweb/Makefile
> > +++ b/gitweb/Makefile
> > @@ -118,7 +118,7 @@ $(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl
> >  $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh
> >  $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))
> >  	$(QUIET_GEN)$(RM) $@ $@+ && \
> > -	$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \
> > +	$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $(filter %.js,$^) && \
> >  	mv $@+ $@
> 
> A safer way might be to use `$(filter-out %.sh,$^)` just in case the
> Javascript libraries might at some stage be renamed (I could imagine, for
> example, that someone aims for ideological purity and renames them to
> `*.cjs`).
I could see arguments both ways:
  - If we use "filter-out" the developer now has to remember to also
    filter out files whenever a new dependency is added.
  - If we use "filter" the developer has to remember to update the
    pattern if any of the files are renamed.

I think the developer is going to be more on the guard in the second case -- after all, renaming files always requires you to also update the build instructions. On the other hand it's quite easy to miss that you have to adapt the "filter-out" logic when adding a new dependency. In the end neither of these solutions is perfect, but the worst part is that we don't have any tests at all that would detect a broken build.

So I lean towards keeping the current mechanism, but don't feel strongly about it. Let me know in case you still prefer "filter-out" and I'll adapt accordingly.

Patrick
Previous: Johannes SchindelinNext: Toon Claes
Message 14 of 22 in “Collection of build fixes”
  1. 0/4 Collection of build fixesPatrick Steinhardt, Mar 28, 2025
  2. 1/4 meson: fix handling of '-Dcurl=auto'Patrick Steinhardt, Mar 28, 2025
  3. 2/4 gitweb: fix generation of "gitweb.js"Patrick Steinhardt, Mar 28, 2025
  4. 3/4 meson: require Perl when building docsPatrick Steinhardt, Mar 28, 2025
  5. Junio C HamanoMar 29, 2025
  6. Patrick SteinhardtMar 31, 2025
  7. 4/4 meson: respect 'tests' build option in contribPatrick Steinhardt, Mar 28, 2025
  8. Sam JamesMar 28, 2025
  9. 0/5 Collection of build fixesPatrick Steinhardt, Mar 31, 2025
  10. 1/5 meson: fix handling of '-Dcurl=auto'Patrick Steinhardt, Mar 31, 2025
  11. Karthik NayakApr 3, 2025
  12. 2/5 gitweb: fix generation of "gitweb.js"Patrick Steinhardt, Mar 31, 2025
  13. Johannes SchindelinApr 1, 2025
  14. Patrick SteinhardtApr 2, 2025
  15. Toon ClaesApr 1, 2025
  16. 3/5 meson: respect 'tests' build option in contribPatrick Steinhardt, Mar 31, 2025
  17. Johannes SchindelinApr 1, 2025
  18. 5/5 ci: use Visual Studio for win+meson job on GitHub WorkflowsPatrick Steinhardt, Mar 31, 2025
  19. 4/5 meson: distinguish build and target host binariesPatrick Steinhardt, Mar 31, 2025
  20. Karthik NayakApr 3, 2025
  21. Johannes SchindelinApr 1, 2025
  22. Karthik NayakApr 3, 2025

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.