From 3720996062623e58ec7f59bc4f0d91fda549f06c Mon Sep 17 00:00:00 2001 From: Sean Vong-Karlage Date: Fri, 16 Aug 2024 10:41:54 -0700 Subject: [PATCH] cfg: Support BUCK_TREE as an alternative spelling of PACKAGE 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 --- cfg/experimental/set_cfg_modifiers.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfg/experimental/set_cfg_modifiers.bzl b/cfg/experimental/set_cfg_modifiers.bzl index d6b9cca2f2d7..e238601cdd55 100644 --- a/cfg/experimental/set_cfg_modifiers.bzl +++ b/cfg/experimental/set_cfg_modifiers.bzl @@ -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 []