skypjack / uvw

Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
MIT License
1.82k stars 207 forks source link

uvw_fs_event and uvw_loop fail on Darwin PPC #286

Closed barracuda156 closed 1 year ago

barracuda156 commented 1 year ago
Running tests...
Test project /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/build
      Start  1: uvw_main
 1/27 Test  #1: uvw_main .........................   Passed    0.02 sec
      Start  2: uvw_async
 2/27 Test  #2: uvw_async ........................   Passed    0.02 sec
      Start  3: uvw_check
 3/27 Test  #3: uvw_check ........................   Passed    0.02 sec
      Start  4: uvw_emitter
 4/27 Test  #4: uvw_emitter ......................   Passed    0.02 sec
      Start  5: uvw_file_req
 5/27 Test  #5: uvw_file_req .....................   Passed    0.04 sec
      Start  6: uvw_fs_event
^C 6/27 Test  #6: uvw_fs_event .....................***Exception: Interrupt327.42 sec
      Start  7: uvw_fs_req
 7/27 Test  #7: uvw_fs_req .......................   Passed    0.06 sec
      Start  8: uvw_handle
 8/27 Test  #8: uvw_handle .......................   Passed    0.02 sec
      Start  9: uvw_idle
 9/27 Test  #9: uvw_idle .........................   Passed    0.02 sec
      Start 10: uvw_lib
10/27 Test #10: uvw_lib ..........................   Passed    0.02 sec
      Start 11: uvw_loop
11/27 Test #11: uvw_loop .........................***Failed    0.02 sec
      Start 12: uvw_pipe
12/27 Test #12: uvw_pipe .........................   Passed    0.02 sec
      Start 13: uvw_prepare
13/27 Test #13: uvw_prepare ......................   Passed    0.02 sec
      Start 14: uvw_process
14/27 Test #14: uvw_process ......................   Passed    0.02 sec
      Start 15: uvw_request
15/27 Test #15: uvw_request ......................   Passed    0.02 sec
      Start 16: uvw_resource
16/27 Test #16: uvw_resource .....................   Passed    0.02 sec
      Start 17: uvw_signal
17/27 Test #17: uvw_signal .......................   Passed    0.02 sec
      Start 18: uvw_stream
18/27 Test #18: uvw_stream .......................   Passed    0.01 sec
      Start 19: uvw_tcp
19/27 Test #19: uvw_tcp ..........................   Passed    0.02 sec
      Start 20: uvw_thread
20/27 Test #20: uvw_thread .......................   Passed    0.02 sec
      Start 21: uvw_timer
21/27 Test #21: uvw_timer ........................   Passed    0.12 sec
      Start 22: uvw_tty
22/27 Test #22: uvw_tty ..........................   Passed    0.02 sec
      Start 23: uvw_udp
23/27 Test #23: uvw_udp ..........................   Passed    0.02 sec
      Start 24: uvw_uv_type
24/27 Test #24: uvw_uv_type ......................   Passed    0.01 sec
      Start 25: uvw_util
25/27 Test #25: uvw_util .........................   Passed    0.08 sec
      Start 26: uvw_work
26/27 Test #26: uvw_work .........................   Passed    0.52 sec
      Start 27: uvw_file_req_sendfile
27/27 Test #27: uvw_file_req_sendfile ............   Passed    0.02 sec

93% tests passed, 2 tests failed out of 27

Total Test time (real) = 328.61 sec

The following tests FAILED:
      6 - uvw_fs_event (INTERRUPT)
     11 - uvw_loop (Failed)
6/27 Testing: uvw_fs_event
6/27 Test: uvw_fs_event
Command: "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/build/test/fs_event"
Directory: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/build/test
"uvw_fs_event" start time: May 24 22:51 CST
Output:
----------------------------------------------------------
Running main() from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/build/_deps/googletest-src/googletest/src/gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FsEvent
[ RUN      ] FsEvent.Functionalities
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/uvw-3.0.0/test/uvw/fs_event.cpp:19: Failure
Expected equality of these values:
  std::string{event.filename}
    Which is: "fs_event_data"
  std::string{"test.file"}
    Which is: "test.file"

<end of output>
Test time = 327.42 sec
----------------------------------------------------------
Test Failed.
"uvw_fs_event" end time: May 24 22:56 CST
"uvw_fs_event" time elapsed: 00:05:27

[ RUN      ] Loop.Walk
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_uvw/uvw/work/uvw-3.0.0/test/uvw/loop.cpp:88: Failure
Expected equality of these values:
  count
    Which is: 11
  12u
    Which is: 12

[  FAILED  ] Loop.Walk (0 ms)
[ RUN      ] Loop.UserData
[       OK ] Loop.UserData (0 ms)
[ RUN      ] Loop.Configure
[       OK ] Loop.Configure (0 ms)
[ RUN      ] Loop.IdleTime
[       OK ] Loop.IdleTime (0 ms)
[ RUN      ] Loop.Raw
[       OK ] Loop.Raw (0 ms)
[----------] 7 tests from Loop (2 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 1 test suite ran. (2 ms total)
[  PASSED  ] 6 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Loop.Walk

 1 FAILED TEST
<end of output>
Test time =   0.02 sec
----------------------------------------------------------
Test Failed.
"uvw_loop" end time: May 24 22:56 CST
"uvw_loop" time elapsed: 00:00:00
skypjack commented 1 year ago

Yeah, this is kinda expected. uvw doesn't add new functionalities on top of libuv. Instead, it wraps and it tests its own let's say forwarding functions. We're probably doing something that only works on Windows and Linux (as expected on the libuv side), that is, our CI platforms. You can either ignore these errors or submit a fix. I can't really try it on Darwin PPC, so I can't fix it either. 🤷‍♂️

barracuda156 commented 1 year ago

@skypjack Thank you. Do you have an idea what may cause these particular failures? Generally speaking, we got 3 typical sources of problems:

  1. Endianness ignored (LE assumed).
  2. 64-bitness is assumed.
  3. Code uses macOS-only features unavailable in older SDKs.

The latter problem may or may not be fixable (i.e. efforts involved may demotivate anyone to bother with a fix). The former two should be fixable, and can be tested on Linux or BSD – they are not macOS-specific.

skypjack commented 1 year ago

It's likely something that isn't allowed/doesn't work in libuv for the specific platform. Consider that I also have ther error in the loop test locally on a Windows machine. From what I see, one of the handles isn't returned by a call to uv_walk for some reasons. In theory, one could just drop these test and only check that everything compiles as expected. Technically speaking, we don't really need to test libuv on our own and these functions are just fowrarding the request to the underlying library.

skypjack commented 1 year ago

Closing this due to starvation.

barracuda156 commented 1 year ago

@skypjack Sorry, had no chance to return to this. I may soon, since we got an update with Macports libs which could be relevant.