Skip to content

Commit da64782

Browse files
authored
Merge pull request #901 from HEXRD/fix-macos-package-spurious-failures
Fix spurious failures for macos packages
2 parents 0dc6856 + 8123db2 commit da64782

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/package.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,21 @@ jobs:
7676
# set this environment variable instead.
7777
# Setting this variable via `env` did not seem to work for some reason.
7878
export CONDA_SOLVER=libmamba
79-
conda build --override-channels -c conda-forge --output-folder output/ conda.recipe/
79+
# Retry conda build up to N times to handle transient checksum
80+
# mismatch failures caused by stale cached repodata.
81+
max_attempts=5
82+
for attempt in $(seq 1 $max_attempts); do
83+
echo "conda build attempt $attempt"
84+
conda clean --all -y
85+
if conda build --override-channels -c conda-forge --output-folder output/ conda.recipe/; then
86+
break
87+
fi
88+
if [ "$attempt" -eq "$max_attempts" ]; then
89+
echo "conda build failed after $max_attempts attempts"
90+
exit 1
91+
fi
92+
echo "Attempt $attempt failed, retrying..."
93+
done
8094
# This is need to ensure ~/.profile or ~/.bashrc are used so the activate
8195
# command works.
8296
shell: bash -l {0}

0 commit comments

Comments
 (0)