unix: enable optional system MbedTLS UNIX port #18395
Open
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added optional support for mbedTLS that can be taken by passing arguments
Fixes issue: #18319
Summary
MicroPython’s UNIX port by default uses a bundled lib/mbedtls submodule.
This causes issues if the submodule is missing or you prefer the system-installed MbedTLS.
MICROPY_USE_SYSTEM_MBEDTLS=1 tells the Makefile to use the system-installed MbedTLS
Benefits:
Testing
Need to export the value before :

Signals to the ports/unix/Makefile that you want to link against the system-installed MbedTLS rather than the bundled lib/mbedtls submodule.
It’s a clean way to make the build optional — you can turn it off just by not exporting it.
Why it’s needed:
MicroPython’s UNIX port by default expects the bundled lib/mbedtls.
If you want to avoid downloading or maintaining the submodule, this variable instructs the Makefile to skip it.
Trade-offs and Alternatives
Note:

Ensure you have the necessary packages: