[SERVER-52583] libdeps graph linter: public that should be private Created: 03/Nov/20  Updated: 06/Dec/22  Resolved: 19/Nov/20

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

Type: New Feature Priority: Major - P3
Reporter: Daniel Moody Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-52578 integrate libabigail data into libdep... Closed
Duplicate
is duplicated by SERVER-30815 Migrate library dependencies to LIBDE... Closed
Assigned Teams:
Server Development Platform
Participants:

 Description   

from the document:

Second only to removing edges that should not exist in impact, this is one of the key lint features we want to deliver. Reducing an edge from public to private means that the dependency no longer propagates transitively through the codebase. It also means that in environments that can use ABI driven (rather than out-of-date detection) relinks are greatly reduced, because private edges firewall the propagation of out-of-dateness when ABI is unaltered by a code change.

 

Conceptually, the scenario isn’t hard to understand. If A declares a public dependency on Z, and A directly requires symbols from Z (e.g. not as a consequence of Z’s export from another dependency of A which A uses in its implementation), but use of A’s interface does not induce a dependency on Z on the client, then Z should be reduced from public to private in A.

 

There is, as always, a wrinkle here. It may not be possible to tell, looking at the use of Z symbols in A, whether those symbols are because of direct use of Z symbols in A’s implementation, or whether those symbols are used because A is using B which uses Z in its interface. But it sort of doesn’t matter: if A’s use of B causes A to acquire dependencies on Z in its implementation but not its interface, then the linter will require that Z be public in B. But we assumed that use of A’s interface didn’t induce a dependency on Z. So one or both of B and Z will be private in A. But we can always safely recommend that any existing public Z dependency be moved to be private in A.



 Comments   
Comment by Daniel Moody [ 19/Nov/20 ]

Closing as duplicate to 
SERVER-30815
 

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