Reputation: 788
I made a repository for glfw with this:
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
new_git_repository(
name = "glfw",
build_file = "BUILD.glfw",
remote = "https://github.com/glfw/glfw.git",
tag = "3.2.1",
)
I put BUILD.glfw
in the WORKSPACE root. When I built, I saw:
no such package '@glfw//': Not a regular file: [snipped/external/BUILD.glfw
I moved BUILD.glfw
to external/BUILD.glfw
and it seems to work, but I couldn't find documentation about this. The docs about new_git_repository
say that build_file
"...is a label relative to the main workspace."; I don't see anything about 'external' there.
Upvotes: 4
Views: 1235
Reputation: 2765
Assuming that new_git_repository has the same problem that http_archive has, per Bazel issue 6225 you need to refer to the BUILD file for glfw as @//:BUILD.glfw
Upvotes: 1
Reputation: 13463
This is due to an inconsistent semantical difference between the native and (newer) Skylark versions of new_git_repository
. To use the native new_git_repository
, comment/remove the load statement:
# load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
Upvotes: 4