Skip to content

cmake: Require MbedTLS 3 and exclude 4 or later - #13799

Open
tytan652 wants to merge 1 commit into
obsproject:masterfrom
tytan652:mbedtls4_not_supported_for_now
Open

cmake: Require MbedTLS 3 and exclude 4 or later#13799
tytan652 wants to merge 1 commit into
obsproject:masterfrom
tytan652:mbedtls4_not_supported_for_now

Conversation

@tytan652

@tytan652 tytan652 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Description

Until the codebase is updated to support it, CMake will explicitly search for version 3 that is supported by the codebase.

Motivation and Context

Our codebase does not support it and fails to build with it, this change is for until proper support is implement.

Related #13601

How Has This Been Tested?

CMake still find MbedTLS 3

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@tytan652
tytan652 requested a review from PatTheMav August 17, 2026 16:36
@tytan652 tytan652 added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label Aug 17, 2026

@PatTheMav PatTheMav left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine in general, though I do wonder where we need to support MbedTLS v2.x still?

@tytan652

Copy link
Copy Markdown
Collaborator Author

I wanted the scope of this PR to be low (forbid 4) and MbedTLS 2 code was not removed so far so I just aligned the version range with what our codebase seems to allow.

If desired I can bump the lower requirement to 3 but I think stripping MbedTLS 2 (and also maybe 3.0.0) support is for another PR.

@PatTheMav

Copy link
Copy Markdown
Member

I wanted the scope of this PR to be low (forbid 4) and MbedTLS 2 code was not removed so far so I just aligned the version range with what our codebase seems to allow.

If desired I can bump the lower requirement to 3 but I think stripping MbedTLS 2 (and also maybe 3.0.0) support is for another PR.

Sounds good to me.

@PatTheMav

Copy link
Copy Markdown
Member

Building on Windows seems to fail for no obvious reason (the project finds MbedTLS 3.6.4 and uses it just fine it seems, but then stumbles over a missing symbol), while macOS reports the following warning during configuration:

    CMake Warning (author) at /opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:502 (message):
      find_package() specify a version range but the module MbedTLS does not
      support this capability.  Only the lower endpoint of the range will be
      used.
    Call Stack (most recent call first):
      cmake/finders/FindMbedTLS.cmake:200 (find_package_handle_standard_args)
      plugins/obs-outputs/CMakeLists.txt:4 (find_package)
    This warning is for project developers.  Use -Wno-author to suppress it.

So the higher endpoint should be used by any MbedTLS dependency that uses the CMake package files (as those won't use our custom finder), and it's an issue with obs-deps that the macOS package's MbedTLS has its CMake package files deleted (there's an open PR to fix this).

So once that PR is merged, MbedTLS on macOS should be found using that rather than the custom finder (since MbedTLS 3.6+'s CMake package files work correctly) and that warning is fixed by itself.


So if no CMake package is found and the find module used instead, the change in this PR will be ineffective per that warning. I don't see a need to update the find module to support this functionality and instead remove it entirely in a PR that also removes support for MbedTLS v2.

@tytan652

tytan652 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator Author

Building on Windows seems to fail for no obvious reason (the project finds MbedTLS 3.6.4 and uses it just fine it seems

ARM64 runner can do weird things sometimes so at least a re-run should be done to ensure it's on the changes.

Edit: Windows runner is also picking the custom finder… CMake priorities…

@tytan652
tytan652 force-pushed the mbedtls4_not_supported_for_now branch from 115be05 to e7d12f0 Compare August 18, 2026 14:21
@sangoku116

Copy link
Copy Markdown

Your commit allowed me to build the package on arch. Thank you, worked well!

@PatTheMav

Copy link
Copy Markdown
Member

Building on Windows seems to fail for no obvious reason (the project finds MbedTLS 3.6.4 and uses it just fine it seems

ARM64 runner can do weird things sometimes so at least a re-run should be done to ensure it's on the changes.

Edit: Windows runner is also picking the custom finder… CMake priorities…

That's what the line set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) explicitly is supposed to handle, making CMake prefer the package config over the find module if available.

And if you look at the CMake output of the nightly build, there is no Found MbedTLS line or similar for Windows, because CMake only prints this line for find modules.

So somehow your changes break this behaviour and the find module is used again.

Until the codebase is updated to support it, CMake will explicitly search
for version 3 that is supported by the codebase.
@tytan652
tytan652 force-pushed the mbedtls4_not_supported_for_now branch from baec9af to d073adb Compare August 19, 2026 14:50
@tytan652 tytan652 changed the title cmake: Forbid MbedTLS 4 or later @tytan652 cmake: Require MbedTLS 3 and exclude 4 or later Aug 19, 2026
@tytan652 tytan652 changed the title @tytan652 cmake: Require MbedTLS 3 and exclude 4 or later cmake: Require MbedTLS 3 and exclude 4 or later Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants