Skip to content

feat: improve parallelization in github workflows and Makefile - #2436

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

cstockton merged 2 commits into
masterfrom
cs/feat-makefile-update

Conversation

@cstockton

@cstockton cstockton commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

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.
Comment thread Makefile Resolved
Comment thread Makefile Resolved
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
fadymak pushed a commit that referenced this pull request Apr 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.189.0](v2.188.1...v2.189.0)
(2026-04-23)


### Features

* add PKCE support for `/resend`
([#2401](#2401))
([2af904a](2af904a))
* improve parallelization in github workflows and Makefile
([#2436](#2436))
([9d0c4b3](9d0c4b3))
* **passkeys:** add CAPTCHA to options endpoint for authentication
([#2416](#2416))
([c7b58be](c7b58be))
* support live reloading of individual rate limits
([#2469](#2469))
([d03d796](d03d796))


### Bug Fixes

* ensure identities are returned in a consistent order across DB engines
([#2465](#2465))
([e49a3e5](e49a3e5))
* ensure SSO providers tests are order-independent
([#2466](#2466))
([983ade6](983ade6))
* exempt PKCE recovery sessions from require-current-password check
([#2502](#2502))
([7f88985](7f88985))
* **indexworker:** skip index creation on OrioleDB
([#2481](#2481))
([dd56ae9](dd56ae9))
* **passkeys:** modify the passkeys request and response shapes
([#2475](#2475))
([2d8f2b6](2d8f2b6))
* prevent reuse of flow state
([#2483](#2483))
([88dcb2d](88dcb2d))
* return JSON response for unmatched routes instead of plain text
([#2457](#2457))
([7337e21](7337e21))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
cstockton added a commit that referenced this pull request Jul 14, 2026
## What

Every `auth-v*-darwin-arm64.tar.gz` release asset since `rc2.189.0-rc.1`
contains a **Linux ELF binary** under the darwin name, so it can never
execute on macOS:

```
$ file auth   # from auth-v2.192.0-darwin-arm64.tar.gz
auth: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked
```

The cause is one token in the Makefile — the `auth-darwin-arm64` recipe
sets `GOOS=linux`, a copy-paste of the `auth-arm64` recipe above it:

```makefile
auth-darwin-arm64: deps
	CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(call BUILD_CMD,$(@),)
```

This PR changes it to `GOOS=darwin` and adds a `verify-release` target
so a name/content divergence fails the release instead of shipping.

## Timeline

- #2400 introduced the darwin-arm64 build **correctly** (`GOOS=darwin`,
merged 2026-03-02); v2.188.0/v2.188.1 shipped genuine Mach-O binaries.
- #2436 restructured the inline release builds into per-target rules for
parallelization (merged 2026-03-25); the new `auth-darwin-arm64` rule
was written with `GOOS=linux`.
- Every release from `rc2.189.0-rc.1` onward ships the mislabeled binary
— verified with `file(1)` against `v2.188.1` (Mach-O, the pre-regression
control), `v2.189.0`, `v2.191.0`, `v2.192.0`, `v2.192.1-rc.2`, and
`v2.193.0-rc.3` (all ELF).

## Why nothing caught it

The archive **name** comes from the make target stem, while the archive
**content** comes from the recipe's env vars — nothing checks that they
agree. The release-notes checksums are computed over the same wrong
binary, so checksum verification can't catch it either. Downstream, the
consumer this asset appears to have been added for (the local stack's
native mode in supabase/cli) restart-loops the un-executable binary with
no diagnostic, so the failure never surfaced as a report.

The new `verify-release` target closes that structural gap. It hooks
into the existing `release` target, so it runs inside the current `make
release` CI step — no workflow change needed:

```makefile
verify-release: $(foreach t,$(RELEASE_TARGETS),release-$(t)/auth)
	file release-x86/auth | grep -q 'ELF'
	file release-arm64/auth | grep -q 'ELF'
	file release-darwin-arm64/auth | grep -q 'Mach-O'
	file release-amd64-strip/auth | grep -q 'ELF'
	file release-arm64-strip/auth | grep -q 'ELF'
```

## Verification

- With the fix: `make release-darwin-arm64/auth && make verify-release`
passes, `file` reports `Mach-O 64-bit executable arm64`, and the binary
executes on a darwin-arm64 host (prints usage).
- Guard checked in both directions: reverting the `GOOS` token and
rebuilding makes `make verify-release` fail the build (`make: ***
[verify-release] Error 1`).
- The v2.188.1 assets prove the darwin cross-compile has always worked
from the Linux runners (pure Go, `CGO_ENABLED=0`) — only the env var was
wrong.

Existing release assets can't be fixed retroactively; the first release
after this lands ships the first working darwin-arm64 binary since
v2.188.1.

---------

Co-authored-by: Chris Stockton <[email protected]>
Co-authored-by: Chris Stockton <[email protected]>
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