builder icon indicating copy to clipboard operation
builder copied to clipboard

The failure of one arch does not fail the whole action

Open f18m opened this issue 9 months ago • 1 comments

I'm using for my HA addon the following GHA snippet:

      - name: Docker build and push (tag builds)
        uses: home-assistant/builder@master
        with:
          args: |
            --armv7 --amd64 --aarch64 --i386 \
            --target myaddon \
            --docker-hub ghcr.io/f18m
        if: ${{ needs.check_tag.outputs.is_tag == 'true' }}

I noticed that when e.g. the "aarch64" build fails but the "amd64" arch is OK, the action is declared successful.

Check e.g. attached logs and look for "gcc: internal compiler error"

1_Publish.txt

f18m avatar Mar 02 '25 21:03 f18m

From a quick look at the bash script for this action, it looks like the build_addon Bash function gets executed in a subshell running in background (&):

https://github.com/home-assistant/builder/blob/3f077838878d599260ea699dfe98e5e28ba5da1d/builder.sh#L990

This means that the BUILD_ERROR global variable accessed by the parent bash process can't be updated by the BUILD_ERROR variables set into the children bash processes (https://github.com/home-assistant/builder/blob/3f077838878d599260ea699dfe98e5e28ba5da1d/builder.sh#L336C9-L336C20).

I suggest to switch to the use of a local temporary file as a mean to store errors from children bash processes and propagate them to the parent bash.

WDYT?

I might also propose a PR if there is interest

f18m avatar Mar 02 '25 21:03 f18m