git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] meson: enable auto-discovered "gitweb"

From
Patrick Steinhardt <ps@pks.im>
Date
Dec 27, 2024, 12:10 UTC
Message-ID
<20241227-b4-pks-meson-wo-gitweb-v1-3-14ca8515bb3b@pks.im>
In-Reply-To
<20241227-b4-pks-meson-wo-gitweb-v1-0-14ca8515bb3b@pks.im>

In 7d549fe317 (meson: skip gitweb build when Perl is disabled, 2024-12-20) we have started to conditionally enable "gitweb" based on whether or not Perl is enabled. By accident though that change causes us to not build gitweb in case its feature flag is set to "auto" even if autoconfiguration determines that it could be built. This is because we use "gitweb_option.enabled()", which only checks whether the feature has been explicitly enabled.

Fix the issue by using `gitweb_option.allowed()` instead, which returns true in case it is either explicitly enabled or set to "auto". This also works for the case where the feature becomes auto-disabled due to Perl not being present because we use `disable_auto_if(not perl.found())`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 3e57793862e5fc15685b5f0fac7f7223af7bef1f..0064eb64f546a6349a8694ce251bd352febda6fe 100644
--- a/meson.build
+++ b/meson.build
@@ -1863,7 +1863,7 @@ subdir('contrib')
 # 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())
-if gitweb_option.enabled()
+if gitweb_option.allowed()
   subdir('gitweb')
   build_options_config.set('NO_GITWEB', '')
 else
@@ -1916,7 +1916,7 @@ summary({
   'curl': curl.found(),
   'expat': expat.found(),
   'gettext': intl.found(),
-  'gitweb': gitweb_option.enabled(),
+  'gitweb': gitweb_option.allowed(),
   'https': https_backend,
   'iconv': iconv.found(),
   'pcre2': pcre2.found(),
-- 
2.48.0.rc0.311.gb6c66824c1.dirty
Previous: Patrick Steinhardt
Message 4 of 4 in “t: fix tests with NO_GITWEB=YesPlease”
  1. 0/3 t: fix tests with NO_GITWEB=YesPleasePatrick Steinhardt, Dec 27, 2024
  2. 2/3 GIT-BUILD-OPTIONS: wire up NO_GITWEB optionPatrick Steinhardt, Dec 27, 2024
  3. 1/3 GIT-BUILD-OPTIONS: sort variables alphabeticallyPatrick Steinhardt, Dec 27, 2024
  4. 3/3 meson: enable auto-discovered "gitweb"Patrick Steinhardt, Dec 27, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.