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

Adjust Bazel to not automatically builds all bazel targets regardless of what targets are requested to be built

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL

    Description

      Currently the bazel integration triggers bazel to build all targets even if only a single scons target is requested to be built:

      rm build/fast -r; python3 ./buildscripts/scons.py BAZEL_BUILD_ENABLED=1 --build-profile=fast --ninja=disabled --link-model=dynamic -j 200  --modules= build/fast/mongo/db/commands/libfsync_locked.a
       
      ...
       
      INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
      INFO: Found 2 targets...
      INFO: Elapsed time: 0.362s, Critical Path: 0.00s
      INFO: 1 process: 1 internal.
      INFO: Build completed successfully, 1 total action
      scons: *** [build/fast/mongo/db/commands/libfsync_locked.a] /home/ubuntu/mongo/build/fast/mongo/platform/libvisibility_test_libcommon.so: No such file or directory
      

      This is because the `bazel_library` function is invoked for every defined BazelLibrary entry in SConscript and is completely detached from the scons targets requested to be build in the CLI.

      Attachments

        Activity

          People

            daniel.moody@mongodb.com Daniel Moody
            zack.winter@mongodb.com Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: