[SERVER-61549] Way to declare library deps for headers Created: 16/Nov/21  Updated: 27/Oct/23  Resolved: 27/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0 Desired

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Participants:

 Description   

The dependencies of that library are completely uncontrolled. Including a a header can imply depending on libraries the header depends on, and we currently have no way to express such dependencies in Scons. It's possible to make header visibility contingent on taking a dependency on its corresponding library. There can be special kinds of deps you could declare to make this less annoying than it sounds.



 Comments   
Comment by Andrew Morrow (Inactive) [ 16/Nov/21 ]

For the produce side, it would be reasonably possible to automatically identify all of the headers associated with .cpp files in a SCons Library declaration with a small amount of SCons-ing. It wouldn't be perfect, because it actually wouldn't catch the case of free-standing headers, and we would need some facility for excluding headers that weren't part of the interface to the library. In any event, we would then tag each header with the node for the associated library. On the consume side, we could add a PostAction or similar that examined the implicit dependency list of the target and cross-referenced the LIBDEPS list for the library against the libraries found by walking the headers. There would be a number of challenges though, not the least of which is that we would actually need to correct all the errors before we could enable it. We might be able to use some sort of annotation to gradually grow the subset of nodes which are correct, like we did for making the graph acyclic.

Generated at Thu Feb 08 05:52:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.