{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/6664","repository_url":"https://api.github.com/repos/bazelbuild/bazel","labels_url":"https://api.github.com/repos/bazelbuild/bazel/issues/6664/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/bazel/issues/6664/comments","events_url":"https://api.github.com/repos/bazelbuild/bazel/issues/6664/events","html_url":"https://github.com/bazelbuild/bazel/issues/6664","id":379941707,"node_id":"MDU6SXNzdWUzNzk5NDE3MDc=","number":6664,"title":"External repository reference not overridden by http_archive","user":{"login":"smukherj1","id":8533249,"node_id":"MDQ6VXNlcjg1MzMyNDk=","avatar_url":"https://avatars2.githubusercontent.com/u/8533249?v=4","gravatar_id":"","url":"https://api.github.com/users/smukherj1","html_url":"https://github.com/smukherj1","followers_url":"https://api.github.com/users/smukherj1/followers","following_url":"https://api.github.com/users/smukherj1/following{/other_user}","gists_url":"https://api.github.com/users/smukherj1/gists{/gist_id}","starred_url":"https://api.github.com/users/smukherj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smukherj1/subscriptions","organizations_url":"https://api.github.com/users/smukherj1/orgs","repos_url":"https://api.github.com/users/smukherj1/repos","events_url":"https://api.github.com/users/smukherj1/events{/privacy}","received_events_url":"https://api.github.com/users/smukherj1/received_events","type":"User","site_admin":false},"labels":[{"id":601152907,"node_id":"MDU6TGFiZWw2MDExNTI5MDc=","url":"https://api.github.com/repos/bazelbuild/bazel/labels/more%20data%20needed","name":"more data needed","color":"bfdadc","default":false},{"id":106503261,"node_id":"MDU6TGFiZWwxMDY1MDMyNjE=","url":"https://api.github.com/repos/bazelbuild/bazel/labels/type:%20feature%20request","name":"type: feature request","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-12T20:33:28Z","updated_at":"2018-11-13T21:34:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description of the problem / feature request:\r\nSample reproducible test case at https://github.com/smukherj1/bazel_http_archive_issue\r\nI attempt to use the bazel_skylib repository. This is first loaded by the external repository loader macro call here (https://github.com/smukherj1/bazel_http_archive_issue/blob/master/WORKSPACE#L15) and then loaded using an explicit http_archive call here https://github.com/smukherj1/bazel_http_archive_issue/blob/master/WORKSPACE#L28. The second call uses a version that actually has the file being loaded here (https://github.com/smukherj1/bazel_http_archive_issue/blob/master/BUILD#L2). However, if you try to run \"bazel build :bardocs\", it will fail with the error\r\n`ERROR: error loading package '': Extension file not found. Unable to load file '@bazel_skylib//:bzl_library.bzl': file doesn't exist or isn't a file`\r\n\r\nIf you comment out this line (https://github.com/smukherj1/bazel_http_archive_issue/blob/master/WORKSPACE#L25) the error goes away! I have no idea why\r\n\r\n### Feature requests: what underlying problem are you trying to solve with this feature?\r\nIn my opinion, the second http_archive call should define the external archive available in the build files. When I print out the rule attributes using a macro to print the features of native.existing_rules, I see that the attributes are being overridden. But I'm not sure why the BUILD file doesn't see it and why the error disappears when I comment out the line I mentioned.\r\n\r\nAlso, does it make sense to display this information via bazel query? It would really help to see via bazel query what the resolved attributes of a external repository is. My macro was something like the following:-\r\n`\r\ndef defined_so_far(msg):\r\n    print(\"Begin ({})\".format(msg))\r\n    for target, r in native.existing_rules().items():\r\n        print(\"Target: {}\".format(target))\r\n        for attr, val in r.items():\r\n            if not val:\r\n                continue\r\n            print(\"\\t{} = {}\".format(attr, val))\r\n    print(\"End ({})\".format(msg))\r\n`\r\n\r\n### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.\r\n\r\nClone https://github.com/smukherj1/bazel_http_archive_issue and run bazel build :barlib\r\n\r\n### What operating system are you running Bazel on?\r\ngLinux\r\n\r\n### What's the output of `bazel info release`?\r\n0.19.1\r\n"},"comment":{"url":"https://api.github.com/repos/bazelbuild/bazel/issues/comments/438446034","html_url":"https://github.com/bazelbuild/bazel/issues/6664#issuecomment-438446034","issue_url":"https://api.github.com/repos/bazelbuild/bazel/issues/6664","id":438446034,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODQ0NjAzNA==","user":{"login":"smukherj1","id":8533249,"node_id":"MDQ6VXNlcjg1MzMyNDk=","avatar_url":"https://avatars2.githubusercontent.com/u/8533249?v=4","gravatar_id":"","url":"https://api.github.com/users/smukherj1","html_url":"https://github.com/smukherj1","followers_url":"https://api.github.com/users/smukherj1/followers","following_url":"https://api.github.com/users/smukherj1/following{/other_user}","gists_url":"https://api.github.com/users/smukherj1/gists{/gist_id}","starred_url":"https://api.github.com/users/smukherj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smukherj1/subscriptions","organizations_url":"https://api.github.com/users/smukherj1/orgs","repos_url":"https://api.github.com/users/smukherj1/repos","events_url":"https://api.github.com/users/smukherj1/events{/privacy}","received_events_url":"https://api.github.com/users/smukherj1/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T21:34:33Z","updated_at":"2018-11-13T21:34:33Z","author_association":"CONTRIBUTOR","body":"Thanks for explaining this! Is it currently possible to query the attributes (url, version, etc) of a resolved external repository name using bazel query? If not, does it make sense to add one to debug these situations? \r\n\r\nIdeally, it would be most helpful if we could get some information on which load statement froze the repository resolution or the last executed http_archive location if not yet frozen but that's probably a stretch :)"}}
{"actor":{"display_login":"smukherj1"}}