You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to load Copybara into my internal Bazel WORKSPACE.
I added a http_archive statement to my WORKSPACE file:
http_archive(
name = "copybara",
url = "https://github.com/google/copybara/archive/4f8904964283a405beb9612eb30a5ef693d3f4f3.zip",
type = "zip",
sha256 = "b5f321ebc4932ed9b5673b80ea88fcccfad93dce68c76c81ce306c1ebf2b6b34",
strip_prefix = "copybara-4f8904964283a405beb9612eb30a5ef693d3f4f3"
)
and then trying to build copybara: bazel build @copybara//java/com/google/copybara:copybara. At which point I get an error:
ERROR: Analysis of target ‘@copybara//java/com/google/copybara:copybara’ failed; build aborted: no such package ‘@flogger//jar’: The repository could not be resolved
INFO: Elapsed time: 0.194s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
I know this is not the main use-case of Copybara, but by having copybara part of my repo (as in, defined and pinned in my WORKSPACE file), I will be able to more easily create run targets that use Copybara.
The text was updated successfully, but these errors were encountered:
This is a known issue of Bazel, that it cannot make these transitive dependencies work. Your only workaround is to define those dependencies in your project.
I think, ideally, Copybara would define a deps.bzl that other projects could depend on. This seems to be standard practice in the Bazel world.
For now, you can copy the WORKSPACE into a copybara_deps.bzl in your local repository. You'll have to wrap it in a Skylark function, and then load and call that function in your own project's WORKSPACE.
I'm trying to load Copybara into my internal Bazel WORKSPACE.
I added a
http_archive
statement to myWORKSPACE
file:and then trying to build copybara:
bazel build @copybara//java/com/google/copybara:copybara
. At which point I get an error:I know this is not the main use-case of Copybara, but by having copybara part of my repo (as in, defined and pinned in my WORKSPACE file), I will be able to more easily create
run
targets that use Copybara.The text was updated successfully, but these errors were encountered: