-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation with Emscripten #52
Conversation
Thanks for the MR. Would you mind adding an emscripten workflow to this file, taking as an example e.g. the gcc_canary workflow? Also, I think this action will be of use to help setup emscripten. |
Codecov Report
@@ Coverage Diff @@
## master #52 +/- ##
==========================================
+ Coverage 92.51% 92.67% +0.16%
==========================================
Files 50 50
Lines 9825 9781 -44
==========================================
- Hits 9090 9065 -25
+ Misses 735 716 -19
Continue to review full report at Codecov.
|
Sure! I have set it up for other projects of mine, I'll have a look at how to integrate this into your CI workflow. |
Thanks. If the current approach with its shell script stands in the way, feel free to do it the same way you did before. For example, this may be easier: .github/workflows/test_install.yml, as it uses cmake directly |
Ok, I'm giving the CI a shot. I managed to get the tests building and running locally, we'll see if I got the CI scripts right!
|
I tried on my Manjaro machine, and the charconv test does succeed, with or without $ cmake -S . -B build/emscripten -DCMAKE_TOOLCHAIN_FILE=/usr/lib/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node -D C4CORE_BUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-m32 -s NO_DISABLE_EXCEPTION_CATCHING" && cmake --build build/emscripten/ --target c4core-test-run -j
Start 17: c4core-test-charconv
17/21 Test #17: c4core-test-charconv ............. Passed 0.33 sec
Start 18: c4core-test-format
18/21 Test #18: c4core-test-format ............... Passed 0.25 sec
Start 19: c4core-test-base64
19/21 Test #19: c4core-test-base64 ............... Passed 0.18 sec
Start 20: c4core-test-std_string
20/21 Test #20: c4core-test-std_string ........... Passed 0.17 sec
Start 21: c4core-test-std_vector
21/21 Test #21: c4core-test-std_vector ........... Passed 0.18 sec
100% tests passed, 0 tests failed out of 21
Total Test time (real) = 4.72 sec
[100%] Built target c4core-test-run |
... indeed that charconv test fails in the github workflow, while it succeeds in my machine. Maybe this is a version issue? My emscripten version is this: [jpmag@bach c4core]$ pacman -Qs emscripten
local/emscripten 3.0.0-1
Compile C and C++ into highly-optimizable JavaScript for the web |
Can I split the emscripten workflow to a separate file? It's taking too long to get there... |
Sure. The initial run does take a long time, but once the cache is setup it is normally pretty quick. Interesting that upgrading to 3.0 fixes the tests. I didn't know this version was out, I'll have to upgrade my projects too! Still, while the Debug builds passes now, it seems Release is still having issue. |
Right, I have found out the issue with the failure in Release; the issue was legit and it is now fixed (and I'm wondering how it is that the test ever passed!). Hopefully, all the four tests will now pass. |
However, I am concerned with the emscripten version constraint. The current I'm guessing that 3.0.0 is fairly new and many users will not be using this version yet. I reckon it is worth keeping the tests in the earlier emscripten version. I am reinstating the 2.0.34 workflows, and will add a emscripten specific workaround in the (BTW, this is not the first time I have serious trouble coming from |
The main change in Emscripten 3.0 was the upgrade to their libc:
So it makes sense that sprintf could be affected. |
Thanks! |
fixes #50
fixes #51