-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Build
-
Fully Compatible
In SCons we have separate command line parameters for the various settings build_mode is configuring (opt, release, dbg). In bazel, these are combined into one flag.
The way it's setup now it's error prone to use these as conditions in Bazel since usually the compiler options depend on the individual configuration, not the combined configuration.
For example in https://github.com/10gen/mongo/commit/6e7cace87c2464b8bad409a83236edd8cbd3f0ec#diff-5cc16064f5f3b761a339bbacf36b99d1cc1a5fed12d21a06ac573372d4fe0588 the /MD vs /MDd option is only concerned with the dbg flag, not the opt or release flag. In the current implementation, it's tied to the settings of all three.
Combining options also caused https://jira.mongodb.org/browse/SERVER-86687 since build_mode gets set to "dbg" even though the sanitizers specifically need to query the opt-mode (opt=debug or opt=on)
Separate these out to match the original SCons flags and instead create .bazelrc config options to capture common configurations.