forked from facebook/buck2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit renames the `root` cell to facilitate embedding it as a dependency to Rust projects. While the Buck2 repository does not have an official public API, depending on it is the most reasonable way of writing custom test runners, which is important for OSS users until TestInfo V2 lands. `root` is a common name for root cells, it is generic and it is the default when running `buck2 init`, making it a bad name that is not descriptive and likely to conflict with downstream cells. As described in the added docs, this commit is not an ideal solution, since it requires configuration hacks: - The root `.buckconfig` must point to Buck2's shim directory. - Buck2's `.buckconfig` must be edited to remove cells that are already defined in the root.
- Loading branch information
Showing
5 changed files
with
49 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
id: buck2_library | ||
title: Consuming code from the `buck2` repository | ||
--- | ||
|
||
It is possible to depend on targets from the Buck2 repository, which you | ||
might need to do to write a custom test runner (at least until [TestInfo | ||
V2](../../rfcs/drafts/test-info-v2.md) lands). Note that there are no | ||
API stability guarantees at the moment. | ||
|
||
The Buck2 Rust code is available in the `buck2` cell and is useable as | ||
is after adding the following to your `.buckconfig`'s (assuming that the | ||
`buck2` project is available at `path/to/buck2`): | ||
|
||
``` | ||
[cells] | ||
buck2 = path/to/buck2 | ||
shim = path/to/buck2/shim | ||
[cell_aliases] | ||
config = prelude | ||
ovr_config = prelude | ||
fbcode = shim | ||
fbsource = shim | ||
fbcode_macros = shim | ||
buck = shim | ||
bazel_skylib = shim | ||
``` | ||
|
||
Note that due to how cells work in Buck2, the `buck2` cell cannot bring | ||
its own dependencies, so you must remove conflicting cell aliases from | ||
`path/to/buck2/.buckconfig`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters