{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/1144","repository_url":"https://api.github.com/repos/bazelbuild/bazel","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/1144/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/1144/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/1144/events","html_url":"https://github.com/bazelbuild/bazel/issues/1144","id":147795721,"number":1144,"title":"Feature request: enable a way to let genrule targets ignore environment variables such as PATH when computing dependencies","user":{"login":"philbinj","id":87481,"avatar_url":"https://avatars.githubusercontent.com/u/87481?v=3","gravatar_id":"","url":"https://api.github.com/users/philbinj","html_url":"https://github.com/philbinj","followers_url":"https://api.github.com/users/philbinj/followers","following_url":"https://api.github.com/users/philbinj/following{/other_user}","gists_url":"https://api.github.com/users/philbinj/gists{/gist_id}","starred_url":"https://api.github.com/users/philbinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbinj/subscriptions","organizations_url":"https://api.github.com/users/philbinj/orgs","repos_url":"https://api.github.com/users/philbinj/repos","events_url":"https://api.github.com/users/philbinj/events{/privacy}","received_events_url":"https://api.github.com/users/philbinj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-12T15:54:07Z","updated_at":"2016-04-13T07:24:15Z","closed_at":null,"body":"Please see https://groups.google.com/forum/#!msg/bazel-discuss/amRCj3ZQqUI/r4ddp_CYAQAJ for details."},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/209269495","html_url":"https://github.com/bazelbuild/bazel/issues/1144#issuecomment-209269495","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/1144","id":209269495,"user":{"login":"ulfjack","id":7355745,"avatar_url":"https://avatars.githubusercontent.com/u/7355745?v=3","gravatar_id":"","url":"https://api.github.com/users/ulfjack","html_url":"https://github.com/ulfjack","followers_url":"https://api.github.com/users/ulfjack/followers","following_url":"https://api.github.com/users/ulfjack/following{/other_user}","gists_url":"https://api.github.com/users/ulfjack/gists{/gist_id}","starred_url":"https://api.github.com/users/ulfjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulfjack/subscriptions","organizations_url":"https://api.github.com/users/ulfjack/orgs","repos_url":"https://api.github.com/users/ulfjack/repos","events_url":"https://api.github.com/users/ulfjack/events{/privacy}","received_events_url":"https://api.github.com/users/ulfjack/received_events","type":"User","site_admin":false},"created_at":"2016-04-13T07:24:15Z","updated_at":"2016-04-13T07:24:15Z","body":"That would go against our correctness requirements.\r\n\r\nFrom my email, I think a more principled solution could look like this:\r\n- add a PATH-lookup function to genrule (and Skylark action), maybe like this \"$(path-location ls)\"\r\n- evaluate this at execution time, and record the dependency of the action on the PATH env variable at that point\r\n- remove the PATH from the configuration, and from the default genrule / skylark action setup,\r\n  i.e., users have to explicitly declare the PATH dependency\r\n- if you want to get fancy, use a separate SkyFunction to do the path lookup, and use change pruning to avoid re-executing the action if the path changes but the lookup result doesn't"}}