{"id":42147823,"url":"https://github.com/peter-mount/go-build","last_synced_at":"2026-01-26T18:00:13.477Z","repository":{"id":176690029,"uuid":"657328868","full_name":"peter-mount/go-build","owner":"peter-mount","description":"Common build environment for all of my go projects","archived":false,"fork":false,"pushed_at":"2025-02-18T20:01:29.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-18T21:21:55.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peter-mount.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-22T20:30:40.000Z","updated_at":"2025-02-18T20:01:33.000Z","dependencies_parsed_at":"2023-11-09T12:27:44.567Z","dependency_job_id":"8a4d3685-fef2-4409-9611-97ee82fc66d3","html_url":"https://github.com/peter-mount/go-build","commit_stats":null,"previous_names":["peter-mount/go-build"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peter-mount/go-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-mount%2Fgo-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-mount%2Fgo-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-mount%2Fgo-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-mount%2Fgo-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter-mount","download_url":"https://codeload.github.com/peter-mount/go-build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-mount%2Fgo-build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28784093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-26T18:00:12.051Z","updated_at":"2026-01-26T18:00:13.466Z","avatar_url":"https://github.com/peter-mount.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-build\n\nThis is the build system for all of my go projects going forward.\nExisting projects are going to be migrated to this system.\n\nIt supports the building of multiple executables, cross compiling against every\noperating system and cpu architecture supported by the installed go environment.\n\nAt the time of writing with GO 1.20.5 that's 15 Operating Systems and 14 CPU architectures.\n\n## Performing builds\n\nIn normal use, running `make clean all` will compile the project for every supported combination.\n\nTo build for just one then you need to tell make which platform(s) you want.\n\ne.g.\n\n    PLATFORMS=linux:amd64: make clean all\n\nwill compile just for Linux on the amd64 processor.\n\nFor multiple architectures then provide them on the same line.\n\ne.g.\n\n    ;PLATFORMS=\"linux:amd64: linux:arm64: darwin:arm64:\" make clean all\n\nwill compile for Linux on the amd64 and arm64 processors as well as for MacOS on\narm64 (Apple Silicon).\n\nThe format for the platform declaration is operatingSystem:cpuArchitecture:variant\n\nIn most cases the variant is blank and is only used for 32-bit ARM processors.\n\ne.g. `linux:arm:7` would be for the ARM7 processor used on later Raspberry PI's with a\n32-bit operating system. Earlier PI's would need `linux:arm:6`.\n\nNB:\n\n* For Raspberry PI's with a 64-bit operating system you would use `linux:arm64:`\n* For MacOS, use `darwin:amd64:` for Intel based Mac's and\n  `darwin:arm64:` for Apple Silicon Mac's (tested with M1 and M1-Max)\n\n## Layout of projects\n\nThere is only a single constraint on how a project is laid out:\nEach binary to compile must be defined under the tools directory.\n\nSpecifically, for a tool called `mybinary` then you need to have it's `main()` method\ndefined in the file `tools/mybinary/bin/main.go`.\n\nWhen the build environment runs it will look for all instances of main.go and generate\nthe appropriate entries in a Makefile for each tool.\n\nNote: the `build` tool is special and will not be included in your final distributions.\n\n# Configuring your project\n\nYou need to setup a few files within your project:\n\n## Makefile\n\nThis is the bootstrap for the build environment.\nYou just need to copy the one in this project to the root of your project for it to work.\n\n## .gitignore\n\nYou need to have the following entries in your `.gitignore` file, as these files are temporary.\n\n    /build\n    /builds/\n    /dist/\n    /Makefile.gen\n\n* `build` is the build executable compiled and run by the environment,\n* `builds` is the directory where your project will be built,\n* `dist` is where tar and zip files of your project will be placed,\n* `Makefile.gen` is the Makefile the environment creates to build your project.\n\n## tools/build/bin/main.go\n\nThis is the entry point of the environment.\nAt a bare minimum for simple projects this should be a copy of what is here, specifically:\n\n    package main\n    \n    import (\n        \"fmt\"\n        _ \"github.com/peter-mount/go-build/tools/build\"\n        \"github.com/peter-mount/go-kernel/v2\"\n        \"os\"\n    )\n    \n    func main() {\n        if err := kernel.Launch(); err != nil {\n            fmt.Println(err)\n            os.Exit(1)\n        }\n    }\n\nMore complex projects can extend the environment to support deploying additional artifacts\nin the build. This will be documented later but examples are [go-script](https://github.com/peter-mount/go-script)\nand [piweather.center](https://github.com/peter-mount/piweather.center) which were the projects\nthe build environment was originally developed for.\n\n# Generated files\n\nIn addition to the files included in `.gitignore` the environment generates two additional files\nwhich should be committed with your project, as they only change when you change go version.\n\n* `Jenkinsfile` is to allow [Jenkins](https://www.jenkins.io/) to build your project with the\n  MultiBranchPipeline plugin.\n* `platforms.md` is a markdown file listing each Operating System and CPU architecture the build\n  environment will compile for when you do not declare which platform to use.\n\n# Blocked platforms\n\nThere is a list of platforms supported by GO which are blocked by the environment.\nThese are listed in `util/arch/blocklist.go` and contain the following:\n\n* `android:*:` and `ios:*:` - not sure how you would run anything on those platforms\n* `js:*:` this is for web assembly - so unlikely to be useful for most projects\n* `openbsd:mips64:` this is due to a bug in recent versions of go which can randomly\n  [cause builds to fail](https://github.com/peter-mount/piweather.center/issues/1).\n  This will be unblocked when they fix that issue. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-mount%2Fgo-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter-mount%2Fgo-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-mount%2Fgo-build/lists"}