Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the check for set_cfg_modifiers more repo friendly
Summary: In other repos, this file is not guaranteed to be at `fbcode/buck2/cfg/experimental/set_cfg_modifiers.bzl`. For example, in WAIPhone, it is at `tools/buck2/fbcode/buck2/cfg/experimental/set_cfg_modifiers.bzl` and this fails the check. ``` 5: Traceback (most recent call last): * tools/buck2/prelude/PACKAGE:15, in <module> set_cfg_modifiers(cfg_modifiers = [ * tools/buck2/fbcode/buck2/cfg/experimental/set_cfg_modifiers.bzl:34, in set_cfg_modifiers _set_cfg_modifiers(cfg_modifiers, extra_cfg_modifiers_per_rule) * tools/buck2/prelude/cfg/modifier/set_cfg_modifiers.bzl:42, in set_cfg_modifiers fail("set_cfg_modifiers is only allowed to be used from a PACKAGE or BUCK_TRE... error: fail: set_cfg_modifiers is only allowed to be used from a PACKAGE or BUCK_TREE file, not a bzl file. --> tools/buck2/prelude/cfg/modifier/set_cfg_modifiers.bzl:42:13 | 42 | fail("set_cfg_modifiers is only allowed to be used from a PACKAGE or BUCK_TREE file, not a bzl file.") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ``` Since this file must be in the `fbcode` cell (due to loads elsewhere), assume that the file path ends with the path. Reviewed By: JakobDegen Differential Revision: D65290874 fbshipit-source-id: 3dd64f27989a9789b30ae56a6492d1571c4ce9c0
- Loading branch information