Skip to content
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

Compilation fails. #105

Open
shamefulCake1 opened this issue Mar 15, 2024 · 3 comments
Open

Compilation fails. #105

shamefulCake1 opened this issue Mar 15, 2024 · 3 comments

Comments

@shamefulCake1
Copy link

/usr/bin/clang++ -DFMT_SHARED -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -Dmatrix_client_EXPORTS -I/tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/include -O2 -fPIC -std=c++23 -fpermissive 		-Wall 		-Wextra 		-Wconversion 		-pipe 		-pedantic 		-fsized-deallocation 		-fdiagnostics-color=always 		-Wno-attributes 		-Wunreachable-code -O3 -DNDEBUG -fPIC -pthread -DNOMINMAX -DSPDLOG_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -std=c++20 -MD -MT CMakeFiles/matrix_client.dir/lib/structs/events/messages/file.cpp.o -MF CMakeFiles/matrix_client.dir/lib/structs/events/messages/file.cpp.o.d -o CMakeFiles/matrix_client.dir/lib/structs/events/messages/file.cpp.o -c /tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/lib/structs/events/messages/file.cpp
In file included from /tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/lib/structs/requests.cpp:1:
In file included from /tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/include/mtx/requests.hpp:7:
/usr/bin/../lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../include/c++/11.2.0/variant:84:43: error: implicit instantiation of undefined template 'std::variant_size<mtx::events::collections::StrippedEvents>'
   84 |     struct variant_size<const _Variant> : variant_size<_Variant> {};
      |                                           ^
/usr/bin/../lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../include/c++/11.2.0/variant:1755:15: note: in instantiation of template class 'std::variant_size<const mtx::events::collections::StrippedEvents>' requested here
 1755 |                 std::variant_size<remove_reference_t<_Variants>...>::value>());
      |                      ^
/tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/lib/structs/requests.cpp:57:36: note: in instantiation of function template specialization 'std::visit<(lambda at /tmp/SBo/mtxclient-f4f0bed1c3723daf83d715b98d94b0cde7b42243/lib/structs/requests.cpp:57:42), const mtx::events::collections::StrippedEvents &>' requested here
   57 |             auto event_json = std::visit([](auto e) { return json(e); }, ev);
      |                                    ^
/usr/bin/../lib64/gcc/x86_64-slackware-linux/11.2.0/../../../../include/c++/11.2.0/variant:81:12: note: template is declared here
   81 |     struct variant_size;
      |            ^

@shamefulCake1
Copy link
Author

shamefulCake1 commented Mar 15, 2024

I retried with Hunter, and it still fails.

The last commit which works is 2f42e4fa49e6de63fd6b06b7e21c3530ded50043.

The commit message says that

Does not work with gcc10.

But it does not work with gcc11.2 too.

And, in fact, this is probably more about libstdc++, not gcc, as building with clang++-17 also fails.

Could you add a compiler check? Like check_compile in cmake, or something like that?

@deepbluev7
Copy link
Member

This is specifically about a bugfix, which landed in GCC11.3, which was not backported to gcc10 or older: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90943

I am surprised slackware does have gcc11.2 instead of the latest point release. A compiler check is a bit hard, since this is about libstdc++ and I don't know how to check for that version. I guess a check_compile could work, but we depend on a few other issues fixed in newer compilers and enumerating is a bit hard.

@shamefulCake1
Copy link
Author

I am surprised slackware does have gcc11.2 instead of the latest point release.

11.2 was the most recent point release when Slackware 15.0 was released, and it's not even 3 years old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants