Re: [PATCH gnumach] CI: Email failures to commit-hurd

Diego Nieto Cid <[email protected]> Mon, 3 Aug 2026 10:07:00 -0300
Newsgroups gmane.os.hurd.bugs
Message-ID <CAK5adC70QL4dJqG0x=q7ywtaYEeUazy7DiEkjECMB0V6rWP0wQ@mail.gmail.com>
--00000000000060611706582437ad
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi

El lun, 3 ago 2026 a las 8:43, Damien Zammit (<[email protected]>)
escribi=C3=B3:

> This will email gzipped error logs to commit-hurd AT gnu.org from any
> forgejo instance set up as a mirror.  This is facilitated by
> not specifying any domain or user specific configuration, but to
> execute the mailing code path, the repository must be called "gnumach"
> and the branch that was synced be "master".
> If the mail command is not configured in the CI, it will simply fail
> to send mail and the failing test will not be reported.
> Since there is only one instance currently set up, we won't get
> duplicated reports.


Cool!

---
>  .forgejo/workflows/action.yaml | 39 ++++++++++++++++++++++++++++------
>  1 file changed, 33 insertions(+), 6 deletions(-)
>
> diff --git a/.forgejo/workflows/action.yaml
> b/.forgejo/workflows/action.yaml
> index ef3ed81d..6ea930b3 100644
> --- a/.forgejo/workflows/action.yaml
> +++ b/.forgejo/workflows/action.yaml
> @@ -52,8 +52,22 @@ jobs:
>                    --disable-linux-groups \
>                    ${{ matrix.platform }} \
>                    ${{ matrix.kdb }}
> -          make gnumach.gz
> -          make VERBOSE=3Dtrue check
> +          set -o pipefail
> +          make gnumach.gz 2>&1 | tee ../error.log
> +          make VERBOSE=3Dtrue check 2>&1 | tee ../error.log


Only the "make check" output would end in the error.log. Tee overwrites the
output file unless the "-a" flag is passed. Is this intentional?


> +      - name: Email failures
> +        if: failure()
> +        run: |
> +          echo "CI failure: gnumach i386 on commit ${{ forgejo.SHA }}
> with options ${{ matrix.platform }} ${{ matrix.kdb }}"
> +          if [ `basename ${{ forgejo.REPOSITORY }}` =3D=3D "gnumach" ] &=
& [
> ${{ forgejo.REF_NAME }} =3D=3D "master" ]; then
> +            gzip -9 error.log
> +            echo "CI failure: gnumach i386 master on commit ${{
> forgejo.SHA }} with options ${{ matrix.platform }} ${{ matrix.kdb }}" | \
> +              mail -a error.log.gz -s "[CI fail]: gnumach i386 ${{
> forgejo.SHA }} (${{ matrix.platform }} ${{ matrix.kdb }})" \
> +                [email protected]
> +          fi
> +          exit 1
> +
>    x86_64:
>      runs-on: self
>      strategy:
> @@ -101,9 +115,10 @@ jobs:
>            TARGET_CPPFLAGS=3D-I"$GNU"/include TARGET_CC=3Dx86_64-linux-gn=
u-gcc
> ../configure --prefix=3D"$GNU" --target=3Dx86_64-gnu
>            make all install
>            cd ../..
> +          mkdir gnu32
> +          GNU32=3D$(realpath gnu32)
>            if [ "$USER_H" =3D=3D "i686" ]; then
>              # We need i386 headers to build mig 32bit
> -            mkdir gnu32
>              mkdir build32
>              cd build32
>              ../configure --prefix=3D --host=3Di686-gnu
> LD=3D"x86_64-linux-gnu-ld -melf_i386" CC=3D"x86_64-linux-gnu-gcc -m32" \
> @@ -115,7 +130,6 @@ jobs:
>              cd mig
>              mkdir build32
>              cd build32
> -            GNU32=3D$(realpath ../../gnu32)
>              TARGET_CPPFLAGS=3D-I"$GNU32"/include
> TARGET_CC=3D"x86_64-linux-gnu-gcc -m32" TARGET_LD=3D"x86_64-linux-gnu-ld
> -melf_i386" ../configure --prefix=3D"$GNU32" --target=3Di686-gnu
>              make all install
>              cd ../..
> @@ -130,5 +144,18 @@ jobs:
>                    ${{ matrix.platform }} \
>                    ${{ matrix.user32 }} \
>                    ${{ matrix.kdb }}
> -          make gnumach.gz
> -          make VERBOSE=3Dtrue check
> +          set -o pipefail
> +          make gnumach.gz 2>&1 | tee ../error.log
> +          make VERBOSE=3Dtrue check 2>&1 | tee ../error.log
>

Same here.


> +      - name: Email failures
> +        if: failure()
> +        run: |
> +          echo "CI failure: gnumach amd64 on commit ${{ forgejo.SHA }}
> with options ${{ matrix.platform }} ${{ matrix.user32 }} ${{ matrix.kdb }=
}"
> +          if [ `basename ${{ forgejo.REPOSITORY }}` =3D=3D "gnumach" ] &=
& [
> ${{ forgejo.REF_NAME }} =3D=3D "master" ]; then
> +            gzip -9 error.log
> +            echo "CI failure: gnumach amd64 master on commit ${{
> forgejo.SHA }} with options ${{ matrix.platform }} ${{ matrix.user32 }} $=
{{
> matrix.kdb }}" | \
> +              mail -a error.log.gz -s "[CI fail]: gnumach amd64 ${{
> forgejo.SHA }} (${{ matrix.platform }} ${{ matrix.user32 }} ${{ matrix.kd=
b
> }})" \
> +                [email protected]
> +          fi
> +          exit 1
> --
> 2.51.0
>
>
Cheers.

--00000000000060611706582437ad
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:arial,sans-serif">Hi</div></div><br><div class=3D"gmail_quote gmai=
l_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">El lun, 3 ago 2026=
 a las 8:43, Damien Zammit (&lt;<a href=3D"mailto:[email protected]">dami=
[email protected]</a>&gt;) escribi=C3=B3:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex">This will email gzipped error logs to commit-hurd A=
T <a href=3D"http://gnu.org" rel=3D"noreferrer" target=3D"_blank">gnu.org</=
a> from any<br>
forgejo instance set up as a mirror.=C2=A0 This is facilitated by<br>
not specifying any domain or user specific configuration, but to<br>
execute the mailing code path, the repository must be called &quot;gnumach&=
quot;<br>
and the branch that was synced be &quot;master&quot;.<br>
If the mail command is not configured in the CI, it will simply fail<br>
to send mail and the failing test will not be reported.<br>
Since there is only one instance currently set up, we won&#39;t get<br>
duplicated reports.</blockquote><div><br></div><div><div class=3D"gmail_def=
ault" style=3D"font-family:arial,sans-serif">Cool!</div></div><div><br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
=C2=A0.forgejo/workflows/action.yaml | 39 ++++++++++++++++++++++++++++-----=
-<br>
=C2=A01 file changed, 33 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/.forgejo/workflows/action.yaml b/.forgejo/workflows/action.yam=
l<br>
index ef3ed81d..6ea930b3 100644<br>
--- a/.forgejo/workflows/action.yaml<br>
+++ b/.forgejo/workflows/action.yaml<br>
@@ -52,8 +52,22 @@ jobs:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--disa=
ble-linux-groups \<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${{ ma=
trix.platform }} \<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${{ ma=
trix.kdb }}<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make gnumach.gz<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make VERBOSE=3Dtrue check<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set -o pipefail<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make gnumach.gz 2&gt;&amp;1 | tee ../er=
ror.log<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make VERBOSE=3Dtrue check 2&gt;&amp;1 |=
 tee ../error.log</blockquote><div>=C2=A0</div><div><div class=3D"gmail_def=
ault" style=3D"font-family:arial,sans-serif">Only the &quot;make check&quot=
; output would end in=C2=A0the error.log. Tee overwrites the output file un=
less the &quot;-a&quot; flag is passed. Is this intentional?</div></div><di=
v>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+=C2=A0 =C2=A0 =C2=A0 - name: Email failures<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if: failure()<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 run: |<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;CI failure: gnumach i386 on =
commit ${{ forgejo.SHA }} with options ${{ matrix.platform }} ${{ matrix.kd=
b }}&quot;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ `basename ${{ forgejo.REPOSITORY }=
}` =3D=3D &quot;gnumach&quot; ] &amp;&amp; [ ${{ forgejo.REF_NAME }} =3D=3D=
 &quot;master&quot; ]; then<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gzip -9 error.log<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;CI failure: gnumach i=
386 master on commit ${{ forgejo.SHA }} with options ${{ matrix.platform }}=
 ${{ matrix.kdb }}&quot; | \<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mail -a error.log.gz -s &=
quot;[CI fail]: gnumach i386 ${{ forgejo.SHA }} (${{ matrix.platform }} ${{=
 matrix.kdb }})&quot; \<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"mailto:=
[email protected]" target=3D"_blank">[email protected]</a><br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>
+<br>
=C2=A0 =C2=A0x86_64:<br>
=C2=A0 =C2=A0 =C2=A0runs-on: self<br>
=C2=A0 =C2=A0 =C2=A0strategy:<br>
@@ -101,9 +115,10 @@ jobs:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TARGET_CPPFLAGS=3D-I&quot;$GNU&quo=
t;/include TARGET_CC=3Dx86_64-linux-gnu-gcc ../configure --prefix=3D&quot;$=
GNU&quot; --target=3Dx86_64-gnu<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0make all install<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd ../..<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mkdir gnu32<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GNU32=3D$(realpath gnu32)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if [ &quot;$USER_H&quot; =3D=3D &q=
uot;i686&quot; ]; then<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# We need i386 headers to b=
uild mig 32bit<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mkdir gnu32<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mkdir build32<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd build32<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0../configure --prefix=3D --=
host=3Di686-gnu LD=3D&quot;x86_64-linux-gnu-ld -melf_i386&quot; CC=3D&quot;=
x86_64-linux-gnu-gcc -m32&quot; \<br>
@@ -115,7 +130,6 @@ jobs:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd mig<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mkdir build32<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd build32<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GNU32=3D$(realpath ../../gnu32)<=
br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TARGET_CPPFLAGS=3D-I&quot;$=
GNU32&quot;/include TARGET_CC=3D&quot;x86_64-linux-gnu-gcc -m32&quot; TARGE=
T_LD=3D&quot;x86_64-linux-gnu-ld -melf_i386&quot; ../configure --prefix=3D&=
quot;$GNU32&quot; --target=3Di686-gnu<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0make all install<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd ../..<br>
@@ -130,5 +144,18 @@ jobs:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${{ ma=
trix.platform }} \<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${{ ma=
trix.user32 }} \<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${{ ma=
trix.kdb }}<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make gnumach.gz<br>
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make VERBOSE=3Dtrue check<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 set -o pipefail<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make gnumach.gz 2&gt;&amp;1 | tee ../er=
ror.log<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 make VERBOSE=3Dtrue check 2&gt;&amp;1 |=
 tee ../error.log<br></blockquote><div><br></div><div><div class=3D"gmail_d=
efault" style=3D"font-family:arial,sans-serif">Same here.</div></div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+=C2=A0 =C2=A0 =C2=A0 - name: Email failures<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if: failure()<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 run: |<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;CI failure: gnumach amd64 on=
 commit ${{ forgejo.SHA }} with options ${{ matrix.platform }} ${{ matrix.u=
ser32 }} ${{ matrix.kdb }}&quot;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ `basename ${{ forgejo.REPOSITORY }=
}` =3D=3D &quot;gnumach&quot; ] &amp;&amp; [ ${{ forgejo.REF_NAME }} =3D=3D=
 &quot;master&quot; ]; then<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gzip -9 error.log<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;CI failure: gnumach a=
md64 master on commit ${{ forgejo.SHA }} with options ${{ matrix.platform }=
} ${{ matrix.user32 }} ${{ matrix.kdb }}&quot; | \<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mail -a error.log.gz -s &=
quot;[CI fail]: gnumach amd64 ${{ forgejo.SHA }} (${{ matrix.platform }} ${=
{ matrix.user32 }} ${{ matrix.kdb }})&quot; \<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"mailto:=
[email protected]" target=3D"_blank">[email protected]</a><br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fi<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>
-- <br>
2.51.0<br><br></blockquote><div><br></div><div class=3D"gmail_default" styl=
e=3D"font-family:arial,sans-serif">Cheers.</div></div></div>

--00000000000060611706582437ad--