{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/2339","repository_url":"https://api.github.com/repos/bazelbuild/bazel","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2339/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2339/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2339/events","html_url":"https://github.com/bazelbuild/bazel/issues/2339","id":198867966,"number":2339,"title":"access cpp binary from python binary","user":{"login":"cnsgsz","id":1569955,"avatar_url":"https://avatars.githubusercontent.com/u/1569955?v=3","gravatar_id":"","url":"https://api.github.com/users/cnsgsz","html_url":"https://github.com/cnsgsz","followers_url":"https://api.github.com/users/cnsgsz/followers","following_url":"https://api.github.com/users/cnsgsz/following{/other_user}","gists_url":"https://api.github.com/users/cnsgsz/gists{/gist_id}","starred_url":"https://api.github.com/users/cnsgsz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnsgsz/subscriptions","organizations_url":"https://api.github.com/users/cnsgsz/orgs","repos_url":"https://api.github.com/users/cnsgsz/repos","events_url":"https://api.github.com/users/cnsgsz/events{/privacy}","received_events_url":"https://api.github.com/users/cnsgsz/received_events","type":"User","site_admin":false},"labels":[{"id":392619826,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/category:%20rules%20%3E%20C++","name":"category: rules > C++","color":"d4c5f9","default":false},{"id":392619755,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/category:%20rules%20%3E%20python","name":"category: rules > python","color":"d4c5f9","default":false},{"id":106503262,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/Under%20investigation","name":"Under investigation","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":{"login":"lberki","id":3524818,"avatar_url":"https://avatars.githubusercontent.com/u/3524818?v=3","gravatar_id":"","url":"https://api.github.com/users/lberki","html_url":"https://github.com/lberki","followers_url":"https://api.github.com/users/lberki/followers","following_url":"https://api.github.com/users/lberki/following{/other_user}","gists_url":"https://api.github.com/users/lberki/gists{/gist_id}","starred_url":"https://api.github.com/users/lberki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lberki/subscriptions","organizations_url":"https://api.github.com/users/lberki/orgs","repos_url":"https://api.github.com/users/lberki/repos","events_url":"https://api.github.com/users/lberki/events{/privacy}","received_events_url":"https://api.github.com/users/lberki/received_events","type":"User","site_admin":false},"assignees":[{"login":"lberki","id":3524818,"avatar_url":"https://avatars.githubusercontent.com/u/3524818?v=3","gravatar_id":"","url":"https://api.github.com/users/lberki","html_url":"https://github.com/lberki","followers_url":"https://api.github.com/users/lberki/followers","following_url":"https://api.github.com/users/lberki/following{/other_user}","gists_url":"https://api.github.com/users/lberki/gists{/gist_id}","starred_url":"https://api.github.com/users/lberki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lberki/subscriptions","organizations_url":"https://api.github.com/users/lberki/orgs","repos_url":"https://api.github.com/users/lberki/repos","events_url":"https://api.github.com/users/lberki/events{/privacy}","received_events_url":"https://api.github.com/users/lberki/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-01-05T03:23:13Z","updated_at":"2017-01-31T13:55:26Z","closed_at":null,"body":"I have a python test named foo whose main is foo.py that depends on cpp binary. I have it set up as recommended in #703. It works when it is run in bazel test.\r\n\r\nHowever, I sometimes want to run the python test manually by invoking foo (the executable python script that's generated by bazel that sits in the same bazel-bin directory as foo.runfiles). However it complains that the cpp binary cannot be found.\r\n\r\nI tried something like #231, but sys.argv[0] points to foo.py and it does not seem straightforward to get the cpp binary path from there?\r\n\r\nIt is not just for python test. Sometime I have a python binary that depends on cpp binary too. But I assume they are similar.\r\n\r\nSince bazel generates foo and put the specified data in foo.runfiles already, it seems natural that I should be able to just specify some relative path as in #703, call foo from any cwd, and foo does the work to make sure the cpp binary can be found based on the relative path? Or is it possible for foo to pass foo.py some environment variable RUNFILES_DIR that foo.py can use like os.path.join(RUNFILES_DIR, \"relative/path/to/cpp/binary\")?"},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/276368709","html_url":"https://github.com/bazelbuild/bazel/issues/2339#issuecomment-276368709","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2339","id":276368709,"user":{"login":"lberki","id":3524818,"avatar_url":"https://avatars.githubusercontent.com/u/3524818?v=3","gravatar_id":"","url":"https://api.github.com/users/lberki","html_url":"https://github.com/lberki","followers_url":"https://api.github.com/users/lberki/followers","following_url":"https://api.github.com/users/lberki/following{/other_user}","gists_url":"https://api.github.com/users/lberki/gists{/gist_id}","starred_url":"https://api.github.com/users/lberki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lberki/subscriptions","organizations_url":"https://api.github.com/users/lberki/orgs","repos_url":"https://api.github.com/users/lberki/repos","events_url":"https://api.github.com/users/lberki/events{/privacy}","received_events_url":"https://api.github.com/users/lberki/received_events","type":"User","site_admin":false},"created_at":"2017-01-31T13:55:26Z","updated_at":"2017-01-31T13:55:26Z","body":"So, after some consultation with @ulfjack , I realized that we can't solve this in a principled way without figuring out how runfiles trees should work in general. Therefore, I'm changing this bug to \"we should really figure out how runfiles trees should work\" in general."}}
{"actor":{"display_login":"lberki"}}