roadmap-retos-programacion icon indicating copy to clipboard operation
roadmap-retos-programacion copied to clipboard

#30 - python

Open raulG91 opened this issue 1 year ago • 12 comments

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

raulG91 avatar Jul 25 '24 21:07 raulG91

Anyone? I can't believe I'm the only one facing this issue?

emmenlau avatar Sep 23 '20 08:09 emmenlau

Build still fails on latest release v2020.09.28.00

emmenlau avatar Sep 30 '20 07:09 emmenlau

I think the commit that breaks Ubuntu 18.04 for me is 08e2614810949e24231f123dda79bfbdcb30fea8 , @ericniebler does that make sense?

emmenlau avatar Sep 30 '20 12:09 emmenlau

Got the same error on CentOS7 with devtoolset-7

boringuy avatar Oct 20 '20 15:10 boringuy

@emmenlau I have the same question on ubuntu 20.04,Have you solved this problem?

bolunfeng avatar Oct 30 '20 01:10 bolunfeng

No, I think this library is just not well maintained. There was no response from core team in 6 weeks, for a broken build :-( :-(

emmenlau avatar Oct 30 '20 13:10 emmenlau

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.

ericniebler avatar Nov 01 '20 02:11 ericniebler

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 :-(

emmenlau avatar Nov 04 '20 09:11 emmenlau

I meet the same problem, do you fix this in the end?

ghost avatar Feb 28 '21 09:02 ghost

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.h
  • folly/portability/Constexpr.h
  • folly/FixedString.h
  • folly/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).

aytey avatar Mar 07 '21 12:03 aytey

image

I add a 'u' and fix this problem.

cloudren2017 avatar Jul 26 '24 04:07 cloudren2017

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()

vaavaav avatar Nov 22 '24 01:11 vaavaav