 -        executable = ctx.executable._protoc,
 +        executable = ctx.executable.protoc,
          arguments = arguments,
++        use_default_shell_env = True,
      )
  
      return struct(files = depset(out_files))

             executable = True,
             cfg = "host",
         ),
@@ -175,12 +157,3 @@ _generate_cc = rule(
     output_to_genfiles = True,
     implementation = generate_cc_impl,
 )

     attrs = {
         "srcs": attr.label_list(
             mandatory = True,
@@ -161,13 +145,12 @@ _generate_cc = rule(
             mandatory = False,
             allow_empty = True,
         ),
