{"action":"created","issue":{"url":"https://api.github.com/repos/google/bazel/issues/310","labels_url":"https://api.github.com/repos/google/bazel/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/google/bazel/issues/310/comments","events_url":"https://api.github.com/repos/google/bazel/issues/310/events","html_url":"https://github.com/google/bazel/issues/310","id":95379159,"number":310,"title":"Unnecessary recommendation for \"linkstatic=1\"","user":{"login":"fweikert","id":12609729,"avatar_url":"https://avatars.githubusercontent.com/u/12609729?v=3","gravatar_id":"","url":"https://api.github.com/users/fweikert","html_url":"https://github.com/fweikert","followers_url":"https://api.github.com/users/fweikert/followers","following_url":"https://api.github.com/users/fweikert/following{/other_user}","gists_url":"https://api.github.com/users/fweikert/gists{/gist_id}","starred_url":"https://api.github.com/users/fweikert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fweikert/subscriptions","organizations_url":"https://api.github.com/users/fweikert/orgs","repos_url":"https://api.github.com/users/fweikert/repos","events_url":"https://api.github.com/users/fweikert/events{/privacy}","received_events_url":"https://api.github.com/users/fweikert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/bazel/labels/P3","name":"P3","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"gregestren","id":5130366,"avatar_url":"https://avatars.githubusercontent.com/u/5130366?v=3","gravatar_id":"","url":"https://api.github.com/users/gregestren","html_url":"https://github.com/gregestren","followers_url":"https://api.github.com/users/gregestren/followers","following_url":"https://api.github.com/users/gregestren/following{/other_user}","gists_url":"https://api.github.com/users/gregestren/gists{/gist_id}","starred_url":"https://api.github.com/users/gregestren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregestren/subscriptions","organizations_url":"https://api.github.com/users/gregestren/orgs","repos_url":"https://api.github.com/users/gregestren/repos","events_url":"https://api.github.com/users/gregestren/events{/privacy}","received_events_url":"https://api.github.com/users/gregestren/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-07-16T08:26:30Z","updated_at":"2015-07-22T18:53:54Z","closed_at":null,"body":"Bazel sometimes suggests to use linkstatic=1, even though it is not necessary.\r\n\r\nOriginal error report: https://groups.google.com/forum/#!topic/bazel-discuss/XcmwEnJSDNU"},"comment":{"url":"https://api.github.com/repos/google/bazel/issues/comments/123826376","html_url":"https://github.com/google/bazel/issues/310#issuecomment-123826376","issue_url":"https://api.github.com/repos/google/bazel/issues/310","id":123826376,"user":{"login":"bsilver8192","id":2999225,"avatar_url":"https://avatars.githubusercontent.com/u/2999225?v=3","gravatar_id":"","url":"https://api.github.com/users/bsilver8192","html_url":"https://github.com/bsilver8192","followers_url":"https://api.github.com/users/bsilver8192/followers","following_url":"https://api.github.com/users/bsilver8192/following{/other_user}","gists_url":"https://api.github.com/users/bsilver8192/gists{/gist_id}","starred_url":"https://api.github.com/users/bsilver8192/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsilver8192/subscriptions","organizations_url":"https://api.github.com/users/bsilver8192/orgs","repos_url":"https://api.github.com/users/bsilver8192/repos","events_url":"https://api.github.com/users/bsilver8192/events{/privacy}","received_events_url":"https://api.github.com/users/bsilver8192/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T18:53:54Z","updated_at":"2015-07-22T18:53:54Z","body":"I can't reproduce this any more. I don't remember exactly which version I was using, but I am only seeing the warning in configurations which don't have any .cc files in srcs with a recent one. Before, I (at least though I) was seeing the warning in all configurations, even ones in which there was a .cc file in srcs. I think this bug should be closed now. Thanks for looking into it.\r\n\r\nSome extra details:\r\nA simple case like you mentioned (filegroup(name = 'my_filegroup', srcs = [''empty.h])) does trigger the warning in the current version and probably would in the original one too, but it's correct.\r\n\r\nThat comment at https://github.com/google/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java#L366 disagrees with what I have observed about the actual behavior; I haven't seen any way in which the name of a filegroup affects whether the warning appears or not.\r\n\r\nThe actual rules where I was hitting the warning seem to have been some combination of this issue and an intermediate cc_library I missed before which actually had only headers in one configuration."}}