golioth / golioth-firmware-sdk

Firmware SDK enabling any IoT device to connect to Golioth - the Universal Connector for IoT
https://golioth.io
Apache License 2.0
53 stars 11 forks source link

esp_idf: build warnings about missing mutex stubs #78

Closed mniestroj closed 1 year ago

mniestroj commented 1 year ago

Golioth Firmware SDK Commit Hash

ec34837aad01b55ba6f961291bbd96d841956eee

Platform/OS

ESP-EDF v5.0

Hardware Target

ESP32

What host OS are you using?

No response

Current Behavior

There are plenty of:

In file included from /app/golioth/golioth-firmware-sdk/external/libcoap/include/coap3/coap_internal.h:63,
                 from /app/golioth/golioth-firmware-sdk/external/libcoap/src/coap_subscribe.c:17:
/app/golioth/golioth-firmware-sdk/external/libcoap/include/coap3/coap_mutex.h:71:2: warning: #warning "stub mutex functions" [-Wcpp]
   71 | #warning "stub mutex functions"
      |  ^~~~~~~

warnings during project build.

Expected Behavior

No build warnings.

Steps To Reproduce

  1. Just check GitHub Actions for tip of main, where these warnings appear.

Logs, console output, or any kind of debug information

No response

ncmiller commented 1 year ago

Thanks for flagging.

This happens on other platforms too (e.g. ModusToolbox). It has to do with the way we've ported libcoap, and the mutex abstraction in libcoap.

I spent a small amount of time trying to resolve this a couple of months ago, but didn't find a clean way to do it. I believe the fix will involve making upstream changes in libcoap.

In the near-term, the warning is not a big concern, because every call into libcoap is done from a single thread, so mutexes are not required. But we should still definitely fix it.