New to the Bazel build system.
I want to create a py_binary from a file in a py_library which is created from an http_archive.
Currently I have:
WORKSPACE
:
new_http_archive(
name = "cpplint_archive",
url = "https://pypi.python.org/packages/source/c/cpplint/cpplint-1.2.2.tar.gz",
sha256 = "b2979ff630299293f23c52096e408f2b359e2e26cb5cdf24aed4ce53e4293468",
build_file = "cpplint.BUILD",
strip_prefix = "cpplint-1.2.2"
)
cpplint.BUILD
:
py_library(
name = "cpplint",
srcs = glob(["*.py"]),
visibility = ['//visibility:public']
)
src/BUILD
:
py_binary(
name = "lint",
main = ":cpplint/cpplint.py",
srcs = [":cpplint/cpplint.py"],
deps = [
"@cpplint_archive//:cpplint"
]
)
The path in srcs an main is wrong, giving "no such package 'cpplint/cpplint.py'" when I run bazel run src/lint
. I can't figure out how to refer to a file included in the library.