git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Daniel Engberg <daniel.engberg.lists@pyret.net>
Subject: Re: [PATCH] meson: skip gitweb build when Perl is disabled
Date: Fri, 20 Dec 2024 16:18:01 +0100	[thread overview]
Message-ID: <Z2WKnAh2BVWr063E@pks.im> (raw)
In-Reply-To: <xmqq4j2ygzwk.fsf@gitster.g>

On Fri, Dec 20, 2024 at 07:03:23AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> > -if get_option('tests')
> > +if get_option('tests') or get_option('gitweb').enabled()
> >    perl_required = true
> >  endif
> 
> OK, so we use "perl_required" to keep track of the fact that
> something else wants Perl to be usable.
> 
> > +# Gitweb requires Perl, so we disable the auto-feature if Perl was not found.
> > +# We make sure further up that Perl is required in case the gitweb option is
> > +# enabled.
> > +gitweb_option = get_option('gitweb').disable_auto_if(not perl.found())
> 
> Hopefully before we reach this point, we would have figured out if
> perl is avialable, to allow us do this.

Yup.

> There seem to be too many "perl" related variables, interaction
> among which smells way too complex for their worth.  For example,
> 
>     perl = find_program('perl', ..., required: perl_required);
>     perl_features_enabled = perl.found() and get_option('perl').allowed()
> 
> and only when the latter is true, we'd do further configuration to
> make perl usable.  Does that mean the condition you wrote above to
> automatically disable gitweb somewhat incorrect?  Even if we may
> have found perl, the builder may deliberately have disallowed use of
> it, in which case we just know perl is there without figuring out
> what other things (like where the localedir is) that are needed to
> use it correctly.

I don't think it's incorrect. The Perl features are those that the Git
distribution itself uses, including all the Perl modules in "perl/". The
gitweb subsystem, as far as I can see, uses none of those functions and
thus the data we configure in case `perl_features_enabled` is true is
irrelevant for gitweb.

Now I don't disagree with your statement that there are too many
Perl-related variables, but it simply reflects the fact that Git uses it
for multiple different things: testing, git-instaweb, the Perl library,
several Perl-based commands and gitweb. And I think it's not entirely
unreasonable to let users configure these independently of one another,
and that brings some complexity with it.

That being said I'd also be okay to not introduce the separate "gitweb"
option and instead just use the existing "perl" option for it. I don't
mind it all that much.

> > +option('gitweb', type: 'feature', value: 'auto',
> > +  description: 'Build Git web interface. Required Perl.')
> 
> I do not know the convention in the meson world, but to me, this
> would sound more natural with "Required" -> "Requires".

Oh, yes, indeed. I'll wait a bit for your opinion on the above before
sending a simple typo fix for this.

Patrick

  reply	other threads:[~2024-12-20 15:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20  7:26 [PATCH] meson: skip gitweb build when Perl is disabled Patrick Steinhardt
2024-12-20 15:03 ` Junio C Hamano
2024-12-20 15:18   ` Patrick Steinhardt [this message]
2024-12-20 15:50     ` Junio C Hamano
2024-12-20 16:30 ` [PATCH v2] " Patrick Steinhardt

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=Z2WKnAh2BVWr063E@pks.im \
    --to=ps@pks.im \
    --cc=daniel.engberg.lists@pyret.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).