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

Move Linux/MacOS specific configuration options from mongo_src_rules to toolchain configs

    • Build
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently there are a lot of platform/compiler specific flags in our mongo_src_rules macros, ex:

      https://github.com/10gen/mongo/blob/master/bazel/mongo_src_rules.bzl#L432-L435

      Please move as many of the Linux/MacOS specific flags to the toolchain config files as possible:
      Linux: https://github.com/10gen/mongo/blob/master/bazel/toolchains/mongo_cc_toolchain_config.bzl 
      MacOS: https://github.com/10gen/mongo/blob/master/bazel/toolchains/mongo_apple/mongo_apple_cc_toolchain_config.bzl 

      While you're there renaming mongo_cc_toolchain_config to mongo_linux_cc_toolchain_config would be awesome!

      For context:

      • ppc64le & s390x are linux only, the toolchain config has access to the cpu architecture so you can branch off of that in the toolchain config
      • gcc is Linux only, the compiler type is also available in the toolchain config for branching
      • clang is on Linux & MacOS, so you'll have to copy the clang options to both toolchain configs in some cases
      • Windows is MSVC only, please ignore for the scope of this ticket
      • Some options may be harder to move over than others, don't feel like you have to move them all over in one PR. I would start with a PR on the easier ones and then possibly make a followup for the harder ones.

            Assignee:
            patrice.arruda@mongodb.com Patrice Arruda
            Reporter:
            zack.winter@mongodb.com Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None