RealTimeChris / DiscordCoreAPI

A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
https://discordcoreapi.com
MIT License
153 stars 17 forks source link

Incompatible dependencies - jsonifier v0.9.96 #45

Closed WangWeiLin-MV closed 3 weeks ago

WangWeiLin-MV commented 3 months ago

Compiler: MSVC 19.38 OS: Windows 11 Command: vcpkg install discordcoreapi

Built failed with jsonifier v0.9.96 which introduced many changes, like:

Include\discordcoreapi/Utilities/Etf.hpp(612): error C2039: 'float_t': is not a member of 'jsonifier::concepts'
jsonifier/TypeEntities.hpp(68): note: see declaration of 'jsonifier::concepts'
...
alloc.deallocate(static_cast<object_type*>(objectValue), 1);

Could you please help to take a look? Thanks.

RealTimeChris commented 3 months ago

Thanks I will take care of it.

WangWeiLin-MV commented 3 months ago

Thanks for your response. Now that vcpkg CI has been fixed, PR testing can be used normally.

WangWeiLin-MV commented 3 months ago

Hi, and there is an additional information:

After updating https://github.com/microsoft/vcpkg/pull/39693, when building discordcoreapi, it fails in a few minutes since depends the mismatched jsonifier, but the unusual thing is it hangs on Linux.

If rolling back the jsonifier version, the build will work normally instead of hanging (fail due to a previous known issue).

The phenomenon we have observed so far is that: At the beginning, it occupies all CPU and increase memory usage until all memory is occupied, then system hangs, or system crash due to OOM.

There might be some potential build performance issues about jsonifier.

Reproduce

# in vcpkg directory
git pull

# will fail as expected with jsonifier 0.9.95
git revert aac29a32436dc7816fcdfbfc4cbdbeb8fa64315d --no-edit
vcpkg install discordcoreapi

# will hang with jsonifier 0.9.96
git reset --hard HEAD~
vcpkg install discordcoreapi

If there's anything I can help with, please let me know.

RealTimeChris commented 3 months ago

I know the issue and it has been fixed in the latest jsonifier dev-branch. I will push it to the main branch.

RealTimeChris commented 4 weeks ago

Alright it should be fixed now..