[SERVER-52792] Add option for automatically building compiledb with all targets Created: 11/Nov/20  Updated: 27/Oct/23  Resolved: 27/Oct/23

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: 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   

A feature was requested so that compiledb can automatically be include with all targets, primarily for the purpose of ninja, so that the compiledb target does not need to always be specified at the command line when specifying targets.

This may be something like --auto-compiledb. One possible way to easily accomplish this (although some may consider it hacky) is to add the compiledb target on to the COMMAND_LINE_TARGETS global that scons uses to record targets requested at the command line.



 Comments   
Comment by Andrew Morrow (Inactive) [ 04/Jan/21 ]

I don't think adding it to COMMAND_LINE_TARGETS would work, though, because it wouldn't have any impact for Ninja builds, which appears to be where this is primarily desired. I think to make it work with Ninja you would need to make "everything" (for some value of everything) depend on the compiledb target, so that no matter what target you built it would need to build the compiledb first. Should that dependency extend all the way down to requesting the direct compilation of a specific TU, which though rare is a legitimate use case? If so, it would maybe even be circular, I'm not sure. Overall, I'm pretty lukewarm in the idea, to be honest. We've had bad experiences with these sort of "wire up dependencies everywhere" efforts, and it doesn't seem like that much savings to need to type something like --auto-compiledb every build rather than just including the compilation database as a target.

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