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

clang fails to compile the tree #2482

Closed
tchaikov opened this issue Oct 9, 2024 · 1 comment
Closed

clang fails to compile the tree #2482

tchaikov opened this issue Oct 9, 2024 · 1 comment

Comments

@tchaikov
Copy link
Contributor

tchaikov commented Oct 9, 2024

after llvm/llvm-project#109208, clang fails to build the tree:

[14/24] Building CXX object CMakeFiles/seastar.dir/src/rpc/lz4_compressor.cc.o                  
FAILED: CMakeFiles/seastar.dir/src/rpc/lz4_compressor.cc.o                                                             
/home/kefu/.local/bin/clang++ -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEBUG -DSEASTAR_DEBUG_PROMISE -DSEASTAR_DEBUG_SHARED_PTR -DSEASTAR_DEFAULT_ALLOCATOR -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_DEPRECATED_OSTREAM_FORMAT
TERS -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_HAVE_URING -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_AT
TR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SHUFFLE_TASK_QUEUE -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -DSEASTAR_THREAD_STACK_GUARDS -DSEASTAR_TYPE_ERASE_MORE -I/home/kefu/dev/seastar/include -I/home/kefu/dev/se
astar/build/debug/gen/include -I/home/kefu/dev/seastar/build/debug/gen/src -I/home/kefu/dev/seastar/src -isystem /home/kefu/.local/include -g -std=gnu++23 -Wno-error=unused-result "-Wno-error=#warnings" -fstack-clash-protection -UNDEBUG -
Wall -Werror -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -fvisibility=hidden -gz -fsanitize=address -fsanitize=undefined -MD -MT CMakeFiles/seastar.dir/src/rpc/lz4_compressor.cc.o -MF CMakeFiles/seastar.dir/src/rpc/lz4_compr
essor.cc.o.d -o CMakeFiles/seastar.dir/src/rpc/lz4_compressor.cc.o -c /home/kefu/dev/seastar/src/rpc/lz4_compressor.cc
In file included from /home/kefu/dev/seastar/src/rpc/lz4_compressor.cc:22:             
In file included from /home/kefu/dev/seastar/include/seastar/rpc/lz4_compressor.hh:25: 
In file included from /home/kefu/dev/seastar/include/seastar/rpc/rpc_types.hh:28:      
/usr/include/fmt/std.h:166:24: error: call to consteval function 'fmt::basic_format_string<char, const std::filesystem::path &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
  166 |     return fmt::format(FMT_STRING("{}"), base);                                                                
      |                        ^                                                                                       
/usr/include/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'              
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )        
      |                       ^                                                                                        
/usr/include/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'          
 1806 |   [] {                                                                        \
      |   ^                                                                                                            
/usr/include/fmt/base.h:779:54: note: subexpression not valid in a constant expression 
  779 |     format_str_.remove_prefix(detail::to_unsigned(it - begin()));              
      |                                                   ~~~^~~~~~~~~                 
/usr/include/fmt/base.h:2761:5: note: in call to 'this->context_.advance_to(&"{}"[1])'                                 
 2761 |     context_.advance_to(begin);                                                                                
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                 
/usr/include/fmt/base.h:2756:5: note: in call to 'this->on_format_specs(0, &"{}"[1], &"{}"[1])'
 2756 |     on_format_specs(id, begin, begin);  // Call parse() on empty specs.        
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                 
/usr/include/fmt/base.h:2581:5: note: in call to 'handler.on_replacement_field(0, &"{}"[1])'                           
 2581 |     handler.on_replacement_field(handler.on_arg_id(), begin);                                                  
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                   
/usr/include/fmt/base.h:2613:21: note: in call to 'parse_replacement_field<char, fmt::detail::format_string_checker<char, std::filesystem::path> &>(&"{}"[1], &"{}"[2], checker(s))'
 2613 |         begin = p = parse_replacement_field(p - 1, end, handler);                                              
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~               
/usr/include/fmt/base.h:2884:7: note: in call to 'parse_format_string<true, char, fmt::detail::format_string_checker<char, std::filesystem::path>>({&"{}"[0], 2}, checker(s))'
 2884 |       detail::parse_format_string<true>(str_, checker(s));                                                     
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     
/usr/include/fmt/std.h:166:24: note: in call to 'basic_format_string<FMT_COMPILE_STRING, 0>([] {
    struct __attribute__((visibility("hidden")))  FMT_COMPILE_STRING : fmt::detail::compile_string {
        using char_type [[maybe_unused]] = fmt::remove_cvref_t<decltype("{}"[0])>;      
        [[maybe_unused]] constexpr operator fmt::basic_string_view<char_type>() const {
            return fmt::detail_exported::compile_string_to_view<char_type>("{}");
        }                                                                                                              
    };
    return FMT_COMPILE_STRING();
}())'
  166 |     return fmt::format(FMT_STRING("{}"), base);
      |                        ^~~~~~~~~~~~~~~~
/usr/include/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'
 1806 |   [] {                                                                        \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1807 |     /* Use the hidden visibility as a workaround for a GCC bug (#1973). */    \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1808 |     /* Use a macro-like name to avoid shadowing warnings. */                  \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1809 |     struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base {               \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1810 |       using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1811 |       FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit                                 \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1812 |       operator fmt::basic_string_view<char_type>() const {                    \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1813 |         return fmt::detail_exported::compile_string_to_view<char_type>(s);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1814 |       }                                                                       \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1815 |     };                                                                        \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1816 |     return FMT_COMPILE_STRING();                                              \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1817 |   }()
      |   ~~~
In file included from /home/kefu/dev/seastar/src/rpc/lz4_compressor.cc:22:
In file included from /home/kefu/dev/seastar/include/seastar/rpc/lz4_compressor.hh:25:
In file included from /home/kefu/dev/seastar/include/seastar/rpc/rpc_types.hh:28:
/usr/include/fmt/std.h:172:24: error: call to consteval function 'fmt::basic_format_string<char, const std::filesystem::path &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression
  172 |     return fmt::format(FMT_STRING("{:g}"), base);
      |                        ^
/usr/include/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )
      |                       ^
/usr/include/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'
 1806 |   [] {                                                                        \
      |   ^
/usr/include/fmt/base.h:779:54: note: subexpression not valid in a constant expression
  779 |     format_str_.remove_prefix(detail::to_unsigned(it - begin()));
      |                                                   ~~~^~~~~~~~~
/usr/include/fmt/base.h:2761:5: note: in call to 'this->context_.advance_to(&"{:g}"[2])'
 2761 |     context_.advance_to(begin);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:2591:15: note: in call to 'handler.on_format_specs(0, &"{:g}"[2], &"{:g}"[4])'
 2591 |       begin = handler.on_format_specs(adapter.arg_id, begin + 1, end);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:2613:21: note: in call to 'parse_replacement_field<char, fmt::detail::format_string_checker<char, std::filesystem::path> &>(&"{:g}"[1], &"{:g}"[4], checker(s))'
 2613 |         begin = p = parse_replacement_field(p - 1, end, handler);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/base.h:2884:7: note: in call to 'parse_format_string<true, char, fmt::detail::format_string_checker<char, std::filesystem::path>>({&"{:g}"[0], 4}, checker(s))'
 2884 |       detail::parse_format_string<true>(str_, checker(s));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/std.h:172:24: note: in call to 'basic_format_string<FMT_COMPILE_STRING, 0>([] {
    struct __attribute__((visibility("hidden")))  FMT_COMPILE_STRING : fmt::detail::compile_string {
        using char_type [[maybe_unused]] = fmt::remove_cvref_t<decltype("{:g}"[0])>;
        [[maybe_unused]] constexpr operator fmt::basic_string_view<char_type>() const {
            return fmt::detail_exported::compile_string_to_view<char_type>("{:g}");
        }
    };
    return FMT_COMPILE_STRING();
}())'
  172 |     return fmt::format(FMT_STRING("{:g}"), base);
      |                        ^~~~~~~~~~~~~~~~~~
/usr/include/fmt/format.h:1827:23: note: expanded from macro 'FMT_STRING'
 1827 | #define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string, )
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/format.h:1806:3: note: expanded from macro 'FMT_STRING_IMPL'
 1806 |   [] {                                                                        \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1807 |     /* Use the hidden visibility as a workaround for a GCC bug (#1973). */    \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1808 |     /* Use a macro-like name to avoid shadowing warnings. */                  \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1809 |     struct FMT_VISIBILITY("hidden") FMT_COMPILE_STRING : base {               \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1810 |       using char_type FMT_MAYBE_UNUSED = fmt::remove_cvref_t<decltype(s[0])>; \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1811 |       FMT_MAYBE_UNUSED FMT_CONSTEXPR explicit                                 \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1812 |       operator fmt::basic_string_view<char_type>() const {                    \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1813 |         return fmt::detail_exported::compile_string_to_view<char_type>(s);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1814 |       }                                                                       \
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1815 |     };                                                                        \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1816 |     return FMT_COMPILE_STRING();                                              \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1817 |   }()
      |   ~~~
2 errors generated.

this issue was reported in the LLVM mailing list at https://www.mail-archive.com/[email protected]/msg482152.html . and turns out to be a bug in fmt. it has been fixed upstream. see fmtlib/fmt#4187

@tchaikov
Copy link
Contributor Author

tchaikov commented Oct 9, 2024

this issue was created for those who are testing with clang HEAD.

meanwhile, fmt packages in fedora 40, fedora 41 and fedora 42 (rawhide) are being updated.

since this issue cannot be addressed by seastar, and has been resolved upstream. i am closing it.

@tchaikov tchaikov closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
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

1 participant