Skip to content

Commit

Permalink
Use ctx.executable to get references to the binaries.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jmmv authored and damienmg committed Feb 19, 2016
1 parent bcf96fe commit ffc891c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/build_rules/genproto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]),
Expand All @@ -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,
),
},
Expand Down

0 comments on commit ffc891c

Please sign in to comment.