{"action":"created","issue":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/1390","repository_url":"https://api.github.com/repos/hyperledger/fabric","labels_url":"https://api.github.com/repos/hyperledger/fabric/issues/1390/labels{/name}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/1390/comments","events_url":"https://api.github.com/repos/hyperledger/fabric/issues/1390/events","html_url":"https://github.com/hyperledger/fabric/pull/1390","id":153529406,"number":1390,"title":"Use make to build fabric","user":{"login":"ghaskins","id":367132,"avatar_url":"https://avatars.githubusercontent.com/u/367132?v=3","gravatar_id":"","url":"https://api.github.com/users/ghaskins","html_url":"https://github.com/ghaskins","followers_url":"https://api.github.com/users/ghaskins/followers","following_url":"https://api.github.com/users/ghaskins/following{/other_user}","gists_url":"https://api.github.com/users/ghaskins/gists{/gist_id}","starred_url":"https://api.github.com/users/ghaskins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghaskins/subscriptions","organizations_url":"https://api.github.com/users/ghaskins/orgs","repos_url":"https://api.github.com/users/ghaskins/repos","events_url":"https://api.github.com/users/ghaskins/events{/privacy}","received_events_url":"https://api.github.com/users/ghaskins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-06T20:14:14Z","updated_at":"2016-05-06T20:14:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/1390","html_url":"https://github.com/hyperledger/fabric/pull/1390","diff_url":"https://github.com/hyperledger/fabric/pull/1390.diff","patch_url":"https://github.com/hyperledger/fabric/pull/1390.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\n    This patch adds a top-level makefile for managing builds and dependencies\r\n\r\n## Motivation and Context\r\n    Our current environment relies heavily on vagrant performing a good deal of the\r\n    preparation such that we can perform operations like \"cd peer; go build\".  One\r\n    minor problem is that a common vagrant-based workflow is to subsequently update\r\n    the code and rebuild without necessarily rebuilding the vagrant environment\r\n    (e.g. git pull && go build).  Any dependency changes in the underlying code\r\n    may not be properly satisfied with such a workflow.\r\n\r\n    To make matters more complicated, many other environments outside vagrant\r\n    exist (e.g. TravisCI, non vagrant based development environments, production\r\n    deployments, etc).  These environments are even more adversely affected with\r\n    extrinsic dependencies.  Work has been done (see the ./scripts/provisioning\r\n    area for an example) to try to help unify the different environments to\r\n    a single source of truth.  Despite this, we still struggle to provide a smooth\r\n    experience because these mechanisms need to be understood by all and\r\n    incorporated into the relevant workflows.  Often times, developers/users\r\n    don't even know these problems/mechanisms exist until they find things broken\r\n    in typically non-obvious ways.\r\n\r\n    Whats needed is an easy way to operate with a more self-contained approach\r\n    such that we can support the \"git pull && do-it\" type workflow.  However,\r\n    we also need to observe that the \"go\" tooling is probably ill equiped for\r\n    anything except the most basic of pure go development:  It intentionally\r\n    doesn't support external hooks, etc, as you would find in a general build\r\n    framework like Make or Maven.  Once you have a polyglot and/or dependencies\r\n    on external facilities (e.g. docker, protobuf, etc) starts to feel more\r\n    closer to \"gcc\" than to \"make\".\r\n\r\n    This isn't necessarily a bad thing, but trying to centralize our tooling\r\n    on a \"go\" tool based workflow I suspect is a large part of the current pain\r\n    being felt.  Instead, lets embrace it for what I believe it was intended\r\n    to do really well (compile go code), and augment it with a tool that\r\n    is better suited to managing a polyglot/external-dep universe, of which\r\n    golang is just one part.\r\n\r\n    There are many build frameworks to choose from, but Make is ubiquitous,\r\n    well understood, and well suited to the task.  I therefore think\r\n    it makes a perfectly reasonable approach to serve as the centerpoint\r\n    of our build system.\r\n\r\n    The intention is that developers/packagers/etc migrate to using make\r\n    in conjunction with the targets listed above rather than the raw commands\r\n    that have been historically employed.  While the old methods should\r\n    continue to work, the new workflow can incorporate more automation that\r\n    will help keep the build process running smoothly and adapting to future\r\n    requirements without users needing to be aware.  In this new model, the\r\n    typical workflow would become:\r\n\r\n         git pull && make clean peer\r\n\r\n    This should generally allow most things to either be:\r\n\r\n         a) automatically managed\r\n\r\n          OR\r\n\r\n         b) cleanly reported when automation cannot solve the problem (e.g.\r\n            external dependencies that need to be manually installed).\r\n\r\n    I believe this should lay the groundwork for a vast improvement over the\r\n    current process.\r\n\r\n## How Has This Been Tested?\r\nBooted a clean vagrant environment, and using the new facilities:\r\n\r\nmake unit-test\r\nmake behave\r\n\r\nAll passed without any errors.\r\n \r\n## Checklist:\r\n- [x] I have added a [Signed-off-by](https://github.com/hyperledger/fabric/blob/master/CONTRIBUTING.md#legal-stuff)\r\n- [x] If applicable, I have updated the documentation accordingly.\r\n- [x] If applicable, I have added tests to cover my changes.\r\n\r\nSigned-off-by: Greg Haskins <gregory.haskins@gmail.com>\r\n"},"comment":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/comments/217547070","html_url":"https://github.com/hyperledger/fabric/pull/1390#issuecomment-217547070","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/1390","id":217547070,"user":{"login":"ghaskins","id":367132,"avatar_url":"https://avatars.githubusercontent.com/u/367132?v=3","gravatar_id":"","url":"https://api.github.com/users/ghaskins","html_url":"https://github.com/ghaskins","followers_url":"https://api.github.com/users/ghaskins/followers","following_url":"https://api.github.com/users/ghaskins/following{/other_user}","gists_url":"https://api.github.com/users/ghaskins/gists{/gist_id}","starred_url":"https://api.github.com/users/ghaskins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghaskins/subscriptions","organizations_url":"https://api.github.com/users/ghaskins/orgs","repos_url":"https://api.github.com/users/ghaskins/repos","events_url":"https://api.github.com/users/ghaskins/events{/privacy}","received_events_url":"https://api.github.com/users/ghaskins/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T20:14:41Z","updated_at":"2016-05-06T20:14:41Z","body":"Supersedes PR #1374 "}}