加载挡板扩展失败
Loading Bazel Extension Fails
我正在尝试通过我的 bazel 构建中的存储库规则添加外部依赖项。我将规则文件放在一个单独的目录中,并且我试图将其加载到根工作区文件中。设置如下。
[根]/工作区
load("//thirdparty:myrepo.bzl", "my_repository")
my_repository(
name = "myrepo",
)
[root]/thirdparty/myrepo.bzl
def _repository_impl(ctxt):
my_repository = repository_rule(
implementation = _repository_impl,
environ = ["CC", "CXX", "LD_LIBRARY_PATH"],
local = True,
)
[root]/src/BUILD
cc_binary(
name = "hello",
srcs = [
"hello.cc",
],
deps = [
"@myrepo//:foo"
],
)
但是当我尝试构建 hello 目标时,它失败了,并显示以下内容。
$ bazel build -c dbg //src:*
INFO: Invocation ID: d6b14442-0558-4c07-8414-59a0766ce338
ERROR: error loading package '': Unable to load package for '//thirdparty:myrepo.bzl': BUILD file not found on package path
ERROR: error loading package '': Unable to load package for '//thirdparty:myrepo.bzl': BUILD file not found on package path
INFO: Elapsed time: 1.217s
为什么找不到扩展名 (.bzl) 文件?
附言:
Bazel 版本是 0.21.0
BUILD file not found on package path
表示标签说该位置应该有一个 BUILD 文件(用于创建构建包),但没有找到。
基本上,我认为您需要做的就是在[root]/thirdparty/myrepo.bzl
旁边创建一个空的 BUILD 文件
相关文章:
- 如果没有malloc,链表实现将失败
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- 是否可以通过C++扩展强制多个python进程共享同一内存
- 视图中的参数推导失败:take_while
- static_assert在宏中,但也可以扩展到可以用作函数参数的东西
- 链接到自行创建的dll失败
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- 嵌套参数包扩展失败
- 将源文件扩展名从 .m 更改为 .mm 在屏幕保护程序项目的 Xcode 9.3 中失败
- vkGetInstanceProcAddress 在调试报告扩展上失败
- VS2017 RC而不是VS2015,Variadic模板包扩展失败
- COM 外壳扩展以覆盖"Run as Administrator"在"开始"菜单搜索中失败
- 加载挡板扩展失败
- 在Visual Studio 2017中,通过扩展每个参数包来呼叫基类成员失败
- Vulkan-加载扩展时实例创建失败
- 传递引用时模板扩展失败
- 在重载函数上构建Python C++扩展失败
- 包扩展失败与g++4.9.0,但工作与clang++3.4
- 逻辑扩展文件失败