* gitweb.js build mistake
@ 2025-02-28 5:34 Thorsten Glaser
2025-02-28 5:46 ` Simon Richter
2025-02-28 7:02 ` Patrick Steinhardt
0 siblings, 2 replies; 5+ messages in thread
From: Thorsten Glaser @ 2025-02-28 5:34 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]
Hi,
the new gitweb.js build (moved into a shell script) now
appends said shell script to the end of the gitweb.js
that’s actually installed, causing js syntax errors and
no small amount of confusion.
This is because (rightfully) the output got a new dependency…
> $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh
… but the rule uses $^ to append sources.
Possible fix attached.
bye,
//mirabilos
--
<ch> you introduced a merge commit │<mika> % g rebase -i HEAD^^
<mika> sorry, no idea and rebasing just fscked │<mika> Segmentation
<ch> should have cloned into a clean repo │ fault (core dumped)
<ch> if I rebase that now, it's really ugh │<mika:#grml> wuahhhhhh
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-Unbreak-content-of-gitweb.js.patch, Size: 1043 bytes --]
From ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001
From: mirabilos <tg@debian.org>
Date: Fri, 28 Feb 2025 05:33:10 +0000
Subject: [PATCH] Unbreak content of gitweb.js
The former $^ adds all prerequisites, including the
(proper) new dependency on the generator script.
Signed-off-by: mirabilos <tg@debian.org>
---
gitweb/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitweb/Makefile b/gitweb/Makefile
index d5748e9359..2a8f97cef8 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 $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \
mv $@+ $@
### Installation rules
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: gitweb.js build mistake
2025-02-28 5:34 gitweb.js build mistake Thorsten Glaser
@ 2025-02-28 5:46 ` Simon Richter
2025-02-28 6:34 ` Thorsten Glaser
2025-02-28 7:02 ` Patrick Steinhardt
1 sibling, 1 reply; 5+ messages in thread
From: Simon Richter @ 2025-02-28 5:46 UTC (permalink / raw)
To: Thorsten Glaser, git
Hi,
On 2/28/25 14:34, Thorsten Glaser wrote:
> This is because (rightfully) the output got a new dependency…
>> $(MAK_DIR_GITWEB)static/gitweb.js: $(MAK_DIR_GITWEB)generate-gitweb-js.sh
> … but the rule uses $^ to append sources.
> Possible fix attached.
Would an order-only dependency also work?
$(MAK_DIR_GITWEB)static/gitweb.js: |
$(MAK_DIR_GITWEB)generate-gitweb-js.sh
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb.js build mistake
2025-02-28 5:46 ` Simon Richter
@ 2025-02-28 6:34 ` Thorsten Glaser
0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Glaser @ 2025-02-28 6:34 UTC (permalink / raw)
To: Simon Richter; +Cc: git
On Fri, 28 Feb 2025, Simon Richter wrote:
> Would an order-only dependency also work?
>
> $(MAK_DIR_GITWEB)static/gitweb.js: | $(MAK_DIR_GITWEB)generate-gitweb-js.sh
Erk, that’s a gmake-ism. I have no idea, possibly. As a BSD make
person I consider use of $^ in nōn-suffix rules generally often
problematic…
Perhaps test if it indeed works; if it does, choose by whatever
is the project-desired style.
Thanks,
//mirabilos
--
11:56⎜«liwakura:#!/bin/mksh» also, i wanted to add mksh to my own distro │
i was disappointed that there is no makefile │ but somehow the Build.sh is
the least painful built system i've ever seen │ honours CC, {CPP,C,LD}FLAGS
properly │ looks cleary like done by someone who knows what they are doing
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb.js build mistake
2025-02-28 5:34 gitweb.js build mistake Thorsten Glaser
2025-02-28 5:46 ` Simon Richter
@ 2025-02-28 7:02 ` Patrick Steinhardt
2025-03-27 10:13 ` Patrick Steinhardt
1 sibling, 1 reply; 5+ messages in thread
From: Patrick Steinhardt @ 2025-02-28 7:02 UTC (permalink / raw)
To: Thorsten Glaser; +Cc: git
On Fri, Feb 28, 2025 at 06:34:43AM +0100, Thorsten Glaser wrote:
> From ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001
> From: mirabilos <tg@debian.org>
> Date: Fri, 28 Feb 2025 05:33:10 +0000
> Subject: [PATCH] Unbreak content of gitweb.js
>
> The former $^ adds all prerequisites, including the
> (proper) new dependency on the generator script.
The commit message could use a bit of polishing. How about the
following:
gitweb: fix generation of "gitweb.js"
In 19d8fe7da65 (Makefile: extract script to generate gitweb.js,
2024-12-06) we have extracted the logic to build "gitweb.js" into a
separate script. As part of that the rules that builds the script
has gained a new dependency on that script.
This refactoring is broken though because we use "$^" to determine
the set of JavaScript files that need to be concatenated, and this
implicit variable now also contains the build script itself. As a
result, the build script ends up ni the generated "gitweb.js" file,
which is wrong.
Fix the issue by explicitly only passing the JavaScript files.
> Signed-off-by: mirabilos <tg@debian.org>
We typically require plain names instead of aliases in the SOB.
> ---
> gitweb/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitweb/Makefile b/gitweb/Makefile
> index d5748e9359..2a8f97cef8 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 $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \
> mv $@+ $@
We could avoid repetition by filtering out any files that we don't care
about, like so:
$(filter %.js,$^)
In any case, thanks for discovering and fixing this issue!
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gitweb.js build mistake
2025-02-28 7:02 ` Patrick Steinhardt
@ 2025-03-27 10:13 ` Patrick Steinhardt
0 siblings, 0 replies; 5+ messages in thread
From: Patrick Steinhardt @ 2025-03-27 10:13 UTC (permalink / raw)
To: Thorsten Glaser; +Cc: git, Johannes Schindelin
On Fri, Feb 28, 2025 at 08:02:16AM +0100, Patrick Steinhardt wrote:
> On Fri, Feb 28, 2025 at 06:34:43AM +0100, Thorsten Glaser wrote:
> > From ed9863971d37ed53628a5871a4a569ccd6287f53 Mon Sep 17 00:00:00 2001
> > From: mirabilos <tg@debian.org>
> > Date: Fri, 28 Feb 2025 05:33:10 +0000
> > Subject: [PATCH] Unbreak content of gitweb.js
> >
> > The former $^ adds all prerequisites, including the
> > (proper) new dependency on the generator script.
>
> The commit message could use a bit of polishing. How about the
> following:
>
> gitweb: fix generation of "gitweb.js"
>
> In 19d8fe7da65 (Makefile: extract script to generate gitweb.js,
> 2024-12-06) we have extracted the logic to build "gitweb.js" into a
> separate script. As part of that the rules that builds the script
> has gained a new dependency on that script.
>
> This refactoring is broken though because we use "$^" to determine
> the set of JavaScript files that need to be concatenated, and this
> implicit variable now also contains the build script itself. As a
> result, the build script ends up ni the generated "gitweb.js" file,
> which is wrong.
>
> Fix the issue by explicitly only passing the JavaScript files.
>
> > Signed-off-by: mirabilos <tg@debian.org>
>
> We typically require plain names instead of aliases in the SOB.
> > ---
> > gitweb/Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gitweb/Makefile b/gitweb/Makefile
> > index d5748e9359..2a8f97cef8 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 $@+ $(addprefix $(MAK_DIR_GITWEB),$(GITWEB_JSLIB_FILES)) && \
> > mv $@+ $@
>
> We could avoid repetition by filtering out any files that we don't care
> about, like so:
>
> $(filter %.js,$^)
>
> In any case, thanks for discovering and fixing this issue!
>
> Patrick
Thorsten, do you plan to send another version of this patch that
includes my feedback? Otherwise I'm happy to bring this over the
finishing line.
Thanks!
Patrick
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-27 10:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 5:34 gitweb.js build mistake Thorsten Glaser
2025-02-28 5:46 ` Simon Richter
2025-02-28 6:34 ` Thorsten Glaser
2025-02-28 7:02 ` Patrick Steinhardt
2025-03-27 10:13 ` Patrick Steinhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox