fix(build): portable awk header matching and correct stderr redirects#453
Merged
Conversation
1. capture_upstream_metadata (container entrypoint) and the equivalent
step in upstream-build-app.yml matched HTTP headers with
`BEGIN{IGNORECASE=1}`, a gawk extension that is an inert variable
under mawk - the default awk in the ubuntu:24.04 CI container and on
ubuntu runners. Real responses send capitalized Last-Modified / ETag
/ Content-Length, so the recorded upstream DMG metadata silently
degraded to "unknown" / "no-etag". Match on tolower($0) instead,
like the equivalent parser in scripts/lib/dmg.sh.
2. native-modules.sh used `2>&1 >&2` on the npm install and
electron-rebuild steps. Redirections apply left to right, so this
merges stderr into stdout and leaves stdout where it was - the
inverse of the intended "keep build chatter on stderr" convention
used everywhere else in the install pipeline. Use `>&2`.
ilysenko
approved these changes
Jun 11, 2026
ilysenko
left a comment
Owner
There was a problem hiding this comment.
Reviewed. No blocking issues found; CI is green and the build/CI portability fixes are scoped and safe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Two small build/CI plumbing fixes.
Upstream DMG metadata capture silently degraded to
unknownunder mawk.capture_upstream_metadatainscripts/ci/container-entrypoint.shand the equivalent step in.github/workflows/upstream-build-app.ymlmatched HTTP response headers withawk 'BEGIN{IGNORECASE=1} /^last-modified:/ ...'.IGNORECASEis a gawk extension; under mawk — the defaultawkin theubuntu:24.04CI container and on ubuntu runners — it is an inert variable, and real responses send capitalizedLast-Modified/ETag/Content-Length, so all three lookups returned empty and the recorded metadata fell back tounknown/no-etag. Now matches ontolower($0), like the equivalent parser inscripts/lib/dmg.sh.Verified against real mawk:
2>&1 >&2inscripts/lib/native-modules.shdid the opposite of intent. Redirections apply left to right:2>&1points stderr at current stdout, then>&2points stdout at the (already-redirected) stderr — net effect, stderr merges into stdout and stdout is unchanged. The evident intent (keep npm/electron-rebuild chatter on stderr, the convention everywhere else in the install pipeline) is>&2.Source-of-truth files
scripts/ci/container-entrypoint.sh.github/workflows/upstream-build-app.ymlscripts/lib/native-modules.shValidation
bash -nacross install/lib/launcher/build/ci scripts — cleanbash tests/scripts_smoke.shon this branch in Ubuntu (WSL): All script smoke tests passedmawk 1.3.4on Ubuntu (WSL)Notes / limitations