On Mon, Oct 14, 2024 at 06:06:53PM -0400, Taylor Blau wrote: > On Mon, Oct 14, 2024 at 02:21:18PM +0200, Patrick Steinhardt wrote: > > When testing gitweb we set up the CGI script as "gitweb.perl", which is > > the source file of the build target "gitweb.cgi". This works alright as > > long as we run in-tree tests. But we're about to make out-of-tree tests > > a reality, and there things will break because "gitweb.perl" will not be > > found in the build directory. > > > > Fix this by using "gitweb.cgi" instead. > > > > Signed-off-by: Patrick Steinhardt <ps@xxxxxx> > > --- > > t/lib-gitweb.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh > > index 1f32ca66ea5..c64c87fb87d 100644 > > --- a/t/lib-gitweb.sh > > +++ b/t/lib-gitweb.sh > > @@ -49,7 +49,7 @@ EOF > > error "Cannot find gitweb at $GITWEB_TEST_INSTALLED." > > say "# Testing $SCRIPT_NAME" > > else # normal case, use source version of gitweb > > - SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl" > > + SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.cgi" > > This one I am a bit confused above. Could the same thing not be > accomplished with the '$GITWEB_TEST_INSTALLED' variable above? > > If not, why not? And likewise, I believe the "source version" part of > this comment would need an update. In theory we can, but it goes against the spirit of its intent. We do not want to test against an installed version, we want to test against the built version. And the built version is not "gitweb.perl", which still has the wrong shebang and replacement markers inside, but it is "gitweb.cgi". This used to work because with our Makefile, "gitweb.cgi" and "gitweb.perl" live next to each other in the same directory. But as soon as "$GIT_BUILD_DIR" points somewhere else that is not the source tree, it fails because we cannot find "gitweb.perl" anymore. Now this change here means that you cannot test gitweb without building Git first anymore. But I doubt that really worked in practice anyway, and I also doubt that this is something we want to cater towards in the first place. I'll update the commit message accordinly. Patrick