roadmap-retos-programacion
roadmap-retos-programacion copied to clipboard
#30 - python
Describe tus cambios
(Opcional) Sobre todo aconsejable si la "Pull Request" se corresponde con una corrección adicional y no con la presentación de un ejercicio.
Comprobaciones
Asegúrate de cumplir los siguientes puntos antes de realizar la "Pull Request":
- [ ] El título de mi Pull Request sigue este formato: "#[número] - [lenguaje_utilizado]". (Ej: #00 - Python")
- [ ] El nombre el fichero que se corresponde con el de mi usuario en GitHub más la extensión del lenguaje. (Ej: mouredev.py)
- [ ] El fichero de corrección se encuentra dentro del directorio del ejercicio y en una carpeta con el nombre del lenguaje de programación utilizado en minúsculas. (Ej: 00/python/mouredev.py)
- [ ] He revisado que el nombre del directorio del lenguaje no es conflictivo:
- c#, no csharp
- c++, no cplusplus
- go, no golang
- javascript, no js
- [ ] Únicamente he incluido los ficheros de ejercicios. No se aceptarán Pull Requests que contengan archivos adicionales asociados a editores de código o semejantes.
Información
- Tienes toda la información sobre los retos semanales en retosdeprogramacion.com/roadmap.
- Cada semana se realizará la corrección en directo y publicación de un nuevo reto en twitch.tv/mouredev.
- Recuerda que tienes un grupo de apoyo llamado "reto-semanal" en Discord.
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 08e2614810949e24231f123dda79bfbdcb30fea8 , @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: -DDEBUG -ggdb3 -fno-omit-frame-pointer -O0 -m64 -march=skylake.
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:
- https://github.com/andrewvaughanj/folly_1444
This reproducer merges the following files:
folly/CPortability.hfolly/portability/Constexpr.hfolly/FixedString.hfolly/test/FixedStringTest.cpp
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 TEST(FixedStringEraseTest, CEraseTest).
I add a 'u' and fix this problem.
From what I could deduce, Folly needs at least g++-11. However, the default for Ubuntu 20.04 and 18.04 is g++-9 and g++-7, respectively, thus failing to compile.
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()