fix(ci): fix clang build failure and DockerHub image ref errors - #73
Merged
Conversation
…rkflow Clang does not recognise -Wmaybe-uninitialized and rejects -Wno-error=maybe-uninitialized as an unknown warning option, which becomes a hard error under -Werror. The suppression is only needed for GCC 14 false positives in aes.c; clang builds aes.c cleanly without it. Switch the build matrix from a simple cc list to matrix.include entries so each compiler can carry its own extra_cflags. https://claude.ai/code/session_012GUFo63miXVwTirEo4ApxZ
When DOCKER_USERNAME is not configured as a repository secret the docker_meta step was producing an invalid image reference (/hmcfgusb:tag) which caused the build-and-push step to fail with an authentication / invalid-registry error, and the cosign signing step to attempt signing a non-existent image. Two fixes: 1. docker_meta images: use a conditional expression so the DockerHub image is only included when DOCKER_USERNAME is non-empty; an empty string is silently filtered by metadata-action. 2. cosign signing loop: add a case statement that only appends DockerHub tags when DOCKER_USERNAME is set, so cosign never tries to sign an image that was not actually pushed. https://claude.ai/code/session_012GUFo63miXVwTirEo4ApxZ
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.
Summary
-Wno-error=maybe-uninitializedwas applied to both gcc and clang, but clang doesn't recognise that warning name and rejects it as an error under-Werror. Switch matrix toincludeentries so gcc gets the suppression flag and clang does not (clang buildsaes.ccleanly without it).DOCKER_USERNAMEsecret is unset,${{ secrets.DOCKER_USERNAME }}/hmcfgusbevaluates to/hmcfgusb— an invalid image reference that breaks the build-and-push step. Use a conditional expression to omit the DockerHub image when the secret is empty. Also guard the cosign signing loop so it only signs DockerHub tags when credentials are actually configured.Test plan
-Wno-error=maybe-uninitialized, aes.c false positives suppressed-Werroronly, no unknown-warning-option errorDOCKER_USERNAMEsecret: only pushes to ghcr.io, no invalid-ref errorDOCKER_USERNAMEsecret: pushes to both ghcr.io and DockerHubhttps://claude.ai/code/session_012GUFo63miXVwTirEo4ApxZ