{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/strangemonad/buck/pulls/2","id":49074734,"html_url":"https://github.com/strangemonad/buck/pull/2","diff_url":"https://github.com/strangemonad/buck/pull/2.diff","patch_url":"https://github.com/strangemonad/buck/pull/2.patch","issue_url":"https://api.github.com/repos/strangemonad/buck/issues/2","number":2,"state":"open","locked":false,"title":"Scope IjModule COMPILED_SHADOW library dep to the 'compile' scope.","user":{"login":"strangemonad","id":133905,"avatar_url":"https://avatars.githubusercontent.com/u/133905?v=3","gravatar_id":"","url":"https://api.github.com/users/strangemonad","html_url":"https://github.com/strangemonad","followers_url":"https://api.github.com/users/strangemonad/followers","following_url":"https://api.github.com/users/strangemonad/following{/other_user}","gists_url":"https://api.github.com/users/strangemonad/gists{/gist_id}","starred_url":"https://api.github.com/users/strangemonad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangemonad/subscriptions","organizations_url":"https://api.github.com/users/strangemonad/orgs","repos_url":"https://api.github.com/users/strangemonad/repos","events_url":"https://api.github.com/users/strangemonad/events{/privacy}","received_events_url":"https://api.github.com/users/strangemonad/received_events","type":"User","site_admin":false},"body":"Note: this patch is a sketch of an approach and actually introduces a regression to\r\nthe correctness of 'provided_deps'. See the last comment as we figure out the correct approach.\r\n\r\nSummary: a java_library IJModule's exported_deps become dependency graph nodes\r\nof type COMPILED_SHADOW and are then included in the IJModule as a 'provided' library rather\r\nthan a 'compile' library.\r\n\r\nIt's unclear how IJ would ever get that provided dep on its classpath. An example of a 'provided'\r\ndep would be acrypto provide like Bouncy castle that's installed into the jdk on the machine and\r\nautomatically included in the classpath of the jvm or slf4j that's included at runtime via another lib.\r\n\r\nHere's an example to make it more concrete. Consider the following buck dependency chain:\r\n\r\nmy_app:java_binary -> my_lib:java_library -> my_lib_compiled_java_protos:java_libary -> my_lib_java_protos:genrule\r\n\r\nIn this setup, my_lib.exported_deps = [':my_lib_compiled_java_protos'] where the leaf\r\nlibrary is a buck 'java_library' in the module graph that was built simply by defining a\r\n'java_library' who's sources are the java files output by protoc in the ':my_lib_java_protos'\r\ntarget.\r\n\r\nBy the time AbstractIjLibrary#addAsDependency is reached, we fall into the\r\n`if (dependencyType.equals(IjModuleGraph.DependencyType.COMPILED_SHADOW))` branch which\r\ncalls IjDependencyListBuilder#addCompiledShadow (its only caller).\r\n\r\nAdditionally, I think there might be 2 other bugs hiding in here\r\n\r\n1) we unconditionally add the lib as 'exported', this should depend on whether the compiled\r\nshadow lib was included in 'deps' or 'exported_deps'\r\n\r\n2) We should properly handle 'provided_deps' for both COMPILED_SHADOW and PROD/TEST types\r\nas well. This patch breaks the first but the later dep types are always included as 'compile'.","created_at":"2015-10-28T22:15:18Z","updated_at":"2015-10-28T22:15:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/strangemonad/buck/pulls/2/commits","review_comments_url":"https://api.github.com/repos/strangemonad/buck/pulls/2/comments","review_comment_url":"https://api.github.com/repos/strangemonad/buck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strangemonad/buck/issues/2/comments","statuses_url":"https://api.github.com/repos/strangemonad/buck/statuses/f7854efc8124df4fabfdd04b7c663dcaccc47eaa","head":{"label":"strangemonad:shawn/ijmodule_compiled_shadow_libs","ref":"shawn/ijmodule_compiled_shadow_libs","sha":"f7854efc8124df4fabfdd04b7c663dcaccc47eaa","user":{"login":"strangemonad","id":133905,"avatar_url":"https://avatars.githubusercontent.com/u/133905?v=3","gravatar_id":"","url":"https://api.github.com/users/strangemonad","html_url":"https://github.com/strangemonad","followers_url":"https://api.github.com/users/strangemonad/followers","following_url":"https://api.github.com/users/strangemonad/following{/other_user}","gists_url":"https://api.github.com/users/strangemonad/gists{/gist_id}","starred_url":"https://api.github.com/users/strangemonad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangemonad/subscriptions","organizations_url":"https://api.github.com/users/strangemonad/orgs","repos_url":"https://api.github.com/users/strangemonad/repos","events_url":"https://api.github.com/users/strangemonad/events{/privacy}","received_events_url":"https://api.github.com/users/strangemonad/received_events","type":"User","site_admin":false},"repo":{"id":44885684,"name":"buck","full_name":"strangemonad/buck","owner":{"login":"strangemonad","id":133905,"avatar_url":"https://avatars.githubusercontent.com/u/133905?v=3","gravatar_id":"","url":"https://api.github.com/users/strangemonad","html_url":"https://github.com/strangemonad","followers_url":"https://api.github.com/users/strangemonad/followers","following_url":"https://api.github.com/users/strangemonad/following{/other_user}","gists_url":"https://api.github.com/users/strangemonad/gists{/gist_id}","starred_url":"https://api.github.com/users/strangemonad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangemonad/subscriptions","organizations_url":"https://api.github.com/users/strangemonad/orgs","repos_url":"https://api.github.com/users/strangemonad/repos","events_url":"https://api.github.com/users/strangemonad/events{/privacy}","received_events_url":"https://api.github.com/users/strangemonad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/strangemonad/buck","description":"A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.","fork":true,"url":"https://api.github.com/repos/strangemonad/buck","forks_url":"https://api.github.com/repos/strangemonad/buck/forks","keys_url":"https://api.github.com/repos/strangemonad/buck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strangemonad/buck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strangemonad/buck/teams","hooks_url":"https://api.github.com/repos/strangemonad/buck/hooks","issue_events_url":"https://api.github.com/repos/strangemonad/buck/issues/events{/number}","events_url":"https://api.github.com/repos/strangemonad/buck/events","assignees_url":"https://api.github.com/repos/strangemonad/buck/assignees{/user}","branches_url":"https://api.github.com/repos/strangemonad/buck/branches{/branch}","tags_url":"https://api.github.com/repos/strangemonad/buck/tags","blobs_url":"https://api.github.com/repos/strangemonad/buck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strangemonad/buck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strangemonad/buck/git/refs{/sha}","trees_url":"https://api.github.com/repos/strangemonad/buck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strangemonad/buck/statuses/{sha}","languages_url":"https://api.github.com/repos/strangemonad/buck/languages","stargazers_url":"https://api.github.com/repos/strangemonad/buck/stargazers","contributors_url":"https://api.github.com/repos/strangemonad/buck/contributors","subscribers_url":"https://api.github.com/repos/strangemonad/buck/subscribers","subscription_url":"https://api.github.com/repos/strangemonad/buck/subscription","commits_url":"https://api.github.com/repos/strangemonad/buck/commits{/sha}","git_commits_url":"https://api.github.com/repos/strangemonad/buck/git/commits{/sha}","comments_url":"https://api.github.com/repos/strangemonad/buck/comments{/number}","issue_comment_url":"https://api.github.com/repos/strangemonad/buck/issues/comments{/number}","contents_url":"https://api.github.com/repos/strangemonad/buck/contents/{+path}","compare_url":"https://api.github.com/repos/strangemonad/buck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strangemonad/buck/merges","archive_url":"https://api.github.com/repos/strangemonad/buck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strangemonad/buck/downloads","issues_url":"https://api.github.com/repos/strangemonad/buck/issues{/number}","pulls_url":"https://api.github.com/repos/strangemonad/buck/pulls{/number}","milestones_url":"https://api.github.com/repos/strangemonad/buck/milestones{/number}","notifications_url":"https://api.github.com/repos/strangemonad/buck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strangemonad/buck/labels{/name}","releases_url":"https://api.github.com/repos/strangemonad/buck/releases{/id}","created_at":"2015-10-24T21:30:04Z","updated_at":"2015-10-24T21:30:24Z","pushed_at":"2015-10-28T22:15:18Z","git_url":"git://github.com/strangemonad/buck.git","ssh_url":"git@github.com:strangemonad/buck.git","clone_url":"https://github.com/strangemonad/buck.git","svn_url":"https://github.com/strangemonad/buck","homepage":"http://buckbuild.com","size":278986,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"strangemonad:master","ref":"master","sha":"a31052aa6914ba078dfd968ac3849bb894b6c41c","user":{"login":"strangemonad","id":133905,"avatar_url":"https://avatars.githubusercontent.com/u/133905?v=3","gravatar_id":"","url":"https://api.github.com/users/strangemonad","html_url":"https://github.com/strangemonad","followers_url":"https://api.github.com/users/strangemonad/followers","following_url":"https://api.github.com/users/strangemonad/following{/other_user}","gists_url":"https://api.github.com/users/strangemonad/gists{/gist_id}","starred_url":"https://api.github.com/users/strangemonad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangemonad/subscriptions","organizations_url":"https://api.github.com/users/strangemonad/orgs","repos_url":"https://api.github.com/users/strangemonad/repos","events_url":"https://api.github.com/users/strangemonad/events{/privacy}","received_events_url":"https://api.github.com/users/strangemonad/received_events","type":"User","site_admin":false},"repo":{"id":44885684,"name":"buck","full_name":"strangemonad/buck","owner":{"login":"strangemonad","id":133905,"avatar_url":"https://avatars.githubusercontent.com/u/133905?v=3","gravatar_id":"","url":"https://api.github.com/users/strangemonad","html_url":"https://github.com/strangemonad","followers_url":"https://api.github.com/users/strangemonad/followers","following_url":"https://api.github.com/users/strangemonad/following{/other_user}","gists_url":"https://api.github.com/users/strangemonad/gists{/gist_id}","starred_url":"https://api.github.com/users/strangemonad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangemonad/subscriptions","organizations_url":"https://api.github.com/users/strangemonad/orgs","repos_url":"https://api.github.com/users/strangemonad/repos","events_url":"https://api.github.com/users/strangemonad/events{/privacy}","received_events_url":"https://api.github.com/users/strangemonad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/strangemonad/buck","description":"A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.","fork":true,"url":"https://api.github.com/repos/strangemonad/buck","forks_url":"https://api.github.com/repos/strangemonad/buck/forks","keys_url":"https://api.github.com/repos/strangemonad/buck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strangemonad/buck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strangemonad/buck/teams","hooks_url":"https://api.github.com/repos/strangemonad/buck/hooks","issue_events_url":"https://api.github.com/repos/strangemonad/buck/issues/events{/number}","events_url":"https://api.github.com/repos/strangemonad/buck/events","assignees_url":"https://api.github.com/repos/strangemonad/buck/assignees{/user}","branches_url":"https://api.github.com/repos/strangemonad/buck/branches{/branch}","tags_url":"https://api.github.com/repos/strangemonad/buck/tags","blobs_url":"https://api.github.com/repos/strangemonad/buck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strangemonad/buck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strangemonad/buck/git/refs{/sha}","trees_url":"https://api.github.com/repos/strangemonad/buck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strangemonad/buck/statuses/{sha}","languages_url":"https://api.github.com/repos/strangemonad/buck/languages","stargazers_url":"https://api.github.com/repos/strangemonad/buck/stargazers","contributors_url":"https://api.github.com/repos/strangemonad/buck/contributors","subscribers_url":"https://api.github.com/repos/strangemonad/buck/subscribers","subscription_url":"https://api.github.com/repos/strangemonad/buck/subscription","commits_url":"https://api.github.com/repos/strangemonad/buck/commits{/sha}","git_commits_url":"https://api.github.com/repos/strangemonad/buck/git/commits{/sha}","comments_url":"https://api.github.com/repos/strangemonad/buck/comments{/number}","issue_comment_url":"https://api.github.com/repos/strangemonad/buck/issues/comments{/number}","contents_url":"https://api.github.com/repos/strangemonad/buck/contents/{+path}","compare_url":"https://api.github.com/repos/strangemonad/buck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strangemonad/buck/merges","archive_url":"https://api.github.com/repos/strangemonad/buck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strangemonad/buck/downloads","issues_url":"https://api.github.com/repos/strangemonad/buck/issues{/number}","pulls_url":"https://api.github.com/repos/strangemonad/buck/pulls{/number}","milestones_url":"https://api.github.com/repos/strangemonad/buck/milestones{/number}","notifications_url":"https://api.github.com/repos/strangemonad/buck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strangemonad/buck/labels{/name}","releases_url":"https://api.github.com/repos/strangemonad/buck/releases{/id}","created_at":"2015-10-24T21:30:04Z","updated_at":"2015-10-24T21:30:24Z","pushed_at":"2015-10-28T22:15:18Z","git_url":"git://github.com/strangemonad/buck.git","ssh_url":"git@github.com:strangemonad/buck.git","clone_url":"https://github.com/strangemonad/buck.git","svn_url":"https://github.com/strangemonad/buck","homepage":"http://buckbuild.com","size":278986,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strangemonad/buck/pulls/2"},"html":{"href":"https://github.com/strangemonad/buck/pull/2"},"issue":{"href":"https://api.github.com/repos/strangemonad/buck/issues/2"},"comments":{"href":"https://api.github.com/repos/strangemonad/buck/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/strangemonad/buck/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/strangemonad/buck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strangemonad/buck/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/strangemonad/buck/statuses/f7854efc8124df4fabfdd04b7c663dcaccc47eaa"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":1,"changed_files":2}}