fdcavalcanti opened a new pull request, #3444:
URL: https://github.com/apache/nuttx-apps/pull/3444
## Summary
<!-- This field should contain a summary of the changes. It will be
pre-filled with the commit's message and descriptions. Adjust it accordingly -->
* crypto/mbedtls: expose include paths as public
Expose include paths as public when using CMake.
* netutils/mqttc: fix patch and add mbedtls dependency
Add mbedtls dependecy and fix patch path.
Apps mbedtls no longer appends its include directories to the global nuttx
target (NUTTX_INCLUDE_DIRECTORIES / NUTTX_CXX_INCLUDE_DIRECTORIES). That global
injection caused arch/vendor code (e.g. Espressif tf-psa-crypto) to pick up
headers from `nuttx-apps/crypto/mbedtls/mbedtls/include`, which mixed two
incompatible Mbed TLS trees and led to PSA/config include errors.
The post-FetchContent patch step used `$(MQTTC_DIR)` inside `sh -c`, which
the shell treats as command substitution, not a CMake path. Replaced with a
direct `patch -d ${MQTTC_DIR} -p1 -i` … invocation.
With mbedtls includes no longer global, MQTT-C with mbedtls wires
`nuttx_add_dependencies(TARGET mqttc DEPENDS mbedtls)` when both
`CONFIG_NETUTILS_MQTTC_WITH_MBEDTLS` and `CONFIG_CRYPTO_MBEDTLS` are set, and
`mqttc_mbedtls_pub` lists mbedtls in DEPENDS so the example compiles against
the same headers as the library.
This fixes build issues for Espressif devices whenever mbedtls was added
(affecting CMake support only).
## Impact
<!-- Please fill the following sections with YES/NO and provide a brief
explanation -->
Impact on user: No.
<!-- Does it impact user's applications? How? -->
Impact on build: Make builds are unaffected.
Anything that included `<mbedtls/...>` only because of those global
includes, and does not get headers via:
- DEPENDS mbedtls / nuttx_add_dependencies(… mbedtls), or
- its own INCLUDE_DIRECTORIES / target_include_directories,
could fail to compile until it gains an explicit dependency or include path.
That is not vendor-specific; it depends on how each app’s CMakeLists.txt was
written.
<!-- Does it impact on building NuttX? How? (please describe the required
changes on the build system) -->
Impact on hardware: No.
<!-- Does it impact a specific hardware supported by NuttX? -->
Impact on documentation: No.
<!-- Does it impact the existing documentation? Please provide additional
documentation to reflect that -->
Impact on security: No.
<!-- Does it impact NuttX's security? -->
Impact on compatibility: No.
<!-- Does it impact compatibility between previous and current versions? Is
this a breaking change? -->
## Testing
<!-- Please provide all the testing procedure. Consider that upstream
reviewers should be able to reproduce the same testing performed internally -->
### Building
CMake build for `esp32c3-devkit:wifi`.
Append the following:
```
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ASSERTIONS_EXPRESSION=y
CONFIG_DEBUG_FEATURES=y
CONFIG_CRYPTO_MBEDTLS=y
CONFIG_MBEDTLS_APPS=y
CONFIG_MBEDTLS_APP_BENCHMARK=y
CONFIG_MBEDTLS_APP_SELFTEST=y
CONFIG_MBEDTLS_SELF_TEST=y
CONFIG_MBEDTLS_VERSION="3.6.2"
CONFIG_NETUTILS_MQTTC=y
CONFIG_NETUTILS_MQTTC_EXAMPLE=y
CONFIG_NETUTILS_MQTTC_WITH_MBEDTLS=y
CONFIG_NETUTILS_MQTTC_VERSION="1.1.5"
CONFIG_DEV_URANDOM=y
```
### Results
CMake build would fail for this scenario, but works after the changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]