-
Notifications
You must be signed in to change notification settings - Fork 503
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 build against libstdc++ 12 #193
Conversation
While attempting to compile katran on Debian Bullseye and Bookworm I've realized that it compiled as expected on Bullseye with clang-13 but failed on Bookworm with the same compiler issuing the following error: /tmp/fbcode_builder_getdeps-ZrootZkatranZbuildZfbcode_builder-root/repos/git.luolix.top-facebookincubator-katran.git/katran/lib/BpfLoader.cpp:46:25: error: implicit instantiation of undefined template 'std::array<char, 128>' std::array<char, 128> buf{}; Debugging the issue with clang++ -H I've noticed that BpfLoader.h:21: \#include <unordered_map> implictily includes array when using libstdc++ 10: .. /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/unordered_map ... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable.h .... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/hashtable_policy.h ..... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple ...... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/array ...... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/uses_allocator.h ...... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h ..... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/limits ... /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/unordered_map.h but this doesn't happen with libstdc++ 12: .. /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/unordered_map ... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable.h .... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/hashtable_policy.h ..... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/tuple ...... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/uses_allocator.h .... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/enable_special_members.h ... /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unordered_map.h
Hi @jvgutierrez! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
This pull request has been automatically marked as stale because it has not had recent activity. If you'd still like this PR merged, please comment on the PR, make sure you've addressed reviewer comments, and rebase on the latest main. Thank you for your contributions! |
This pull request has been automatically closed it has not had recent activity. If you'd still like this PR merged, please feel free to reopen it, make sure you've addressed reviewer comments, and rebase on the latest main. Thank you for your contributions! |
This is still an issue (and a simple fix). |
While attempting to compile katran on Debian Bullseye and Bookworm I've realized that it compiled as expected on Bullseye with clang-13 but failed on Bookworm with the same compiler issuing the following error:
Debugging the issue with clang++ -H I've noticed that BpfLoader.h:21: #include <unordered_map>
implicitly includes array when using libstdc++ 10:
but this doesn't happen with libstdc++ 12:
Adding a explicit
#include <array>
fixes the error