[SERVER-41648] insulate third_party/ (e.g. s2geometry) from mongo/ headers Created: 12/Jun/19  Updated: 29/Oct/23  Resolved: 10/Sep/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: 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
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 08/Sep/19 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: SERVER-41648 remove mongo headers from s2 files.

This reverts commit 25720e4d716e01ae849c29ee2bbd00b8d5e82f91.

fix sense of VLOG macro enable
Branch: master
https://github.com/mongodb/mongo/commit/96a1a78772038fa29b94dbe92b51b9e9957d3f6f

Comment by Githook User [ 04/Sep/19 ]

Author:

{'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}

Message: Revert "SERVER-41648 remove mongo headers from s2 files."

This reverts commit e58bc0f552112f5c1c16f8092b771f7e562316fb.
Branch: master
https://github.com/mongodb/mongo/commit/6c548a4a26a4d47e8fe3035b7964a24110d7d19d

Comment by Githook User [ 04/Sep/19 ]

Author:

{'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue'}

Message: SERVER-41648 remove mongo headers from s2 files.
Branch: master
https://github.com/mongodb/mongo/commit/e58bc0f552112f5c1c16f8092b771f7e562316fb

Comment by Billy Donahue [ 14/Jun/19 ]

code review url: https://mongodbcr.appspot.com/475920001/

Generated at Thu Feb 08 04:58:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.