{"action":"created","issue":{"url":"https://api.github.com/repos/bazelbuild/rules_go/issues/10","repository_url":"https://api.github.com/repos/bazelbuild/rules_go","labels_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/10/comments","events_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/10/events","html_url":"https://github.com/bazelbuild/rules_go/pull/10","id":145553003,"number":10,"title":"cgo support","user":{"login":"yugui","id":8161,"avatar_url":"https://avatars.githubusercontent.com/u/8161?v=3","gravatar_id":"","url":"https://api.github.com/users/yugui","html_url":"https://github.com/yugui","followers_url":"https://api.github.com/users/yugui/followers","following_url":"https://api.github.com/users/yugui/following{/other_user}","gists_url":"https://api.github.com/users/yugui/gists{/gist_id}","starred_url":"https://api.github.com/users/yugui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugui/subscriptions","organizations_url":"https://api.github.com/users/yugui/orgs","repos_url":"https://api.github.com/users/yugui/repos","events_url":"https://api.github.com/users/yugui/events{/privacy}","received_events_url":"https://api.github.com/users/yugui/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bazelbuild/rules_go/labels/cla:%20yes","name":"cla: yes","color":"0e8a16"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-03T23:38:39Z","updated_at":"2016-04-11T20:49:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bazelbuild/rules_go/pulls/10","html_url":"https://github.com/bazelbuild/rules_go/pull/10","diff_url":"https://github.com/bazelbuild/rules_go/pull/10.diff","patch_url":"https://github.com/bazelbuild/rules_go/pull/10.patch"},"body":"Adds a new macro `cgo_library`, which wraps build steps with cgo.\r\nSee the following thread in bazel-dev for the overall design.\r\n\r\n* https://groups.google.com/d/msg/bazel-dev/xFcxQyaxQec/YqIYjqA2CAAJ\r\n\r\nSupported:\r\n* Both Linux and Darwin\r\n* Import types and functions from C/C++ to Go sources\r\n* Export Go funtions to C/C++ sources within a package\r\n* Add dependency to `cc_library` rules\r\n* Build a package which contains both cgo-enabled sources and pure-Go\r\n  sources.\r\n\r\nUnsupported:\r\n* Export Go packages to C binaries, a.k.a `-buildmode=c-archive` or\r\n  `-buildmode=c-shared`.\r\n* Directly or indirectly depend on prebuilt dynamic libraries on Darwin.\r\n  i.e. `cgo_library` cannot depend on cc_library rules which contain *.so\r\n  files in their srcs.\r\n* Something like `cc_binary.linkstatic=0`, which is most similar to the\r\n  default behavior of \"go build\".\r\n  Instead, go rules always try to mostly statically link dependencies\r\n  unless the dependency has only *.so.\r\n\r\n# TODO\r\n- [x] read the path to `ld` from CROSSTOOL.  Avoid hard-coded value.\r\n  https://groups.google.com/d/msg/bazel-discuss/lPQc4nc-PBc/SQcZKAquAgAJ\r\n- [ ] document `cgo_libray` in `README.md`?"},"comment":{"url":"https://api.github.com/repos/bazelbuild/rules_go/issues/comments/208555854","html_url":"https://github.com/bazelbuild/rules_go/pull/10#issuecomment-208555854","issue_url":"https://api.github.com/repos/bazelbuild/rules_go/issues/10","id":208555854,"user":{"login":"davidzchen","id":5283042,"avatar_url":"https://avatars.githubusercontent.com/u/5283042?v=3","gravatar_id":"","url":"https://api.github.com/users/davidzchen","html_url":"https://github.com/davidzchen","followers_url":"https://api.github.com/users/davidzchen/followers","following_url":"https://api.github.com/users/davidzchen/following{/other_user}","gists_url":"https://api.github.com/users/davidzchen/gists{/gist_id}","starred_url":"https://api.github.com/users/davidzchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidzchen/subscriptions","organizations_url":"https://api.github.com/users/davidzchen/orgs","repos_url":"https://api.github.com/users/davidzchen/repos","events_url":"https://api.github.com/users/davidzchen/events{/privacy}","received_events_url":"https://api.github.com/users/davidzchen/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T20:49:49Z","updated_at":"2016-04-11T20:49:49Z","body":"Thanks for working on this, @yugui!\r\n\r\n[Skydoc](https://github.com/bazelbuild/skydoc) is the documentation generation tool for Skylark rules (think Doxygen or epydoc for Skylark). See the [Skydoc documentation](https://github.com/bazelbuild/skydoc/blob/master/README.md) and [`skylark.bzl`](https://github.com/bazelbuild/skydoc/blob/master/skylark/skylark.bzl) for examples.\r\n\r\nAs @damienmg mentioned, we are still in the process of integrating Skydoc with the documentation pipeline. In the meantime, can you add the documentation for the new rules to the README in addition to the docstrings? That way, we can directly switch over once Skydoc is integrated, but people can still read the documentation in the README in the meantime."}}