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

Make bazel configure checks individual rules

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Build

      Why (from slack):
      Recently we converted some scons configure checks to bazel to support config header generation. This currently was implemented doing the checks serially with just the compiler args (configuration) from the toolchain (no command line options). There a couple things to consider here:

      1. Command line options or other such configurations that take place in mongo_src_rules.bzl file could affect the result of the configure check.
      2. A configure check could add a configuration which then affects another configure check, so in some form some configure checks may have dependencies.

      Basic design discussion from slack:

      The configure check rule would be generic. You would pass it a python script of a configure check to run. The script maps to a python script in bazel/config/checks/ which is then loaded and run. It produces an output file which has some result info in it. The configure check rule would also have an input to take in similar compiler args passed to the cc_library and cc_binary calls in the mongo_src_rules.bzl file. The generate_config_header would be a new macro in the mongo_src_rules.bzl file. It would have a for loop which calls the configure check rules passed to the macro. The output files would be created in standard format based off the inputs, so that you could construct a list of inputs to pass to a new "write_config_header" rule which is the final thing instantiated in the new macro. 

            Assignee:
            Unassigned Unassigned
            Reporter:
            daniel.moody@mongodb.com Daniel Moody
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: