2 Star 0 Fork 0

mirrors_facebook/buck2-shims-meta

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cfg.bzl 1.50 KB
一键复制 编辑 原始数据 按行查看 历史
Michael Lee 提交于 2024-11-23 06:59 +08:00 . Remove ?v2_only
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.
load("@prelude//cfg/modifier:cfg_constructor.bzl", "cfg_constructor_post_constraint_analysis", "cfg_constructor_pre_constraint_analysis")
load("@prelude//cfg/modifier:common.bzl", "MODIFIER_METADATA_KEY")
SHIM_ALIASES = {
"fedora": "shim//os/linux/distro/constraints:fedora",
"ubuntu": "shim//os/linux/distro/constraints:ubuntu",
}
def set_cfg_constructor(aliases = dict()):
project_root_cell = read_root_config("cell_aliases", "root")
current_root_cell = read_config("cell_aliases", "root")
if project_root_cell == current_root_cell:
native.set_cfg_constructor(
stage0 = cfg_constructor_pre_constraint_analysis,
stage1 = cfg_constructor_post_constraint_analysis,
key = MODIFIER_METADATA_KEY,
aliases = struct(**aliases),
extra_data = struct(),
)
def get_shim_modifiers():
modifiers = []
linux_distro = read_config("linux", "distro")
if linux_distro:
modifiers.append("shim//os/linux/distro/constraints:{}".format(linux_distro))
known_broken = read_config("oss", "known_broken", "disable")
modifiers.append("shim//opensource/macros/broken_in_oss/constraints:{}".format(known_broken))
return modifiers
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_facebook/buck2-shims-meta.git
[email protected]:mirrors_facebook/buck2-shims-meta.git
mirrors_facebook
buck2-shims-meta
buck2-shims-meta
main

搜索帮助