diff options
author | Julio Merino <jmmv@google.com> | 2016-02-18 20:32:44 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-02-19 08:58:02 +0000 |
commit | ffc891c4efbf498fdb8eaf4d2c922e7e7a58f99d (patch) | |
tree | 208bda51588a5fce040a32bea5d7a7aa93b47165 /tools | |
parent | bcf96fe08987e3ce1cbc22a2f6281d91f3d6a93e (diff) |
Use ctx.executable to get references to the binaries.
This fixes the build of Bazel with itself. Using ctx.file instead of
executable may yield a reference of the form external/blahblah/ which
does not exist in the file system. Using ctx.executable does point
to the right binary.
--
MOS_MIGRATED_REVID=114990955
Diffstat (limited to 'tools')
-rw-r--r-- | tools/build_rules/genproto.bzl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/build_rules/genproto.bzl b/tools/build_rules/genproto.bzl index 4ba5463fb5..47715df499 100644 --- a/tools/build_rules/genproto.bzl +++ b/tools/build_rules/genproto.bzl @@ -22,9 +22,9 @@ def gensrcjar_impl(ctx): ctx.action( command=' '.join([ - "JAR='%s'" % ctx.file._jar.path, + "JAR='%s'" % ctx.executable._jar.path, "OUTPUT='%s'" % out.path, - "PROTO_COMPILER='%s'" % ctx.file._proto_compiler.path, + "PROTO_COMPILER='%s'" % ctx.executable._proto_compiler.path, "SOURCE='%s'" % ctx.file.src.path, ctx.executable._gensrcjar.path, ]), @@ -51,11 +51,13 @@ gensrcjar = rule( "_proto_compiler": attr.label( default = Label("@bazel_tools//third_party:protoc"), allow_files = True, + executable = True, single_file = True, ), "_jar": attr.label( default = Label("@bazel_tools//tools/jdk:jar"), allow_files = True, + executable = True, single_file = True, ), }, |