[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
|
Re: [mosquitto-dev] 2.1.0rc1 available for testing
|
Thanks Greg,
I tried building on macOS 26.2 (Tahoe) with Apple Silicon M1, Xcode 26.2, with dependencies installed via homebrew.
Apple clang version 17.0.0 (clang-1700.6.3.2)
Target: arm64-apple-darwin25.2.0
I found similar issues as you did on BSD and I am reluctant to open individual issues yet.
Cheers
Christoph
> - va_list was undefined because stdarg.h was not included. I stuck it
> in libcommon.h, not really the right place, but this needs fixing
> somehow.
same here and your workaround fixes the problem here too.
- I couldn’t get apps/mosquitto_ctrl to compile because Xcode has readline 0x0402 installed
(urrent readline version is 0x0803!) and overriding EDITLINE_DIR wasn’t successful (I am not a cmake expert):
```
[ 26%] Building C object apps/mosquitto_ctrl/CMakeFiles/ctrl_shell.dir/ctrl_shell.c.o
In file included from /Users/ckrey/mosquitto/apps/mosquitto_ctrl/ctrl_shell.c:40:
/Users/ckrey/mosquitto/apps/mosquitto_ctrl/ctrl_shell_internal.h:38:2: error: unknown type name 'rl_vcpfunc_t'
38 | rl_vcpfunc_t *line_callback;
| ^
```
- linking test/lib/c and test/lib/cpp with ssl needs adaptation of the CMakelist.txt files
```
diff --git a/test/lib/c/CMakeLists.txt b/test/lib/c/CMakeLists.txt
index 7b8cdb0f..da9e517b 100644
--- a/test/lib/c/CMakeLists.txt
+++ b/test/lib/c/CMakeLists.txt
@@ -71,5 +71,5 @@ foreach(BINARY ${BINARIES})
target_compile_definitions(${BINARY} PRIVATE TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(${BINARY} PRIVATE ${CMAKE_SOURCE_DIR}/test)
set_property(TARGET ${BINARY} PROPERTY SUFFIX .test)
- target_link_libraries(${BINARY} PRIVATE common-options libmosquitto ssl crypto)
+ target_link_libraries(${BINARY} PRIVATE common-options libmosquitto OpenSSL::SSL)
endforeach()
```
```
diff --git a/test/lib/cpp/CMakeLists.txt b/test/lib/cpp/CMakeLists.txt
index e71ed7ef..d724a551 100644
--- a/test/lib/cpp/CMakeLists.txt
+++ b/test/lib/cpp/CMakeLists.txt
@@ -69,6 +69,6 @@ foreach(BINARY ${BINARIES})
target_compile_definitions(${TARGET} PRIVATE TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR}/test ${CMAKE_SOURCE_DIR}/include)
set_property(TARGET ${TARGET} PROPERTY SUFFIX .test)
- target_link_libraries(${TARGET} PRIVATE common-options mosquittopp ssl crypto)
+ target_link_libraries(${TARGET} PRIVATE common-options mosquittopp OpenSSL::SSL)
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME ${BINARY})
endforeach()
```
- missing includes in test/lib/cpp/03-publish-loop-manual.cpp
```
diff --git a/test/lib/cpp/03-publish-loop-manual.cpp b/test/lib/cpp/03-publish-loop-manual.cpp
index 645ab93f..01db455d 100644
--- a/test/lib/cpp/03-publish-loop-manual.cpp
+++ b/test/lib/cpp/03-publish-loop-manual.cpp
@@ -1,6 +1,8 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <sys/types.h>
+#include <sys/select.h>
#include <mosquitto/libmosquittopp.h>
```
- a few warnings:
```
[ 13%] Building C object src/CMakeFiles/mosquitto.dir/database.c.o
/Users/ckrey/mosquitto/src/database.c:528:27: warning: implicit conversion loses integer precision: 'enum mosquitto_msg_state' to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
528 | client_msg->data.state = (enum mosquitto_msg_state)state;
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/ckrey/mosquitto/src/database.c:677:27: warning: implicit conversion loses integer precision: 'enum mosquitto_msg_state' to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
677 | client_msg->data.state = (enum mosquitto_msg_state)state;
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/ckrey/mosquitto/src/database.c:760:29: warning: implicit conversion loses integer precision: 'enum mosquitto_msg_state' to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
760 | client_msg->data.state = (enum mosquitto_msg_state)state;
| ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
```
```
[ 15%] Building C object src/CMakeFiles/mosquitto.dir/mosquitto.c.o
/Users/ckrey/mosquitto/src/mosquitto.c:210:37: warning: implicit conversion changes signedness: 'gid_t' (aka 'unsigned int') to 'int' [-Wsign-conversion]
210 | if(initgroups(config->user, pwd->pw_gid) == -1){
| ~~~~~~~~~~ ~~~~~^~~~~~
1 warning generated.
```
```
[ 18%] Building C object src/CMakeFiles/mosquitto.dir/plugin_callbacks.c.o
/Users/ckrey/mosquitto/src/plugin_callbacks.c:227:24: warning: implicit conversion changes signedness: 'int' to 'enum mosquitto_plugin_event' [-Wsign-conversion]
227 | own_callback->event = event;
| ~ ^~~~~
/Users/ckrey/mosquitto/src/plugin_callbacks.c:233:20: warning: implicit conversion changes signedness: 'int' to 'enum mosquitto_plugin_event' [-Wsign-conversion]
233 | get_event_name(event));
| ~~~~~~~~~~~~~~ ^~~~~
/Users/ckrey/mosquitto/src/plugin_callbacks.c:240:57: warning: implicit conversion changes signedness: 'int' to 'enum mosquitto_plugin_event' [-Wsign-conversion]
240 | cb_base = plugin__get_callback_base(security_options, event);
| ~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
/Users/ckrey/mosquitto/src/plugin_callbacks.c:264:45: warning: implicit conversion changes signedness: 'int' to 'enum mosquitto_plugin_event' [-Wsign-conversion]
264 | identifier->plugin_name, get_event_name(event));
| ~~~~~~~~~~~~~~ ^~~~~
/Users/ckrey/mosquitto/src/plugin_callbacks.c:267:20: warning: implicit conversion changes signedness: 'int' to 'enum mosquitto_plugin_event' [-Wsign-conversion]
267 | get_event_name(event));
| ~~~~~~~~~~~~~~ ^~~~~
5 warnings generated.
```
```
[ 19%] Building C object src/CMakeFiles/mosquitto.dir/plugin_message.c.o
/Users/ckrey/mosquitto/src/plugin_message.c:47:20: warning: implicit conversion changes signedness: 'enum mosquitto_plugin_event' to 'int' [-Wsign-conversion]
47 | rc = cb_base->cb(ev_type, &event_data, cb_base->userdata);
| ~~~~~~~ ^~~~~~~
1 warning generated.
```
```
[ 23%] Building C object src/CMakeFiles/mosquitto.dir/sys_tree.c.o
/Users/ckrey/mosquitto/src/sys_tree.c:274:50: warning: format specifies type 'unsigned long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
274 | len = (uint32_t)snprintf(buf, BUFLEN, "%lu", metrics[i].current);
| ~~~ ^~~~~~~~~~~~~~~~~~
| %lld
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:119:67: note: expanded from macro 'snprintf'
119 | #define snprintf(str, len, ...) __snprintf_chk_func (str, len, 0, __VA_ARGS__)
| ^~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:76:64: note: expanded from macro '__snprintf_chk_func'
76 | __builtin___snprintf_chk (str, len, flag, __darwin_obsz(str), __VA_ARGS__)
| ^~~~~~~~~~~
1 warning generated.
```
- gmock: I ran into the same problem, but have no idea how to fix this
e.g.:
```
[ 0%] Building CXX object test/mock/CMakeFiles/editline_mock.dir/editline_mock.cpp.o
In file included from /Users/ckrey/mosquitto/test/mock/editline_mock.cpp:1:
/Users/ckrey/mosquitto/test/mock/editline_mock.hpp:3:10: fatal error: 'gmock/gmock.h' file not found
3 | #include <gmock/gmock.h>
| ^~~~~~~~~~~~~~~
1 error generated.
```
- Tests:
```
92% tests passed, 34 tests failed out of 410
Total Test time (real) = 424.33 sec
The following tests FAILED:
1 - ctrl_shell_test_NOT_BUILT (Not Run)
2 - ctrl_shell_broker_test_NOT_BUILT (Not Run)
3 - ctrl_shell_completion_test_NOT_BUILT (Not Run)
4 - ctrl_shell_dynsec_test_NOT_BUILT (Not Run)
5 - ctrl_shell_help_test_NOT_BUILT (Not Run)
6 - ctrl_shell_options_test_NOT_BUILT (Not Run)
7 - ctrl_shell_pre_connect_test_NOT_BUILT (Not Run)
23 - broker-01-bad-initial-packets (Failed)
148 - broker-08-ssl-bridge (Failed)
244 - broker-16-config-huge (Failed)
282 - broker-15-persist-bridge-queue-persist_sqlite (Failed)
283 - broker-15-persist-client-drop-expired-messages-persist_sqlite (Failed)
284 - broker-15-persist-client-expired-session-persist_sqlite (Failed)
285 - broker-15-persist-client-msg-in-v3-1-1-persist_sqlite (Failed)
286 - broker-15-persist-client-msg-in-v5-0-persist_sqlite (Failed)
287 - broker-15-persist-client-msg-modify-acl-persist_sqlite (Failed)
288 - broker-15-persist-client-msg-out-clear-v3-1-1-persist_sqlite (Failed)
289 - broker-15-persist-client-msg-out-dup-v3-1-1-persist_sqlite (Failed)
290 - broker-15-persist-client-msg-out-queue-v3-1-1-persist_sqlite (Failed)
291 - broker-15-persist-client-msg-out-v3-1-1-db-persist_sqlite (Failed)
292 - broker-15-persist-client-msg-out-v3-1-1-persist_sqlite (Failed)
293 - broker-15-persist-client-msg-out-v5-0-persist_sqlite (Failed)
294 - broker-15-persist-client-v3-1-1-persist_sqlite (Failed)
295 - broker-15-persist-client-v5-0-persist_sqlite (Failed)
296 - broker-15-persist-client-will-persist_sqlite (Failed)
297 - broker-15-persist-migrate-db-persist_sqlite (Failed)
298 - broker-15-persist-publish-properties-v5-0-persist_sqlite (Failed)
299 - broker-15-persist-retain-clear-persist_sqlite (Failed)
300 - broker-15-persist-retain-v3-1-1-persist_sqlite (Failed)
301 - broker-15-persist-retain-v5-0-persist_sqlite (Failed)
302 - broker-15-persist-subscription-v3-1-1-persist_sqlite (Failed)
303 - broker-15-persist-subscription-v5-0-persist_sqlite (Failed)
313 - client-02-subscribe-format (Failed)
337 - client-03-publish-tls (Failed)
Errors while running CTest
```
I tried setting up python3 virtual environments with psutil installed via pip, but no success:
```
7 "broker-01-bad-initial-packets" start time: Jan 20 09:10 CET
8 Output:
9 ----------------------------------------------------------
10 Traceback (most recent call last):
11 File "/Users/ckrey/mosquitto/test/broker/01-bad-initial-packets.py", line 6, in <module>
12 import psutil
13 ModuleNotFoundError: No module named 'psutil'
14 <end of output>
15 Test time = 0.06 sec
```
```
"broker-08-ssl-bridge" start time: Jan 21 10:43 CET
Output:
----------------------------------------------------------
1768988627: Warning: Bridge 'bridge_test' using insecure mode.
1768988627: Info: running mosquitto as user: ckrey.
1768988627: mosquitto version 2.1.0 starting
1768988627: Config loaded from 08-ssl-bridge.conf.
1768988627: Bridge support available.
1768988627: Persistence support available.
1768988627: TLS support available.
1768988627: TLS-PSK support available.
1768988627: Websockets support available.
1768988627: Opening ipv6 listen socket on port 1889.
1768988627: Opening ipv4 listen socket on port 1889.
1768988627: Bridge local.MacBookPro.fritz.box.bridge_test doing local SUBSCRIBE on topic bridge/#
1768988627: Connecting bridge bridge_test (127.0.0.2:1888)
1768988627: Bridge MacBookPro.fritz.box.bridge_test sending CONNECT
1768988627: mosquitto version 2.1.0 running
1768988627: New connection from ::1:65224 on port 1889.
1768988627: Client ::1 closed its connection.
1768988647: mosquitto version 2.1.0 terminating
<end of output>
Test time = 20.40 sec
```
```
"broker-16-config-huge" start time: Jan 21 10:45 CET
Output:
----------------------------------------------------------
FAIL: unable to start broker: b"1768988706: The 'per_listener_settings' option is now deprecated and will be removed in version 3.0. Please see the documentation for how to achieve the same effect.\n1
```
```
"client-02-subscribe-format" start time: Jan 21 10:26 CET
Output:
----------------------------------------------------------
expected: (6) 2.718
actual: (0)
```
All the sqlite test cases fail with similar error messages:
```
"broker-15-persist-bridge-queue-persist_sqlite" start time: Jan 21 10:45 CET
Output:
----------------------------------------------------------
FAIL: unable to start broker: b'1768988721: Info: running mosquitto as user: ckrey.\n1768988721: mosquitto version 2.1.0 starting\n1768988721: Config loaded from 15-persist-bridge-queue_bridge_target.conf.
Traceback (most recent call last):
File "/Users/ckrey/mosquitto/test/broker/15-persist-bridge-queue.py", line 80, in do_test
bridge_target_broker = mosq_test.start_broker(
filename=conf_file_bridge_target, use_conf=True, port=bridge_target_port
)
File "/Users/ckrey/mosquitto/test/mosq_test.py", line 143, in start_broker
raise IOError
OSError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/ckrey/mosquitto/test/broker/15-persist-bridge-queue.py", line 282, in <module>
do_test(
~~~~~~~^
"memory queue out bridge",
^^^^^^^^^^^^^^^^^^^^^^^^^^
bridging_add_config=memory_queue_config | out_bridge_config,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
target_add_config={},
^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/ckrey/mosquitto/test/broker/15-persist-bridge-queue.py", line 236, in do_test
if bridge_target_broker is not None:
^^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'bridge_target_broker' where it is not associated with a value
<end of output>
Test time = 2.21 sec
```
```
"client-03-publish-tls" start time: Jan 21 10:27 CET
Output:
----------------------------------------------------------
timed out
Traceback (most recent call last):
File "/Users/ckrey/mosquitto/test/client/03-publish-tls.py", line 85, in <module>
do_test("127.0.0.2", None, True)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ckrey/mosquitto/test/client/03-publish-tls.py", line 80, in do_test
print(stde.decode('utf-8'))
^^^^
UnboundLocalError: cannot access local variable 'stde' where it is not associated with a value
<end of output>
Test time = 20.52 sec
```