Skip to content

fix(release): stage PGO blob through --rawfile to avoid ARG_MAX#2421

Merged
dunglas merged 2 commits into
mainfrom
fix-release-jq-argmax
May 15, 2026
Merged

fix(release): stage PGO blob through --rawfile to avoid ARG_MAX#2421
dunglas merged 2 commits into
mainfrom
fix-release-jq-argmax

Conversation

@dunglas
Copy link
Copy Markdown
Member

@dunglas dunglas commented May 15, 2026

Summary

The Commit and tag via GitHub API step in release.yaml blew up on its first real dispatch (https://github.com/php/frankenphp/actions/runs/25914409401):

/usr/bin/jq: Argument list too long
gh: Validation Failed (HTTP 422)

jq --arg content "$(base64 -w0 <default.pgo)" ... was passing the ~2 MB base64-encoded PGO blob as a CLI argument, which exceeds the runner's ARG_MAX.

Fix: stage the base64 in a tmpfile and feed it via --rawfile so jq reads it from disk, not the argv. go.mod and go.sum keep going through --rawfile for consistency.

This needs to land before the next release dispatch can succeed.

`jq --arg content "$(base64 -w0 <default.pgo)" ...` failed with
"Argument list too long" on the runner when committing v1.12.3:
the encoded PGO profile is ~2 MB and exceeds ARG_MAX. Write the
base64 to a tmpfile and pass it via --rawfile, which reads from
disk.

https://github.com/php/frankenphp/actions/runs/25914409401
Copilot AI review requested due to automatic review settings May 15, 2026 11:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the GitHub Actions release workflow failure caused by exceeding ARG_MAX when passing a large (~2 MB base64-encoded) PGO profile blob via jq --arg, by staging the base64 content to disk and having jq read it with --rawfile.

Changes:

  • Update make_blob() in release.yaml to write base64 -w0 output to a temp file and pass it to jq via --rawfile instead of embedding the blob in argv.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yaml Outdated
Per Copilot review: with set -euo pipefail, a failure in base64, jq,
or gh api inside make_blob short-circuited before the rm. Wrap the
function body in a subshell and trap EXIT so cleanup always runs.
@dunglas dunglas merged commit d13806a into main May 15, 2026
11 of 12 checks passed
@dunglas dunglas deleted the fix-release-jq-argmax branch May 15, 2026 12:08
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