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

[PATCH v3 02/13] meson: fix OpenSSL fallback when not explicitly required

From
Patrick Steinhardt <ps@pks.im>
Date
Feb 26, 2025, 08:22 UTC
Message-ID
<20250226-b4-pks-meson-improvements-v3-2-60c77cf673ae@pks.im>
In-Reply-To
<20250226-b4-pks-meson-improvements-v3-0-60c77cf673ae@pks.im>

When OpenSSL isn't provided by the system we know to fall back to the subproject wrapper. This is especially helpful on Windows systems, where you typically don't have OpenSSL available, in order to reduce the number of required dependencies.

The fallback is broken though when the OpenSSL backend is set to 'auto' as we end up calling `dependency('openssl', required: false)` in that case, which implicitly disables falling back to the wrapper.

Fix the issue by re-allowing the fallback in case either OpenSSL is required or in case the backend is set to 'auto'. While at it, fix reporting of the backend in case the user asked us to pick no HTTPS backend at all.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 1f83dc58c24..83ed55c75c6 100644
--- a/meson.build
+++ b/meson.build
@@ -1352,7 +1352,11 @@ if https_backend == 'auto' and security_framework.found()
 endif
 
 openssl_required = 'openssl' in [csprng_backend, https_backend, sha1_backend, sha1_unsafe_backend, sha256_backend]
-openssl = dependency('openssl', required: openssl_required, default_options: ['default_library=static'])
+openssl = dependency('openssl',
+  required: openssl_required,
+  allow_fallback: openssl_required or https_backend == 'auto',
+  default_options: ['default_library=static'],
+)
 if https_backend == 'auto' and openssl.found()
   https_backend = 'openssl'
 endif
@@ -1366,6 +1370,7 @@ elif https_backend == 'openssl'
 else
   # We either couldn't find any dependencies with 'auto' or the user requested
   # 'none'. Both cases are benign.
+  https_backend = 'none'
 endif
 
 if https_backend != 'openssl'
-- 
2.48.1.741.g8a9f3a5cdc.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 4 of 14 in “meson: cleanups, improvements, smallish fixes”
  1. 00/13 meson: cleanups, improvements, smallish fixesPatrick Steinhardt, Feb 26, 2025
  2. 01/13 meson: fix exec path with enabled runtime prefixPatrick Steinhardt, Feb 26, 2025
  3. 03/13 meson: inline the static 'git' libraryPatrick Steinhardt, Feb 26, 2025
  4. 02/13 meson: fix OpenSSL fallback when not explicitly requiredPatrick Steinhardt, Feb 26, 2025
  5. 04/13 meson: simplify use of the common-main libraryPatrick Steinhardt, Feb 26, 2025
  6. 05/13 meson: introduce `libgit_curl` dependencyPatrick Steinhardt, Feb 26, 2025
  7. 06/13 meson: stop linking libcurl into all executablesPatrick Steinhardt, Feb 26, 2025
  8. 07/13 meson: drop separate version libraryPatrick Steinhardt, Feb 26, 2025
  9. 08/13 meson: improve PATH handlingPatrick Steinhardt, Feb 26, 2025
  10. 09/13 meson: improve handling of `sane_tool_path` optionPatrick Steinhardt, Feb 26, 2025
  11. 10/13 meson: prevent finding sed(1) in a loopPatrick Steinhardt, Feb 26, 2025
  12. 12/13 meson: consistently use custom program paths to resolve programsPatrick Steinhardt, Feb 26, 2025
  13. 11/13 meson: fix overwritten `git` variablePatrick Steinhardt, Feb 26, 2025
  14. 13/13 gitlab-ci: restrict maximum number of link jobs on WindowsPatrick Steinhardt, Feb 26, 2025

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.