{"push_id":2069988829,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"1b540151bc67cd0edaf0af9ee3ba49aa6d314336","before":"4e24a56647acec866bb8c8f880550d56911dfe92","commits":[{"sha":"1b540151bc67cd0edaf0af9ee3ba49aa6d314336","author":{"name":"Kirill Smelkov","email":"a8ea6389fcdcfe3bb60756de8a7cc258fe2a2eb2@nexedi.com"},"message":"golang: Infrastructure to build Go workspaces / projects\n\nIn Go world development workflow is organized around so-called workspace\nwhere multiple packages can be installed / worked on etc. The following\npage describes Go workspaces:\n\nhttps://golang.org/doc/code.html\n\nA new [gowork] section and infrastructure around it is introduced.\nQuoting code:\n\n    # gowork is a top-level section representing workspace\n    #\n    # users should add `install` field to [gowork] to describe packages they want to\n    # be installed (+ automatically their dependencies are installed too). e.g.\n    #\n    #   [gowork]\n    #   install =\n    #       lab.nexedi.com/kirr/neo/go/...  \\\n    #       github.com/pkg/profile          \\\n    #       golang.org/x/perf/cmd/benchstat\n\nThe way it all works inside is:\n\n- gowork organizes to create go.work/ directory in buildout root\n- inside it creates env.sh which when sources in shell adjusts all paths\n  so that appropriate go compiler is in path, GOPATH is also set\n  appropriately, etc - in other words everything needs for using/working\n  on this workspace is setup in the environment.\n- in actual user software profile the list of Go projects which needs to\n  be installed by SlapOS has to be listed. The [gowork] machinery takes\n  care about git-cloning these projects and `go install`s them after.\n- by SlapOS design builds have to be reproducible and so every component\n  state/version has to be fixed.\n\n  A convenient helper (gowork-snapshot) to get snapshot of git go\n  packages installed with their exact revisions is added. This should be\n  used to automatically (re-)generate list of go git repositories &\n  their pinning for a workspace.\n\nFor a new Go project that needs to be slaposified the workflow should be:\n\n- first get a project into working state via any convenient way (`go get`, etc.)\n- generate list of go packages & their pinning with gowork-snapshot\n- extend golang/buildout.cfg and in project software profile add\n\n\t[gowork]\n  \tinstall = your-top-level-packages\n\n  as it was outlined above.\n\nP.S.\n\n[golang] is removed because\n\n1. it is not used anywhere in slapos.git tree, and\n2. the canonical way to work on go projects from now on will be to use\n   [gowork]. There latest go version is preconfigured, but users can\n   override it to some particular other version in their projects as they\n   need.\n\n/reviewed-on\t https://lab.nexedi.com/nexedi/slapos/merge_requests/242\n/also-needed-for https://lab.nexedi.com/nexedi/slapos/merge_requests/243","distinct":true,"url":"https://api.github.com/repos/SlapOS/slapos/commits/1b540151bc67cd0edaf0af9ee3ba49aa6d314336"}]}
{"actor":{"display_login":"NexediGitlab"}}