Skip to content

bazel 0.4.2 loading local rules does not work in new_git_repository #2293

@andrewmed

Description

@andrewmed

With this in WORKSPACE:

new_git_repository(
    name = "hiccup",
    commit = "53057de9799b27d5d0ddfe865fdac6e7a141d896",
    build_file_content = """
load("//build_tools/clojure:clojure.bzl", "clojure")
clojure(
    name = "src",
    namespace = "src.hiccup.core",
)""",
    remote = "https://github.com/weavejester/hiccup.git",
)

as it says, bzl rule should be loaded from a local repository //build_tools/clojure:clojure.bzl

However, when called, the rule is looked upon in remote new_git_repository repository:

andy@laptop:~/repo/build_tools/clojure/tests$ bazel run :two
ERROR: /home/andy/repo/build_tools/clojure/tests/BUILD:9:1: error loading package '@hiccup//': Extension file not found. Unable to load package for '@hiccup//build_tools/clojure:clojure.bzl': BUILD file not found on package path and referenced by '//build_tools/clojure/tests:two'.
ERROR: Analysis of target '//build_tools/clojure/tests:two' failed; build aborted.
INFO: Elapsed time: 0.157s
ERROR: Build failed. Not running target.

here is //build_tools/clojure/tests

load("//build_tools/clojure:clojure.bzl", "clojure")

clojure(
    name = "one",
)
clojure(
    name = "two",
    deps = [
        "@hiccup//:src",
        ":one_library",
    ],
)

Environment info

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions