Skip to content

Commit

Permalink
cfg: Support BUCK_TREE as an alternative spelling of PACKAGE
Browse files Browse the repository at this point in the history
Summary: BUCK_TREE is an alternative spelling of PACKAGE, let's allow using this for cases [like this](https://fb.workplace.com/groups/llvm17/posts/3692735890978560) where there are directory name conflicts.

Reviewed By: stepancheg

Differential Revision: D61387604

fbshipit-source-id: 0d83a4edd603a52bea53b1ec3f2b8ff26b938b74
  • Loading branch information
get9 authored and facebook-github-bot committed Aug 16, 2024
1 parent 0e648cb commit 3720996
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cfg/experimental/set_cfg_modifiers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def set_cfg_modifiers(
# To ensure that modifiers set in PACKAGE files are easily codemoddable
# We want to enforce that `set_cfg_modifiers` is only invokable from a PACKAGE file and not a bzl file
module_path = call_stack_frame(1).module_path
if not module_path.endswith("/PACKAGE") and module_path != "PACKAGE":
if not module_path.endswith(("/PACKAGE", "/BUCK_TREE")) and module_path not in ("PACKAGE", "BUCK_TREE"):
fail("set_cfg_modifiers is only allowed to be used from PACKAGE files, not a bzl file")

cfg_modifiers = cfg_modifiers or []
Expand Down

0 comments on commit 3720996

Please sign in to comment.