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

insulate third_party/ (e.g. s2geometry) from mongo/ headers

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • Dev Tools 2019-06-17, Dev Tools 2019-07-01, Dev Tools 2019-07-15, Dev Tools 2019-07-29, Dev Tools 2019-08-12, Dev Tools 2019-09-09, Dev Tools 2019-09-23
    • 0

      When a third_party library includes mongo/ headers, it constrains our ability to improve those headers for use in our main codebase.

      While investigating SERVER-41495 (upgrade libfmt), we discovered a recent problem with libfmt (https://github.com/fmtlib/fmt/issues/1197), in which its header causes malfunctions in the presence of a using namespace std. The s2geometry library internally uses such directives, so it can't include the fmt/format.h header. Because s2geometry has been locally modified to #include "mongo/logger/log_severity.h", it now brings in all the headers mongo/logging brings in, which now include fmt/format.h.

      So s2geometry fails to build due to an unrelated libfmt upgrade.
      We should isolate third_party code so that it doesn't directly include mongo's full headers for systems like logging. If we need to inject entities into a third_party library we have to find a way to do it through an abstraction so they don't depend on our headers directly. We can't control what third_party code will do the way we can control our own code, so we have to keep the third_party libraries separated from each other.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: