1 Star 0 Fork 0

sen-mmd/rules_perl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
load("@rules_perl//:platforms.bzl", "platforms")
load("@rules_perl//perl:toolchain.bzl", "current_perl_toolchain", "perl_toolchain")
# toolchain_type defines a name for a kind of toolchain. Our toolchains
# declare that they have this type. Our rules request a toolchain of this type.
# Bazel selects a toolchain of the correct type that satisfies platform
# constraints from among registered toolchains.
toolchain_type(
name = "toolchain_type",
visibility = ["//visibility:public"],
)
[
(
# toolchain_impl gathers information about the Perl toolchain.
# See the PerlToolchain provider.
perl_toolchain(
name = "perl_{os}_{cpu}_toolchain_impl".format(
cpu = platform.cpu,
os = platform.os,
),
runtime = ["@perl_{os}_{cpu}//:runtime".format(
cpu = platform.cpu,
os = platform.os,
)],
),
# toolchain is a Bazel toolchain that expresses execution and target
# constraints for toolchain_impl. This target should be registered by
# calling register_toolchains in a WORKSPACE file.
toolchain(
name = "perl_{os}_{cpu}_toolchain".format(
cpu = platform.cpu,
os = platform.os,
),
exec_compatible_with = platform.exec_compatible_with,
toolchain = ":perl_{os}_{cpu}_toolchain_impl".format(
cpu = platform.cpu,
os = platform.os,
),
toolchain_type = ":toolchain_type",
),
)
for platform in platforms
]
# This rule exists so that the current perl toolchain can be used in the `toolchains` attribute of
# other rules, such as genrule. It allows exposing a perl_toolchain after toolchain resolution has
# happened, to a rule which expects a concrete implementation of a toolchain, rather than a
# toolchain_type which could be resolved to that toolchain.
#
# See https://github.com/bazelbuild/bazel/issues/14009#issuecomment-921960766
current_perl_toolchain(
name = "current_toolchain",
visibility = ["//visibility:public"],
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sen-mmd/rules_perl.git
git@gitee.com:sen-mmd/rules_perl.git
sen-mmd
rules_perl
rules_perl
main

搜索帮助