这是indexloc提供的服务,不要输入任何密码
Skip to content

glob() documentation incorrectly says it returns the outputs of targets #10395

@jmillikin

Description

@jmillikin

Description of the problem / feature request:

https://docs.bazel.build/versions/master/be/functions.html#glob says:

If a rule and a source file with the same name both exist in the package, the glob will return the outputs of the rule instead of the source file.

This isn't correct in the current version of Bazel (nor any I can remember using). Given the following workspace:

$ touch WORKSPACE
$ touch hello.c
$ cat >BUILD <<'EOF'
genrule(
    name = "hello.c",
    outs = ["hello-gen.c"],
    cmd = "touch $@",
)

print("glob: ", glob(["*"]))
EOF

Running bazel build will print out hello.c, not hello-gen.c.

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 1.2.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions