Skip to content

fix(ci): fix clang build failure and DockerHub image ref errors - #73

Merged
volschin merged 2 commits into
mainfrom
claude/fix-build-workflow-UuxSK
Mar 28, 2026
Merged

fix(ci): fix clang build failure and DockerHub image ref errors#73
volschin merged 2 commits into
mainfrom
claude/fix-build-workflow-UuxSK

Conversation

@volschin

Copy link
Copy Markdown
Collaborator

Summary

  • build.yml: -Wno-error=maybe-uninitialized was applied to both gcc and clang, but clang doesn't recognise that warning name and rejects it as an error under -Werror. Switch matrix to include entries so gcc gets the suppression flag and clang does not (clang builds aes.c cleanly without it).
  • docker-image.yml: When DOCKER_USERNAME secret is unset, ${{ secrets.DOCKER_USERNAME }}/hmcfgusb evaluates 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

  • Build (gcc): compiles with -Wno-error=maybe-uninitialized, aes.c false positives suppressed
  • Build (clang): compiles with -Werror only, no unknown-warning-option error
  • Docker push without DOCKER_USERNAME secret: only pushes to ghcr.io, no invalid-ref error
  • Docker push with DOCKER_USERNAME secret: pushes to both ghcr.io and DockerHub
  • Cosign signing: only signs registries that were actually pushed to

https://claude.ai/code/session_012GUFo63miXVwTirEo4ApxZ

claude added 2 commits March 28, 2026 10:35
…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
@volschin
volschin merged commit df75c40 into main Mar 28, 2026
8 checks passed
@volschin
volschin deleted the claude/fix-build-workflow-UuxSK branch March 28, 2026 10:51
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