{"thread":{"id":"63020","subject":"gitweb.js build mistake","startedAt":"2025-02-28T05:34:51Z","lastAt":"2025-03-27T10:13:39Z","messageCount":5,"participants":["Thorsten Glaser","Simon Richter","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"513225","messageId":"070641d0-730c-7d92-af4a-9157dc1edd3d@debian.org","threadId":"63020","inReplyTo":null,"subject":"gitweb.js build mistake","fromName":"Thorsten Glaser","fromEmail":"tg@debian.org","sentAt":"2025-02-28T05:34:43Z","receivedAt":"2025-02-28T05:34:51Z","isPatch":false,"sender":{"key":"tg@debian.org","avatar":"https://avatars.githubusercontent.com/u/861078?v=4"},"body":"Hi,\n\nthe new gitweb.js build (moved into a shell script) now\nappends said shell script to the end of the gitweb.js\nthat’s actually installed, causing js syntax errors and\nno small amount of confusion.\n\nThis is because (rightfully) the output got a new dependency…\n> $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n… but the rule uses $^ to append sources.\n\nPossible fix attached.\n\nbye,\n//mirabilos\n-- \n<ch> you introduced a merge commit        │<mika> % g rebase -i HEAD^^\n<mika> sorry, no idea and rebasing just fscked │<mika> Segmentation\n<ch> should have cloned into a clean repo      │  fault (core dumped)\n<ch> if I rebase that now, it's really ugh     │<mika:#grml> wuahhhhhh\n\nFrom ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001\nFrom: mirabilos <tg@debian.org>\nDate: Fri, 28 Feb 2025 05:33:10 +0000\nSubject: [PATCH] Unbreak content of gitweb.js\n\nThe former $^ adds all prerequisites, including the\n(proper) new dependency on the generator script.\n\nSigned-off-by: mirabilos <tg@debian.org>\n---\n gitweb/Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex d5748e9359..2a8f97cef8 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -118,7 +118,7 @@ $(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl\n $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n-\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \\\n+\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \\\n \tmv $@+ $@\n \n ### Installation rules\n-- \n2.30.2\n\n"},{"id":"513226","messageId":"fc549e53-c3b1-4aaa-b027-19d8dae2f3a6@hogyros.de","threadId":"63020","inReplyTo":"070641d0-730c-7d92-af4a-9157dc1edd3d@debian.org","subject":"Re: gitweb.js build mistake","fromName":"Simon Richter","fromEmail":"simon.richter@hogyros.de","sentAt":"2025-02-28T05:46:04Z","receivedAt":"2025-02-28T05:51:50Z","isPatch":false,"sender":{"key":"simon.richter@hogyros.de","avatar":"https://gravatar.com/avatar/1192aa9fa5dd19ce258b12b044cc27111dd7cdb58d920dc2123a02a24f55b5c5?d=mp&s=160"},"body":"Hi,\n\nOn 2/28/25 14:34, Thorsten Glaser wrote:\n\n> This is because (rightfully) the output got a new dependency…\n>> $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n> … but the rule uses $^ to append sources.\n\n> Possible fix attached.\n\nWould an order-only dependency also work?\n\n     $(MAK_DIR_GITWEB)static/gitweb.js: | \n$(MAK_DIR_GITWEB)generate-gitweb-js.sh\n\n    Simon\n"},{"id":"513230","messageId":"175d9d3d-6e75-3348-6037-f1c774fc0d0c@debian.org","threadId":"63020","inReplyTo":"fc549e53-c3b1-4aaa-b027-19d8dae2f3a6@hogyros.de","subject":"Re: gitweb.js build mistake","fromName":"Thorsten Glaser","fromEmail":"tg@debian.org","sentAt":"2025-02-28T06:34:12Z","receivedAt":"2025-02-28T06:34:14Z","isPatch":false,"sender":{"key":"tg@debian.org","avatar":"https://avatars.githubusercontent.com/u/861078?v=4"},"body":"On Fri, 28 Feb 2025, Simon Richter wrote:\n\n> Would an order-only dependency also work?\n>\n>    $(MAK_DIR_GITWEB)static/gitweb.js: | $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n\nErk, that’s a gmake-ism. I have no idea, possibly. As a BSD make\nperson I consider use of $^ in nōn-suffix rules generally often\nproblematic…\n\nPerhaps test if it indeed works; if it does, choose by whatever\nis the project-desired style.\n\nThanks,\n//mirabilos\n-- \n11:56⎜«liwakura:#!/bin/mksh» also, i wanted to add mksh to my own distro │\ni was disappointed that there is no makefile │ but somehow the Build.sh is\nthe least painful built system i've ever seen │ honours CC, {CPP,C,LD}FLAGS\nproperly │ looks cleary like done by someone who knows what they are doing\n"},{"id":"513233","messageId":"Z8FfeEDHZocWHKeM@pks.im","threadId":"63020","inReplyTo":"070641d0-730c-7d92-af4a-9157dc1edd3d@debian.org","subject":"Re: gitweb.js build mistake","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-02-28T07:02:16Z","receivedAt":"2025-02-28T07:02:24Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Feb 28, 2025 at 06:34:43AM +0100, Thorsten Glaser wrote:\n> From ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001\n> From: mirabilos <tg@debian.org>\n> Date: Fri, 28 Feb 2025 05:33:10 +0000\n> Subject: [PATCH] Unbreak content of gitweb.js\n> \n> The former $^ adds all prerequisites, including the\n> (proper) new dependency on the generator script.\n\nThe commit message could use a bit of polishing. How about the\nfollowing:\n\n    gitweb: fix generation of \"gitweb.js\"\n\n    In 19d8fe7da65 (Makefile: extract script to generate gitweb.js,\n    2024-12-06) we have extracted the logic to build \"gitweb.js\" into a\n    separate script. As part of that the rules that builds the script\n    has gained a new dependency on that script.\n\n    This refactoring is broken though because we use \"$^\" to determine\n    the set of JavaScript files that need to be concatenated, and this\n    implicit variable now also contains the build script itself. As a\n    result, the build script ends up ni the generated \"gitweb.js\" file,\n    which is wrong.\n\n    Fix the issue by explicitly only passing the JavaScript files.\n\n> Signed-off-by: mirabilos <tg@debian.org>\n\nWe typically require plain names instead of aliases in the SOB.\n\n> ---\n>  gitweb/Makefile | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/gitweb/Makefile b/gitweb/Makefile\n> index d5748e9359..2a8f97cef8 100644\n> --- a/gitweb/Makefile\n> +++ b/gitweb/Makefile\n> @@ -118,7 +118,7 @@ $(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl\n>  $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n>  $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))\n>  \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n> -\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \\\n> +\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \\\n>  \tmv $@+ $@\n\nWe could avoid repetition by filtering out any files that we don't care\nabout, like so:\n\n    $(filter %.js,$^)\n\nIn any case, thanks for discovering and fixing this issue!\n\nPatrick\n"},{"id":"515145","messageId":"Z-UkysDjZZcVFfyM@pks.im","threadId":"63020","inReplyTo":"Z8FfeEDHZocWHKeM@pks.im","subject":"Re: gitweb.js build mistake","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-27T10:13:30Z","receivedAt":"2025-03-27T10:13:39Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Feb 28, 2025 at 08:02:16AM +0100, Patrick Steinhardt wrote:\n> On Fri, Feb 28, 2025 at 06:34:43AM +0100, Thorsten Glaser wrote:\n> > From ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001\n> > From: mirabilos <tg@debian.org>\n> > Date: Fri, 28 Feb 2025 05:33:10 +0000\n> > Subject: [PATCH] Unbreak content of gitweb.js\n> > \n> > The former $^ adds all prerequisites, including the\n> > (proper) new dependency on the generator script.\n> \n> The commit message could use a bit of polishing. How about the\n> following:\n> \n>     gitweb: fix generation of \"gitweb.js\"\n> \n>     In 19d8fe7da65 (Makefile: extract script to generate gitweb.js,\n>     2024-12-06) we have extracted the logic to build \"gitweb.js\" into a\n>     separate script. As part of that the rules that builds the script\n>     has gained a new dependency on that script.\n> \n>     This refactoring is broken though because we use \"$^\" to determine\n>     the set of JavaScript files that need to be concatenated, and this\n>     implicit variable now also contains the build script itself. As a\n>     result, the build script ends up ni the generated \"gitweb.js\" file,\n>     which is wrong.\n> \n>     Fix the issue by explicitly only passing the JavaScript files.\n> \n> > Signed-off-by: mirabilos <tg@debian.org>\n> \n> We typically require plain names instead of aliases in the SOB.\n\n> > ---\n> >  gitweb/Makefile | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/gitweb/Makefile b/gitweb/Makefile\n> > index d5748e9359..2a8f97cef8 100644\n> > --- a/gitweb/Makefile\n> > +++ b/gitweb/Makefile\n> > @@ -118,7 +118,7 @@ $(MAK_DIR_GITWEB)gitweb.cgi: $(MAK_DIR_GITWEB)gitweb.perl\n> >  $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh\n> >  $(MAK_DIR_GITWEB)static/gitweb.js: $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES))\n> >  \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n> > -\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $^ && \\\n> > +\t$(MAK_DIR_GITWEB)generate-gitweb-js.sh $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \\\n> >  \tmv $@+ $@\n> \n> We could avoid repetition by filtering out any files that we don't care\n> about, like so:\n> \n>     $(filter %.js,$^)\n> \n> In any case, thanks for discovering and fixing this issue!\n> \n> Patrick\n\nThorsten, do you plan to send another version of this patch that\nincludes my feedback? Otherwise I'm happy to bring this over the\nfinishing line.\n\nThanks!\n\nPatrick\n"}]}