From ffc891c4efbf498fdb8eaf4d2c922e7e7a58f99d Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Thu, 18 Feb 2016 20:32:44 +0000 Subject: 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 --- tools/build_rules/genproto.bzl | 6 ++++-- 1 file 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, ), }, -- cgit v1.2.3