git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eli Schwartz <eschwartz93@gmail.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>,
	Patrick Steinhardt <ps@pks.im>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: Modernize the build system v2 problem
Date: Mon, 14 Oct 2024 15:19:31 -0400	[thread overview]
Message-ID: <cd118725-f820-494c-8d10-81aba32e4064@gmail.com> (raw)
In-Reply-To: <28e13e74-d4a4-4be5-8555-27a69c5c5787@ramsayjones.plus.com>


[-- Attachment #1.1: Type: text/plain, Size: 3865 bytes --]

On 10/14/24 12:59 PM, Ramsay Jones wrote:
> Everything seemed to go without a hitch after that, as far as the build is
> concerned, but when I did a 'ninja test' I ended up with three failures:
> 
>   Summary of Failures:
>   
>    979/1028 t9500-gitweb-standalone-no-errors              FAIL           12.36s   exit status 1
>    980/1028 t9501-gitweb-standalone-http-status            FAIL            2.19s   exit status 1
>    981/1028 t9502-gitweb-standalone-parse-output           FAIL            2.22s   exit status 1
>   
>   Ok:                 1025
>   Expected Fail:      0   
>   Fail:               3   
>   Unexpected Pass:    0   
>   Skipped:            0   
>   Timeout:            0   
>   
>   Full log written to /home/ramsay/git/build/meson-logs/testlog.txt
>   FAILED: meson-internal__test 
>   /usr/bin/meson test --no-rebuild --print-errorlogs
>   ninja: build stopped: subcommand failed.
> 
> The failure is caused by an (apparently) mangled 'gitweb.cgi' file. Since I
> still had the make build file, I could directly compare the files:
> 
>   $ diff ../gitweb/gitweb.cgi gitweb/gitweb.cgi | wc -l
>   160
>   $ 
> 
> I won't bore you with the whole diff, but it begins like so:
> 
>   $ diff ../gitweb/gitweb.cgi gitweb/gitweb.cgi
>   83c83
>   < our $GIT = "/home/ramsay/bin/git";
>   ---
>   > our $GIT = "/usr/local/bin/git";
>   91c91
>   < our $project_maxdepth = 2007;
>   ---
>   > our $project_maxdepth = "2007";
>   2497c2497
>   < 		{ regexp => qr/^\@\@{$num_sign} /, class => "chunk_header"},
>   ---
>   > 		{ regexp => qr/^@@{$num_sign} /, class => "chunk_header"},
>   2521c2521
>   < 		$line =~ m/^\@{2} (-(\d+)(?:,(\d+))?) (\+(\d+)(?:,(\d+))?) \@{2}(.*)$/;
>   ---
>   > 		$line =~ m/^@{2} (-(\d+)(?:,(\d+))?) (\+(\d+)(?:,(\d+))?) @{2}(.*)$/;
> 
>   ...
> 
>   $ 
> 
> Note that, after the 'template variables' have been substituted, many (all?)
> character pairs \@ are replaced with @ (ie the backslashes have gone walkabout).
> This results in compilation errors in the 'gitweb.log' file, for example the
> log file for the t9500-*.sh test, looks like:
> 
>   $ cat gitweb.log
>   [Mon Oct 14 15:12:33 2024] gitweb.cgi: Possible unintended interpolation of @2 in string at /home/ramsay/git/build/gitweb/gitweb.cgi line 2521.
>   [Mon Oct 14 15:12:33 2024] gitweb.cgi: Possible unintended interpolation of @3 in string at /home/ramsay/git/build/gitweb/gitweb.cgi line 2593.
>   [Mon Oct 14 15:12:33 2024] gitweb.cgi: Possible unintended interpolation of @vrfy in string at /home/ramsay/git/build/gitweb/gitweb.cgi line 4212.
>   [Mon Oct 14 15:12:33 2024] gitweb.cgi: Global symbol "@vrfy" requires explicit package name (did you forget to declare "my @vrfy"?) at /home/ramsay/git/build/gitweb/gitweb.cgi line 4212.
>   [Mon Oct 14 15:12:33 2024] gitweb.cgi: Execution of /home/ramsay/git/build/gitweb/gitweb.cgi aborted due to compilation errors.
>   $ 
>  
> So, keeping in mind that I know absolutely nothing about meson, it seems that
> the 'configure_file' function is mangling the 'gitweb.perl' file. I assume
> that you are not seeing this, so I suspect that you are using a newer (fixed)
> version than me. :(
> 
>   $ meson --version
>   1.3.2
>   $ ninja --version
>   1.11.1
>   $ 


I recognize this: https://github.com/mesonbuild/meson/pull/13302

Note that for files which can change semi-regularly as part of
development it may be better to avoid configure_file() and create
something like edit-files.sh.in which then produces build rules, not
configure-time changes. This would sidestep the problem entirely as
you'd then process gitweb.cgi via e.g. a sed script.

(The main reason though is because it avoids reconfiguring meson when
the gitweb.cgi script is modified via a patch / git pull.)


-- 
Eli Schwartz

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

  parent reply	other threads:[~2024-10-14 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 16:59 Modernize the build system v2 problem Ramsay Jones
2024-10-14 17:42 ` Patrick Steinhardt
2024-10-14 19:19 ` Eli Schwartz [this message]
2024-10-14 20:18   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd118725-f820-494c-8d10-81aba32e4064@gmail.com \
    --to=eschwartz93@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).