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

Make assert_util_core.h a private header

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Fully Compatible
    • ALL
    • Programmability 2025-01-20, Programmability 2025-02-03

      The comment from assert_util_core.h:

      /**
       * This header is separated from assert_util.h so that the low-level
       * dependencies of assert_util.h (e.g. mongo/base/status_with.h,
       * mongo/base/status.h, mongo/base/string_data.h) can use the `invariant` macro
       * without causing a circular include chain. It should never be included
       * directly in any other files.
       *
       *     [assert_util.h]
       *     |    |
       *     |    v
       *     |    [string_data.h, etc]
       *     |    |
       *     v    v
       *     [assert_util_core.h]
       */
      

      This file is now included by 291 files, not the 2 or 3 special cases it was designed to accommodate. This is a consequence of the IWYU experiment.

      IWYU was applied without regard to header dependencies like this one.

      Other "public" headers like log.h or unittest.h have had their private dependencies fanned out to their clients as well.

      We have thousands of similar unnecessary include statements in the codebase as a result.
      These should all be cleaned up.

      This has a real effect on me as a maintainer of assert_util, as I can't shuffle my internal structure around anymore without updating users, since my users are directly including private detail headers.

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

              Created:
              Updated:
              Resolved: