Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77694

cannot compile `immer` header with `--opt=off`

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc3, 5.0.25, 6.0.14
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • v7.0, v6.0, v5.0
    • Execution Team 2023-06-12

      Immer incorrectly assumes GCC does not support exceptions, because it's checking a clang-specific feature macro.

      Furthermore, with optimization turned off, its IMMER_RETHROW empty definition yields a function missing a return statement, a fatal build warning for us.

      Scons script and output attached.

      Essentially this scons invocation:

      $ python3-venv/bin/python3 \
         buildscripts/scons.py \
         VARIANT_DIR=enterprise_dynamic_gcc_gdb_noopt_asan \
         LLVM_SYMBOLIZER=/opt/mongodbtoolchain/v4/bin/llvm-symbolizer \
         VERBOSE=1 \
         LIBS=rt \
         --variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars \
         --sanitize=address \
         --allocator=system \
         --link-model=dynamic \
         --opt=off \
         build/enterprise_dynamic_gcc_gdb_noopt_asan/mongo/db/catalog/historical_catalogid_tracker.dyn.o
      

      Yields a series of fatal warnings:

      /opt/mongodbtoolchain/v4/bin/g++ -o build/enterprise_dynamic_gcc_gdb_noopt_asan/mongo/db/catalog/historical_catalogid_tracker.dyn.o -c -Woverloaded-virtual -Wpessimizing-move -Wno-maybe-uninitialized -fsized-deallocation -std=c++20 -Werror -include mongo/platform/basic.h -ffp-contract=off -fasynchronous-unwind-tables -g2 -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -gdwarf-5 -fno-omit-frame-pointer -fno-strict-aliasing -O0 -march=sandybridge -mtune=generic -mprefer-vector-width=128 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -Wno-psabi -fstack-protector-strong -fsanitize=address -fno-omit-frame-pointer -gdwarf32 -Wa,--nocompress-debug-sections -fno-builtin-memcmp -Wimplicit-fallthrough=5 -fPIC -DSAFEINT_USE_INTRINSICS=0 -DPCRE2_STATIC -DMONGO_USE_VISIBILITY -DNDEBUG -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -DADDRESS_SANITIZER -DABSL_FORCE_ALIGNED_ACCESS -DBOOST_ENABLE_ASSERT_DEBUG_HANDLER -DBOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF -DBOOST_LOG_NO_SHORTHAND_NAMES -DBOOST_LOG_USE_NATIVE_SYSLOG -DBOOST_LOG_WITHOUT_THREAD_ATTR -DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_USES_DATETIME -DBOOST_THREAD_VERSION=5 -DBOOST_LOG_DYN_LINK -Isrc/third_party/s2 -Isrc/third_party/variant-1.4.0/include -Isrc/third_party/libstemmer_c/include -Isrc/third_party/SafeInt -Isrc/third_party/murmurhash3 -Isrc/third_party/immer/dist -Isrc/third_party/fmt/dist/include -Isrc/third_party/boost -Isrc/third_party/abseil-cpp/dist -Ibuild/enterprise_dynamic_gcc_gdb_noopt_asan -Isrc src/mongo/db/catalog/historical_catalogid_tracker.cpp
      In file included from src/third_party/immer/dist/immer/map.hpp:12,
                       from src/mongo/util/immutable/unordered_map.h:32,
                       from src/mongo/db/catalog/historical_catalogid_tracker.h:34,
                       from src/mongo/db/catalog/historical_catalogid_tracker.cpp:30:
      src/third_party/immer/dist/immer/detail/hamts/champ.hpp: In member function 'immer::detail::hamts::champ<T, Hash, Equal, MemoryPolicy, B>::add_result immer::detail::hamts::champ<T, Hash, Equal, MemoryPolicy, B>::do_add(immer::detail::hamts::champ<T, Hash, Equal, MemoryPolicy, B>::node_t*, T, immer::detail::hamts::hash_t, immer::detail::hamts::shift_t) const [with T = mongo::NamespaceString; Hash = absl::lts_20211102::hash_internal::Hash<mongo::NamespaceString>; Equal = std::equal_to<mongo::NamespaceString>; MemoryPolicy = immer::memory_policy<immer::heap_policy<immer::cpp_heap>, immer::refcount_policy, void, immer::no_transience_policy, true, true>; unsigned int B = 5]':
      src/third_party/immer/dist/immer/detail/hamts/champ.hpp:620:5: error: control reaches end of non-void function [-Werror=return-type]
        620 |     }
            |     ^
      

        1. cmd.sh
          1.0 kB
          Billy Donahue
        2. cmd.txt
          17 kB
          Billy Donahue

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: