Bazel macro fails with `name 'glob' is not defined`

Viewed 1048

I defined a Bazel macro. It looks something like this:

def my_macro():
    java_binary(
        srcs = glob(["*.java"])
        # ...
    )

When I run Bazel, it fails with an error

ERROR: /home/.../macros.bzl:105:19: name 'glob' is not defined

Is it possible to use glob in a macro?

1 Answers
Related