Skip to content

CI: Remove corrupted downloads for build retry#18763

Merged
lupyuen merged 1 commit intoapache:masterfrom
lupyuen18:retry-build2
Apr 19, 2026
Merged

CI: Remove corrupted downloads for build retry#18763
lupyuen merged 1 commit intoapache:masterfrom
lupyuen18:retry-build2

Conversation

@lupyuen
Copy link
Copy Markdown
Member

@lupyuen lupyuen commented Apr 19, 2026

Summary

We have implemented CI Build Retry for mitigating Download Failures. But right now it will reuse any Corrupted Downloads (instead of deleting them), which will cause CI Build Retry to fail repeatedly: https://github.com/apache/nuttx/actions/runs/24611381081/job/71966407518#step:10:627

Ignored files: system/argtable3/v3.2.0.7402e6e.tar.gz
gzip: stdin: not in gzip format
make[3]: *** [Makefile:76: argtable3] Error 2

This PR proposes to change git clean -fd to git clean -xfdq. This will remove any Corrupted Downloads, preventing their reuse for CI Build Retry:

## Simulate a corrupted download for argtable3
$ tools/configure.sh qemu-armv8a/netnsh
$ Downloading v3.2.0.7402e6e.tar.gz--argtable3
## Press Ctrl-C to stop the build

## `git clean -fd` won't remove the corrupted download 
$ cd ../apps
$ git clean -fd
$ find . -name "v3.2.0.7402e6e.tar.gz" 
./system/argtable3/v3.2.0.7402e6e.tar.gz

## `git clean -xfdq` removes the corrupted download
$ git clean -xfdq 
$ find . -name "v3.2.0.7402e6e.tar.gz" 
## Corrupted download is deleted correctly

git clean -xfdq is also found in the same testbuild script, so we are using it consistently:

nuttx/tools/testbuild.sh

Lines 286 to 291 in 12e8f92

function distclean {
echo " Cleaning..."
if [ -f .config ] || [ -f build/.config ]; then
if [ ${GITCLEAN} -eq 1 ] || [ ! -z ${cmake} ]; then
git -C $nuttx clean -xfdq
git -C $APPSDIR clean -xfdq

Impact

CI Build Retry will now work correctly, retrying any Failed Downloads, instead of reusing them.

Testing

We tested a Normal Build (without errors), since Download Failures are unpredictable and hard to simulate:

We hope to eliminate these Download Errors that we see in NuttX Build Monitor: https://lupyuen.github.io/nuttx-github-jobs/build-monitor

Screenshot 2026-04-19 at 9 09 17 AM

We have implemented CI Build Retry for mitigating Download Failures. But right now it will reuse any Corrupted Downloads (instead of deleting them), which will cause CI Build Retry to fail repeatedly: https://github.com/apache/nuttx/actions/runs/24611381081/job/71966407518#step:10:627

```
Ignored files: system/argtable3/v3.2.0.7402e6e.tar.gz
gzip: stdin: not in gzip format
make[3]: *** [Makefile:76: argtable3] Error 2
```

This PR proposes to change `git clean -fd` to `git clean -xfdq`. This will remove any Corrupted Downloads, preventing their reuse for CI Build Retry:

```bash
## Simulate a corrupted download for argtable3
$ tools/configure.sh qemu-armv8a/netnsh
$ Downloading v3.2.0.7402e6e.tar.gz--argtable3
## Press Ctrl-C to stop the build

## `git clean -fd` won't remove the corrupted download
$ cd ../apps
$ git clean -fd
$ find . -name "v3.2.0.7402e6e.tar.gz"
./system/argtable3/v3.2.0.7402e6e.tar.gz

## `git clean -xfdq` removes the corrupted download
$ git clean -xfdq
$ find . -name "v3.2.0.7402e6e.tar.gz"
## Corrupted download is deleted correctly
```

`git clean -xfdq` is also found in the same testbuild script, so we are using it consistently:

https://github.com/apache/nuttx/blob/12e8f92a282fac58e0dfff587ea3d9502e4804c0/tools/testbuild.sh#L286-L291

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
@github-actions github-actions bot added Area: Build system Size: XS The size of the change in this PR is very small labels Apr 19, 2026
@lupyuen lupyuen linked an issue Apr 19, 2026 that may be closed by this pull request
1 task
@lupyuen lupyuen mentioned this pull request Apr 19, 2026
1 task
Copy link
Copy Markdown
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lupyuen good catch.. was that causing build problems with my recent PR? :D

@lupyuen
Copy link
Copy Markdown
Member Author

lupyuen commented Apr 19, 2026

@cederom All github.com downloads were failing really badly over the past 12 hours, not sure why. Even our NuttX Build Farm was affected, running on my Local PC outside GitHub Actions:

Screenshot 2026-04-19 at 7 50 40 AM

@cederom
Copy link
Copy Markdown
Contributor

cederom commented Apr 19, 2026

Thank you so much for keeping an eye @lupyuen !! =)

@lupyuen lupyuen merged commit 3e570aa into apache:master Apr 19, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Build system Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Retry for CI Builds

3 participants