{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/buck/issues/488","labels_url":"https://api.github.com/repos/facebook/buck/issues/488/labels{/name}","comments_url":"https://api.github.com/repos/facebook/buck/issues/488/comments","events_url":"https://api.github.com/repos/facebook/buck/issues/488/events","html_url":"https://github.com/facebook/buck/pull/488","id":113936606,"number":488,"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},"labels":[{"url":"https://api.github.com/repos/facebook/buck/labels/CLA%20Signed","name":"CLA Signed","color":"009900"},{"url":"https://api.github.com/repos/facebook/buck/labels/GH%20Review:%20review-needed","name":"GH Review: review-needed","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-28T22:09:24Z","updated_at":"2015-10-29T16:38:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/buck/pulls/488","html_url":"https://github.com/facebook/buck/pull/488","diff_url":"https://github.com/facebook/buck/pull/488.diff","patch_url":"https://github.com/facebook/buck/pull/488.patch"},"body":"related to https://github.com/facebook/buck/pull/478\r\n\r\nNote: 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'."},"comment":{"url":"https://api.github.com/repos/facebook/buck/issues/comments/152240919","html_url":"https://github.com/facebook/buck/pull/488#issuecomment-152240919","issue_url":"https://api.github.com/repos/facebook/buck/issues/488","id":152240919,"user":{"login":"marcinkosiba","id":3844309,"avatar_url":"https://avatars.githubusercontent.com/u/3844309?v=3","gravatar_id":"","url":"https://api.github.com/users/marcinkosiba","html_url":"https://github.com/marcinkosiba","followers_url":"https://api.github.com/users/marcinkosiba/followers","following_url":"https://api.github.com/users/marcinkosiba/following{/other_user}","gists_url":"https://api.github.com/users/marcinkosiba/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinkosiba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinkosiba/subscriptions","organizations_url":"https://api.github.com/users/marcinkosiba/orgs","repos_url":"https://api.github.com/users/marcinkosiba/repos","events_url":"https://api.github.com/users/marcinkosiba/events{/privacy}","received_events_url":"https://api.github.com/users/marcinkosiba/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T16:38:00Z","updated_at":"2015-10-29T16:38:00Z","body":"got some feedback that this sounds differently to what I intended to say, so let me rephrase: I think the approach is correct and we will most likely take the diff, it's just that making the IntelliJ project build with IntelliJ is not the best thing to focus on."}}