Skip to content

feat: improve parallelization in github workflows and Makefile#2436

Merged
cstockton merged 2 commits intomasterfrom
cs/feat-makefile-update
Mar 25, 2026
Merged

feat: improve parallelization in github workflows and Makefile#2436
cstockton merged 2 commits intomasterfrom
cs/feat-makefile-update

Conversation

@cstockton
Copy link
Copy Markdown
Contributor

@cstockton cstockton commented Mar 20, 2026

The primary goals of this PR are:

  • Better parallelization for github workflows and local builds
  • Allow easily running the github workflows locally

Changes:

  • Makefile now describes dependencies among targets to enable parallel jobs
  • Created release target to be called from the release workflow
    • Creates temporary build folders to isolate symlinks
  • Created release-test target to be called form the test workflow
  • Makefile now has a release target which will concurrently build all 4 archives
  • Added -j flag to Makefile so it may create multiple jobs
    • This should leverage all cpus 4 cpu machines we will build on
  • I've made the arch explicit (GOOS=amd64) for x86 binary for safety
  • For now I've preserved the existing targets for "make build" and "make build-strip", but ideally:
    • make build only builds using CGO_ENABLED=0 go build giving native arch for local dev.
    • make release builds all the release binaries, without any env defined values such as CGO_ENABLED=0 go build (it is currently doing this now)
  • I've collapsed the test workflows into one step so they can run concurrently

One note is that the go tool chain does make use of multiple cpus. But there should still be measurable benefits on 4 cpu machines with these changes.

Related:
#2429

The primary goals of this PR are:
* Better parallelization for github workflows and local builds
* Allow easily running the github workflows locally

Changes:
* Makefile now describes dependencies among targets to enable parallel jobs
* Created `release` target to be called from the release workflow
    * Creates temporary build folders to isolate symlinks
* Created `release-test` target to be called form the test workflow
* Makefile now has a release target which will concurrently build all 4 archives
* Added -j flag to Makefile so it may create multiple jobs
    * This should leverage all cpus 4 cpu machines we will build on
* I've made the arch explicit (GOOS=amd64) for x86 binary for safety
* For now I've preserved the existing targets for "make build" and "make build-strip", but ideally:
    * `make build` only builds using `CGO_ENABLED=0 go build` giving native
      arch for local dev.
    * `make release` builds all the release binaries, without any env defined
      values such as `CGO_ENABLED=0 go build` (it is currently doing this now)
* I've collapsed the test workflows into one step so they can run concurrently

One note is that the go tool chain does make use of multiple cpus. But there
should still be measurable benefits on 4 cpu machines with these changes.
Some additional cleanup:
* Added a common build macro that accepts the dest name and
  an optional set of flags to pass to the go linker.
* Removed the redundant -w flag on strip target (it's implied)
* Removed the version file writes and used the optional linker
  flags added in the build macro, since stripped binaries allow
  for -X flags.
@cstockton cstockton merged commit 9d0c4b3 into master Mar 25, 2026
5 checks passed
@cstockton cstockton deleted the cs/feat-makefile-update branch March 25, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants