make dependencies in common/
finer-grained
#6528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I want to parallelize file-finding during option parsing, partly for speed reasons and partly because other LSP-related changes might wind up having to entirely rescan for files, and it would be nicer if the latter made a passing attempt to be fast.
The first blocker here is that we have two Bazel components:
//common
//common/concurrency
Parallelizing file-finding requires making the first depend on the second, but the second already depends on the first, and Bazel won't let us introduce cycles in our dependency graph.
Therefore, we need to split out some components that just
//common/concurrency
can depend on without pulling in all of//common
. In a future PR, then, we can add the dependency on//common/concurrency
to//common
without introducing cycles.This is all relatively straightforward, if a little tedious. The weirdest part of the change is "untangle common/os/os.cc from exception infrastructure with a hammer", which is mostly me being lazy about not splitting out more specific OS-related dependencies (debugging primitives, threading primitives, etc.) so that we could use
common/exception/Exception.h
etc. incommon/os/
. If we would like to avoid introducing barethrow logic_error
, I can work on splitting things out.Test plan
Ideally, if this builds, everything should Just Work.