-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
FixedStringTest build fails on Ubuntu 20.04 due to errors with constant expressions #1444
Comments
Anyone? I can't believe I'm the only one facing this issue? |
Build still fails on latest release v2020.09.28.00 |
I think the commit that breaks Ubuntu 18.04 for me is 08e2614 , @ericniebler does that make sense? |
Got the same error on CentOS7 with devtoolset-7 |
@emmenlau I have the same question on ubuntu 20.04,Have you solved this problem? |
No, I think this library is just not well maintained. There was no response from core team in 6 weeks, for a broken build :-( :-( |
I apologize for the lack of response. I haven't succeeded in reproducing this, despite trying. I've punched the relevant bits of FixedString into godbolt and tried every gcc compiler version I can, and I haven't gotten it to fail yet. https://godbolt.org/z/5eK6oq. I must be doing something wrong. |
Hi @ericniebler thanks for considering this issue! Admittedly I did not think it might be hard to reproduce. I do compile a number of folly-dependencies from scratch so there is a small chance that this adds to the problem. However I don't think FixedStringTest.cpp makes use of many of these. Furthermore I define a number of CXXFLAGS in the environment: Do you think this may be related? If non of this helps, we can just leave the issue hanging. Sadly the folly build fails for me so regularly on the one or other platform that I anyways will not be able to use it any time soon :-( |
I meet the same problem, do you fix this in the end? |
tl;dr: if you want to see a reproducer for this problem, go here: https://godbolt.org/z/rcr8W7 I'm experiencing this exact issue with OpenSUSE Tumbleweed (20210223) using GCC 10.2.1. Given how "easy" it is to reproduce this for me on Tumbleweed, I created a reproducer here: This reproducer merges the following files:
into one file and gets the following error: pre_generated_1444.cpp: In function ‘void FixedStringEraseTestCEraseTest()’:
pre_generated_1444.cpp:3765:42: in ‘constexpr’ expansion of ‘x.folly::BasicFixedString<char, 26>::cerase(x.folly::BasicFixedString<char, 26>::size(), ((std::size_t)folly::detail::fixedstring::FixedStringBase_<>::npos))’
pre_generated_1444.cpp:1790:20: in ‘constexpr’ expansion of ‘((const folly::BasicFixedString<char, 26>*)this)->folly::BasicFixedString<char, 26>::creplace<1>(pos, folly::detail::fixedstring::checkOverflowOrNpos(count, (((long unsigned int)((const folly::BasicFixedString<char, 26>*)this)->folly::BasicFixedString<char, 26>::size_) - folly::detail::fixedstring::checkOverflow(pos, ((std::size_t)((const folly::BasicFixedString<char, 26>*)this)->folly::BasicFixedString<char, 26>::size_)))), A{'\000'})’
pre_generated_1444.cpp:2212:20: in ‘constexpr’ expansion of ‘((const folly::BasicFixedString<char, 26>*)this)->folly::BasicFixedString<char, 26>::creplace<1>(this_pos, this_count, (* & that), 0, (1 - 1))’
pre_generated_1444.cpp:2252:49: in ‘constexpr’ expansion of ‘folly::detail::fixedstring::checkNullTerminated<char, 1>((* & that))’
pre_generated_1444.cpp:493:61: in ‘constexpr’ expansion of ‘folly::constexpr_strlen<char>(((const char*)a))’
pre_generated_1444.cpp:382:43: in ‘constexpr’ expansion of ‘folly::detail::constexpr_strlen_internal<char>(s, 0)’
pre_generated_1444.cpp:329:29: error: ‘__builtin_strlen(((const char*)(&<anonymous>)))’ is not a constant expression
329 | return FOLLY_DETAIL_STRLEN(s);
| ^
pre_generated_1444.cpp:3766:21: error: non-constant condition for static assertion
3766 | static_assert(26u == tmp0.size(), "");
| ~~~~^~~~~~~~~~~~~~
pre_generated_1444.cpp:3767:19: error: non-constant condition for static assertion
3767 | static_assert(y == tmp0, "");
| ~~^~~~~~~
pre_generated_1444.cpp:3769:21: error: non-constant condition for static assertion
3769 | static_assert(24u == tmp1.size(), "");
| ~~~~^~~~~~~~~~~~~~
pre_generated_1444.cpp:3770:44: error: non-constant condition for static assertion
3770 | static_assert("abcdefghijklmnopqrstuvwx" == tmp1, "");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
pre_generated_1444.cpp:3772:20: error: non-constant condition for static assertion
3772 | static_assert(2u == tmp2.size(), "");
| ~~~^~~~~~~~~~~~~~
pre_generated_1444.cpp:3773:22: error: non-constant condition for static assertion
3773 | static_assert("ax" == tmp2, "");
| ~~~~~^~~~~~~ If you don't want to run my shell script to re-generate this file, I've uploaded a pre-prepared a version here: https://github.com/andrewvaughanj/folly_1444/blob/master/pre_generated_1444.cpp. Everything else in the test-file compiles apart from the content of |
From what I could deduce, Folly needs at least g++-11. My suggestion is to add this restriction to the CMakeLists.txt like so: if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
message(FATAL_ERROR "GCC version must be 11 or higher")
endif() |
I'm trying to build folly latest master (rev f5744f5) on Ubuntu 20.04 x86_64 with 9.3.0. The build fails with the following error:
The text was updated successfully, but these errors were encountered: