{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/717","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/717/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/717/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/717/events","html_url":"https://github.com/bazelbuild/bazel/issues/717","id":122389293,"number":717,"title":"pkg_tar results in an import error","user":{"login":"rjaquino","id":924555,"avatar_url":"https://avatars.githubusercontent.com/u/924555?v=3","gravatar_id":"","url":"https://api.github.com/users/rjaquino","html_url":"https://github.com/rjaquino","followers_url":"https://api.github.com/users/rjaquino/followers","following_url":"https://api.github.com/users/rjaquino/following{/other_user}","gists_url":"https://api.github.com/users/rjaquino/gists{/gist_id}","starred_url":"https://api.github.com/users/rjaquino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjaquino/subscriptions","organizations_url":"https://api.github.com/users/rjaquino/orgs","repos_url":"https://api.github.com/users/rjaquino/repos","events_url":"https://api.github.com/users/rjaquino/events{/privacy}","received_events_url":"https://api.github.com/users/rjaquino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-15T23:07:24Z","updated_at":"2015-12-17T21:26:05Z","closed_at":null,"body":"I tried to use a pkg_tar rule, and it seems like the py_binary generated is setting PYTHON_PATH to the wrong location. We see the following error:\r\n```sh\r\n  File \"/private/var/tmp/_bazel_asana/6ad5fad239bea6b8300de3d21f3646d8/asana2/bazel-out/host/bin/tools/build_defs/pkg/build_tar.runfiles/luna2/tools/build_defs/pkg/build_tar.py\", line 22, in <module>\r\n    from tools.build_defs.pkg import archive\r\n```\r\n\r\nWhen we modify build_tar.py to print out the PYTHON_PATH it is trying to use, we get `/private/var/tmp/_bazel_asana/6ad5fad239bea6b8300de3d21f3646d8/asana2/bazel-out/host/bin/tools/build_defs/pkg/build_tar.runfiles/`, which is missing the trailing \"luna2\", which is our workspace name. Is there anything we have to do to get the workspace name included in the PYTHON_PATH, or is there something wrong with the build_tar py_binary?"},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/165586690","html_url":"https://github.com/bazelbuild/bazel/issues/717#issuecomment-165586690","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/717","id":165586690,"user":{"login":"kchodorow","id":17042,"avatar_url":"https://avatars.githubusercontent.com/u/17042?v=3","gravatar_id":"","url":"https://api.github.com/users/kchodorow","html_url":"https://github.com/kchodorow","followers_url":"https://api.github.com/users/kchodorow/followers","following_url":"https://api.github.com/users/kchodorow/following{/other_user}","gists_url":"https://api.github.com/users/kchodorow/gists{/gist_id}","starred_url":"https://api.github.com/users/kchodorow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kchodorow/subscriptions","organizations_url":"https://api.github.com/users/kchodorow/orgs","repos_url":"https://api.github.com/users/kchodorow/repos","events_url":"https://api.github.com/users/kchodorow/events{/privacy}","received_events_url":"https://api.github.com/users/kchodorow/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T21:26:05Z","updated_at":"2015-12-17T21:26:05Z","body":"I'd guess that py_binary isn't setting up its runfiles in the right directory.  To work around it for now, can you use the default workspace name (\"\")?"}}