slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.47k stars 598 forks source link

Re-enable Node.js tests on Windows #6046

Closed tronical closed 1 month ago

tronical commented 1 month ago

The Node.js tests crash on Windows in the CI:

The last message is

fatal runtime error: thread::set_current should only be called once per thread

and then the process exits with STATUS_STACK_BUFFER_OVERRUN.

ogoffart commented 1 month ago

Example of failling log: https://github.com/slint-ui/slint/actions/runs/10738141941/job/29781117650

     Running `D:\a\slint\slint\target\debug\deps\slint_node-7aeec879bd005138.exe`
Load Node-API [napi_get_last_error_info] from host runtime failed: GetProcAddress failed
Load Node-API [napi_get_undefined] from host runtime failed: GetProcAddress failed
Load Node-API [napi_get_null] from host runtime failed: GetProcAddress failed
Load Node-API [napi_get_global] from host runtime failed: GetProcAddress failed
Load Node-API [napi_get_boolean] from host runtime failed: GetProcAddress failed
Load Node-API [napi_create_object] from host runtime failed: GetProcAddress failed
...
 Load Node-API [napi_object_freeze] from host runtime failed: GetProcAddress failed
Load Node-API [napi_object_seal] from host runtime failed: GetProcAddress failed
fatal runtime error: thread::set_current should only be called once per thread
error: test failed, to rerun pass `-p slint-node --lib`

Caused by:
  process didn't exit successfully: `D:\a\slint\slint\target\debug\deps\slint_node-7aeec879bd005138.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

An example of passing test: https://github.com/slint-ui/slint/actions/runs/10704659755/job/29678201937 Note that it does contain all the from host runtime failed: GetProcAddress failed so that's probably not the problem. It doesn't contain the error about thread::set_current but that might be because the error was filtered as the test framework filter stderr. The STATUS_STACK_BUFFER_OVERRUN may simply mean that this is a stack overflow for example if our datastructures were too big.

Note that a difference between the passing test and the failing test is also the rust version (rustc 1.80.1 vs 1.81.0) So this could have been related with the rust version update

tronical commented 1 month ago

Great point about the rust version. I'll try that in the CI.

tronical commented 1 month ago

I see it's a debug build, so that also doesn't help with stack usage. But at least we can solve that :).