[SERVER-25822] Prohibit linking unittest library into core mongodb binaries Created: 26/Aug/16 Updated: 12/Nov/20 Resolved: 12/Nov/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Daniel Moody |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Dev Platform 2020-11-16 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
It should be an error detected at build-time to link the unittest library into the mongo shell, mongod or mongos. I was thinking that we could add a symbol to the unittest library, and the same symbol to a library called "unittest_forbidden", and link "unittest_forbidden" |
| Comments |
| Comment by Githook User [ 12/Nov/20 ] |
|
Author: {'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}Message: |
| Comment by Andrew Morrow (Inactive) [ 22/Aug/20 ] |
|
While the linker based approach would work, I think we can probably come up with something within libdeps.py itself. We already have the LIBDEPS_TAGS feature and we also now have AIB_COMPONENT and AIB_ROLE. It seems plausible that we could leverage those to achieve this. It would be nice to make more general declarations, such as "production code cannot depend on test code", or "embedded must not depend on networking" or "ephemeralForTest must not rely on WT". Potentially, such a facility could be used to help enforce layering violations as well. |