-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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 x64 target platform for appveyor #1414
Conversation
CI job for Visual Studio 2017 x64 with flags |
After some digging, the issue seems to be caused by small stack size (1MB) on x64 platform on Windows. For demonstration, setting a higher stack size inside
As default stack size is higher (usually 8MB) on Linux, the tests doesn't fail for Linux x64 builds. It seems the root cause is the recursive implementation of write_ubjson which is susceptible to stackoverflow for deeply-nested JSON objects. Should |
@nlohmann What's your take on this? The PR fixes the build on x64 but the recursive implementation of Will adding SAX parser eventually fix this issue? UBJSON seems to be covered in the proposal, but the implementation of |
The SAX parser has nothing to do with I'd like not to change the CMakeLists.txt file, because this should be a detail for the user of the library to care about. If possible, the stack size should be adjusted in the AppVeyor configuration file so that the tests succeed. Is this something you can do, @nickaein ? |
Good idea! This should be doable, I will give it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks a lot! |
This pull request fixes #1374.
More details are explained in cmake documentation for Visual Studio 2015/2017
Note that the value of
platform
specified inappveyor.yml
doesn't always match the target platform string required by cmake (e.g.x86
in appveyor.yml vs.cmake -A Win32
). Therefore, we set the target platform for x64 directly in the generator name instead of passing theplatform
variable to cmake.I've already run Appveyor on my fork to make sure this change is effective: https://ci.appveyor.com/project/nickaein/nlohmann-json/builds/21408703
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.