{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/2310","repository_url":"https://api.github.com/repos/bazelbuild/bazel","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2310/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2310/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2310/events","html_url":"https://github.com/bazelbuild/bazel/issues/2310","id":198019857,"number":2310,"title":"Transitive dependencies are not always included","user":{"login":"arjantop","id":52403,"avatar_url":"https://avatars.githubusercontent.com/u/52403?v=3","gravatar_id":"","url":"https://api.github.com/users/arjantop","html_url":"https://github.com/arjantop","followers_url":"https://api.github.com/users/arjantop/followers","following_url":"https://api.github.com/users/arjantop/following{/other_user}","gists_url":"https://api.github.com/users/arjantop/gists{/gist_id}","starred_url":"https://api.github.com/users/arjantop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjantop/subscriptions","organizations_url":"https://api.github.com/users/arjantop/orgs","repos_url":"https://api.github.com/users/arjantop/repos","events_url":"https://api.github.com/users/arjantop/events{/privacy}","received_events_url":"https://api.github.com/users/arjantop/received_events","type":"User","site_admin":false},"labels":[{"id":236480963,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/category:%20extensibility%20%3E%20migration%20tooling","name":"category: extensibility > migration tooling","color":"d4c5f9","default":false},{"id":106503259,"url":"https://api.github.com/repos/bazelbuild/bazel/labels/type:%20bug","name":"type: bug","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":1,"created_at":"2016-12-29T14:58:42Z","updated_at":"2016-12-30T12:09:56Z","closed_at":null,"body":"### Description\r\n\r\nWhen using `generate_workspace` transitive dependencies are not always included in the `exports` parameter of `java_library`. This does not always happen (one guess would be that this happens when two artifacts share some common dependencies).\r\n\r\n### Example\r\n\r\n`bazel run //src/tools/generate_workspace -- --artifact=com.twitter:twitter-server_2.11:1.25.0`\r\n\r\nOutput:\r\n```\r\njava_library(\r\n    name = \"com_twitter_twitter_server_2_11\",\r\n    visibility = [\"//visibility:public\"],\r\n    exports = [\r\n        \"@com_twitter_twitter_server_2_11//jar\",\r\n        \"@com_fasterxml_jackson_core_jackson_annotations//jar\",\r\n        \"@com_fasterxml_jackson_core_jackson_core//jar\",\r\n        \"@com_fasterxml_jackson_core_jackson_databind//jar\",\r\n        \"@com_fasterxml_jackson_module_jackson_module_paranamer//jar\",\r\n        \"@com_fasterxml_jackson_module_jackson_module_scala_2_11//jar\",\r\n        \"@com_github_ben_manes_caffeine_caffeine//jar\",\r\n        \"@com_google_code_findbugs_jsr305//jar\",\r\n        \"@com_google_guava_guava//jar\",\r\n        \"@com_thoughtworks_paranamer_paranamer//jar\",\r\n        \"@com_twitter_finagle_base_http_2_11//jar\",\r\n        \"@com_twitter_finagle_core_2_11//jar\",\r\n        \"@com_twitter_finagle_http_2_11//jar\",\r\n        \"@com_twitter_finagle_netty4_2_11//jar\",\r\n        \"@com_twitter_finagle_netty4_http_2_11//jar\",\r\n        \"@com_twitter_finagle_thrift_2_11//jar\",\r\n        \"@com_twitter_finagle_toggle_2_11//jar\",\r\n        \"@com_twitter_finagle_zipkin_core_2_11//jar\",\r\n        \"@com_twitter_libthrift//jar\",\r\n        \"@com_twitter_scrooge_core_2_11//jar\",\r\n        \"@com_twitter_util_app_2_11//jar\",\r\n        \"@com_twitter_util_cache_2_11//jar\",\r\n        \"@com_twitter_util_codec_2_11//jar\",\r\n        \"@com_twitter_util_collection_2_11//jar\",\r\n        \"@com_twitter_util_core_2_11//jar\",\r\n        \"@com_twitter_util_events_2_11//jar\",\r\n        \"@com_twitter_util_function_2_11//jar\",\r\n        \"@com_twitter_util_hashing_2_11//jar\",\r\n        \"@com_twitter_util_jvm_2_11//jar\",\r\n        \"@com_twitter_util_lint_2_11//jar\",\r\n        \"@com_twitter_util_logging_2_11//jar\",\r\n        \"@com_twitter_util_registry_2_11//jar\",\r\n        \"@com_twitter_util_stats_2_11//jar\",\r\n        \"@commons_lang_commons_lang//jar\",\r\n        \"@io_netty_netty//jar\",\r\n        \"@io_netty_netty_buffer//jar\",\r\n        \"@io_netty_netty_codec//jar\",\r\n        \"@io_netty_netty_codec_http//jar\",\r\n        \"@io_netty_netty_codec_socks//jar\",\r\n        \"@io_netty_netty_common//jar\",\r\n        \"@io_netty_netty_handler//jar\",\r\n        \"@io_netty_netty_handler_proxy//jar\",\r\n        \"@io_netty_netty_resolver//jar\",\r\n        \"@io_netty_netty_transport//jar\",\r\n        \"@javax_servlet_servlet_api//jar\",\r\n        \"@org_scala_lang_modules_scala_parser_combinators_2_11//jar\",\r\n        \"@org_scala_lang_scala_library//jar\",\r\n        \"@org_scala_lang_scala_reflect//jar\",\r\n        \"@org_slf4j_slf4j_api//jar\",\r\n    ],\r\n)\r\n```\r\n\r\n```\r\nbazel run //src/tools/generate_workspace -- \\\r\n  --artifact=com.twitter:finagle-thrift_2.11:6.40.0 \\\r\n  --artifact=com.twitter:twitter-server_2.11:1.25.0\r\n```\r\n\r\nOutput (transitive dependencies are missing):\r\n```\r\njava_library(\r\n    name = \"com_twitter_twitter_server_2_11\",\r\n    visibility = [\"//visibility:public\"],\r\n    exports = [\r\n        \"@com_twitter_twitter_server_2_11//jar\",\r\n        \"@com_fasterxml_jackson_core_jackson_core//jar\",\r\n        \"@com_fasterxml_jackson_core_jackson_databind//jar\",\r\n        \"@com_fasterxml_jackson_module_jackson_module_scala_2_11//jar\",\r\n        \"@com_google_guava_guava//jar\",\r\n        \"@com_twitter_finagle_base_http_2_11//jar\",\r\n        \"@com_twitter_finagle_core_2_11//jar\",\r\n        \"@com_twitter_finagle_http_2_11//jar\",\r\n        \"@com_twitter_finagle_netty4_2_11//jar\",\r\n        \"@com_twitter_finagle_netty4_http_2_11//jar\",\r\n        \"@com_twitter_finagle_thrift_2_11//jar\",\r\n        \"@com_twitter_finagle_toggle_2_11//jar\",\r\n        \"@com_twitter_finagle_zipkin_core_2_11//jar\",\r\n        \"@com_twitter_libthrift//jar\",\r\n        \"@com_twitter_scrooge_core_2_11//jar\",\r\n        \"@com_twitter_util_app_2_11//jar\",\r\n        \"@com_twitter_util_codec_2_11//jar\",\r\n        \"@com_twitter_util_collection_2_11//jar\",\r\n        \"@com_twitter_util_core_2_11//jar\",\r\n        \"@com_twitter_util_events_2_11//jar\",\r\n        \"@com_twitter_util_jvm_2_11//jar\",\r\n        \"@com_twitter_util_lint_2_11//jar\",\r\n        \"@com_twitter_util_logging_2_11//jar\",\r\n        \"@com_twitter_util_registry_2_11//jar\",\r\n        \"@com_twitter_util_stats_2_11//jar\",\r\n        \"@commons_lang_commons_lang//jar\",\r\n        \"@io_netty_netty_codec_http//jar\",\r\n        \"@org_scala_lang_scala_library//jar\",\r\n    ],\r\n)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/269764768","html_url":"https://github.com/bazelbuild/bazel/issues/2310#issuecomment-269764768","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/2310","id":269764768,"user":{"login":"arjantop","id":52403,"avatar_url":"https://avatars.githubusercontent.com/u/52403?v=3","gravatar_id":"","url":"https://api.github.com/users/arjantop","html_url":"https://github.com/arjantop","followers_url":"https://api.github.com/users/arjantop/followers","following_url":"https://api.github.com/users/arjantop/following{/other_user}","gists_url":"https://api.github.com/users/arjantop/gists{/gist_id}","starred_url":"https://api.github.com/users/arjantop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjantop/subscriptions","organizations_url":"https://api.github.com/users/arjantop/orgs","repos_url":"https://api.github.com/users/arjantop/repos","events_url":"https://api.github.com/users/arjantop/events{/privacy}","received_events_url":"https://api.github.com/users/arjantop/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T12:09:56Z","updated_at":"2016-12-30T12:09:56Z","body":"I think the problem is here: https://github.com/bazelbuild/bazel/blob/master/src/tools/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/Resolver.java#L166\r\n\r\nNew instance of Rule is created and transitive dependencies are resolved and added only in the case that the dependency is new. If the dependency already exists the dependencies will never be populated and https://github.com/bazelbuild/bazel/blob/master/src/tools/generate_workspace/src/main/java/com/google/devtools/build/workspace/maven/Resolver.java#L185 will have no effect."}}
{"actor":{"display_login":"arjantop"}}