-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[simdjson] Fix dynamic usage #16105
[simdjson] Fix dynamic usage #16105
Conversation
We shall issue a patch release within simdjson, so patching should not be necessary. Give us a day or so. |
This should be fixed by Version 0.8.2 https://github.com/simdjson/simdjson/releases/tag/v0.8.2 Please note that you may need to specify a x64 target when compiling under Visual Studio 2017 even if you have a 64-bit Windows. If you are getting warnings during the build of this type...
Then your compiler is targeting x86 platforms even if you have a 64-bit OS. The simdjson library is designed for 64-bit systems. If you have further problems, we will address them. It should not be needed to patch simdjson. |
Thank you for the quick response @lemire, @NancyLi1013 please try using the newer published version. Also, not to tell you how to write your library, however please be aware that extending namespace https://en.cppreference.com/w/cpp/language/extending_std This does include poly-fills like your |
@ras0219-msft Thanks Robert. We are aware. The string_view functionality is somewhat of an edge case. It was provided as a de facto standard feature in some standard libraries before C++17 and was finally standardized in C++17. We believe that it is a key feature that we want to rely upon. The alternatives are not great. We could roll our own, we could require C++17, we could return C pointers. Some users are not yet ready to adopt C++17, so we provide a temporary bridge to people who have older compilers (supporting only C++11). We worked hard to make it transparent to users. It does not affect Visual Studio 2017 and 2019 users since in both cases, string_view is available. We will drop this polyfill as soon as C++17 is sufficiently widespread as a requirement. At this time, C++17 is still consider by many as bleeding edge. |
Wait for #16270 merge. |
I believe this has been superceded by #16277. Thanks everyone! |
…NancyLi/fix-simdjson # Conflicts: # versions/s-/simdjson.json
Thanks for your information. This PR also includes another fix. So I think this is still necessary. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@NancyLi1013 Can you elaborate on why this fix is needed? If SIMDJSON_BUILD_STATIC evaluates to false, then we set SIMDJSON_USING_LIBRARY=1 as a compile-time definition in CMake: if(SIMDJSON_BUILD_STATIC)
...
else()
target_compile_definitions(simdjson INTERFACE SIMDJSON_USING_LIBRARY=1)
endif() Your patch is...
This should not be needed, you should already have SIMDJSON_USING_LIBRARY be 1 if SIMDJSON_BUILD_STATIC evaluates to false. If there is an issue, I would much rather fix it upstream than have the packager patching it up. It is more sustainable. |
Thanks for your help and support. I also noticed these codes, but it seems it's invalid in a VS/MSBuild project. It can work in CMake Project. |
@NancyLi1013 Thanks. Of course, vcpkg is welcome to apply all the patches it wants... I would just encourage you to bring back the fixes upstream so that vcpkg does not need the patches. Cheers!!! |
@lemire I will make a PR to fix that in upstream. |
Though it is still untested, I have a minimally invasive fix proposal upstream at simdjson/simdjson#1457 |
@NancyLi1013 @JackBoosY @ras0219-msft I would recommend you go forward with the patch right now. For our next release (0.9), I hope to convince you that it isn't necessary. I really dislike the idea of a downstream code patch based on build configuration. It feels quite dirty to me. |
That is, it makes less and less sense for me to patch the 0.8 version since we are quite close to a 0.9 release. cc @jkeiser |
PR simdjson/simdjson#1457 shows that there should be no need to patch the source code during installation. We will include this fix in the next release of our library (0.9) which should make your life easier. Meanwhile, for 0.8, the current patch should do fine but it should become unnecessary. Thanks for the feedback. |
…NancyLi/fix-simdjson # Conflicts: # ports/simdjson/portfile.cmake # ports/simdjson/vcpkg.json # versions/baseline.json # versions/s-/simdjson.json
Cool, LGTM! Thanks @lemire, @NancyLi1013 :) |
Describe the pull request
Fix dynamic build usage on console application.
Note: No feature needs to test.