output 'external/name/x/lib/lib.so' was not created using bazel make

╄→尐↘猪︶ㄣ 提交于 2019-12-08 09:12:30

问题


I was trying to follow the example provided by Building Makefile using bazel post to build an external package in envoy. In the WORKSPACE file I added the following:

new_git_repository(
    name = "name",
    remote = "remote.git",
    build_file = "//foo/bazel/external:x.BUILD",
)

And foo/bazel/external/x.BUILD has the following contents:

load("@rules_foreign_cc//tools/build_defs:make.bzl", "make")

filegroup(
  name = "m_srcs",
  srcs = glob(["code/**"]),
)

make(
  name = "foo_bar",
  make_commands = ["make lib"],
  lib_source = ":m_srcs",
  shared_libraries = ["lib.so"],
)

and I set the visibility in foo/bazel/BUILD as package(default_visibility = ["//visibility:public"])

On executing bazel build -s @name//:foo_bar, I get the error that external/name/x/lib/lib.so was not created.

I checked the bazel-bin/external/name/x/logs/GNUMake.log and make completes successfully. I see that BUILD_TMPDIR directory has created lib.so. I think it should have been copied to EXT_BUILD_DEPS/lib, but I am not sure why it was not copied. Would appreciate any tips to debug the error.


回答1:


Edited make command to manually copy the lib to expected folder - make_commands = ["make libs; cp lib.so $INSTALLDIR/lib/lib.so"]



来源:https://stackoverflow.com/questions/58211438/output-external-name-x-lib-lib-so-was-not-created-using-bazel-make

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!