{"action":"created","issue":{"url":"https://api.github.com/repos/google/protobuf/issues/2508","repository_url":"https://api.github.com/repos/google/protobuf","labels_url":"https://api.github.com/repos/google/protobuf/issues/2508/labels{/name}","comments_url":"https://api.github.com/repos/google/protobuf/issues/2508/comments","events_url":"https://api.github.com/repos/google/protobuf/issues/2508/events","html_url":"https://github.com/google/protobuf/pull/2508","id":195986847,"number":2508,"title":"add a key to ctx.action dict to prevent protoc losing the default env","user":{"login":"yliu120","id":9438093,"avatar_url":"https://avatars.githubusercontent.com/u/9438093?v=3","gravatar_id":"","url":"https://api.github.com/users/yliu120","html_url":"https://github.com/yliu120","followers_url":"https://api.github.com/users/yliu120/followers","following_url":"https://api.github.com/users/yliu120/following{/other_user}","gists_url":"https://api.github.com/users/yliu120/gists{/gist_id}","starred_url":"https://api.github.com/users/yliu120/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yliu120/subscriptions","organizations_url":"https://api.github.com/users/yliu120/orgs","repos_url":"https://api.github.com/users/yliu120/repos","events_url":"https://api.github.com/users/yliu120/events{/privacy}","received_events_url":"https://api.github.com/users/yliu120/received_events","type":"User","site_admin":false},"labels":[{"id":151794631,"url":"https://api.github.com/repos/google/protobuf/labels/cla:%20no","name":"cla: no","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-16T05:58:46Z","updated_at":"2016-12-16T05:58:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/2508","html_url":"https://github.com/google/protobuf/pull/2508","diff_url":"https://github.com/google/protobuf/pull/2508.diff","patch_url":"https://github.com/google/protobuf/pull/2508.patch"},"body":"This is a small change on the protobuf.bzl but very reasonable and useful.\r\n\r\nIn practice, a few protobuf client (like tensorflow, see below and etc) would call ```_proto_gen_impl(ctx)``` indirectly to generate proto implementations. However by the current definition of bazel's ctx.action rule (http://www.bazel.io/versions/master/docs/skylark/lib/ctx.html#action), the default user's custom shell env (PATH/LD_LIBRARY_PATH) is not passed to the compiled protoc binary because the user_default_shell_env is set to be ```False``` as default. This will invoke link error cuz users may link protoc with a customized library. There are a lot of reports on this issue.\r\n\r\nIn principle, when calling ```_proto_gen_impl(ctx)``` to generate proto impls, we should pass user's env to the protoc binary.\r\n\r\nAnother small change is to delete an extra space. (a bonus created by my vim editor).\r\n\r\nPlease see some issues related to this small CL:\r\nhttps://github.com/tensorflow/tensorflow/issues/3261\r\n\r\nThis change will not affect any other reasonable implementations.\r\n"},"comment":{"url":"https://api.github.com/repos/google/protobuf/issues/comments/267523348","html_url":"https://github.com/google/protobuf/pull/2508#issuecomment-267523348","issue_url":"https://api.github.com/repos/google/protobuf/issues/2508","id":267523348,"user":{"login":"bazel-io","id":15028808,"avatar_url":"https://avatars.githubusercontent.com/u/15028808?v=3","gravatar_id":"","url":"https://api.github.com/users/bazel-io","html_url":"https://github.com/bazel-io","followers_url":"https://api.github.com/users/bazel-io/followers","following_url":"https://api.github.com/users/bazel-io/following{/other_user}","gists_url":"https://api.github.com/users/bazel-io/gists{/gist_id}","starred_url":"https://api.github.com/users/bazel-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazel-io/subscriptions","organizations_url":"https://api.github.com/users/bazel-io/orgs","repos_url":"https://api.github.com/users/bazel-io/repos","events_url":"https://api.github.com/users/bazel-io/events{/privacy}","received_events_url":"https://api.github.com/users/bazel-io/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T05:58:47Z","updated_at":"2016-12-16T05:58:47Z","body":"Can one of the admins verify this patch?"}}
{"actor":{"display_login":"bazel-io"}}