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

Bazel with clang+asan+remote execution fails due to not found .a files

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Build
    • Fully Compatible
    • ALL

      /home/ubuntu/mongo/build/bazelisk build --//bazel/config:compiler_type=clang --//bazel/config:build_mode=opt_debug --//bazel/config:separate_debug=False --//bazel/config:libunwind=auto --//bazel/config:use_gdbserver=False --//bazel/config:spider_monkey_dbg=False --//bazel/config:allocator=system --//bazel/config:use_lldbserver=False --//bazel/config:use_wait_for_debugger=False --//bazel/config:use_ocsp_stapling=True --//bazel/config:use_disable_ref_track=False --//bazel/config:use_wiredtiger=True --//bazel/config:use_glibcxx_debug=False --//bazel/config:build_grpc=False --//bazel/config:use_libcxx=False --//bazel/config:detect_odr_violations=False --//bazel/config:linkstatic=False --//bazel/config:use_diagnostic_latches=False --//bazel/config:shared_archive=False --//bazel/config:linker=lld --//bazel/config:streams_release_build=True --//bazel/config:build_enterprise=False --//bazel/config:visibility_support=auto --platforms=//bazel/platforms:linux_arm64_clang --host_platform=//bazel/platforms:linux_arm64_clang --compilation_mode=dbg --//bazel/config:http_client=True --//bazel/config:ubsan=True --//bazel/config:asan=True //src/mongo/platform:visibility_test1
      

      Fails with:

      clang++: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
      ld.lld: error: cannot open /mnt/engflow/worker/work/2/exec/external/mongo_toolchain/v4/lib/clang/12.0.1/lib/linux/libclang_rt.asan-aarch64.a: No such file or directory
      ld.lld: error: cannot open /mnt/engflow/worker/work/2/exec/external/mongo_toolchain/v4/lib/clang/12.0.1/lib/linux/libclang_rt.asan_cxx-aarch64.a: No such file or directory
      clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      

      The two files listed below exist in the toolchain, but in the llvm-v4 directory:

      bazel-mongo/external/mongo_toolchain/stow/llvm-v4/lib/clang/12.0.1/lib/linux/libclang_rt.asan-aarch64.a

      This may be able to be fixed by modifying the iink opts in https://github.com/10gen/mongo/blob/master/bazel/toolchains/mongo_toolchain.BUILD#L21 or it may require a toolchain change.

      Passing in --config=local makes this succeed

            Assignee:
            udita.bose@mongodb.com Udita Bose
            Reporter:
            zack.winter@mongodb.com Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: