6464 shell : bash
6565 run : |
6666 set -euo pipefail
67- git clone --quiet https://repo.or.cz/tinycc.git /tmp/tinycc-ref
67+ for attempt in 1 2 3; do
68+ if git clone --quiet https://repo.or.cz/tinycc.git /tmp/tinycc-ref; then
69+ break
70+ fi
71+ rm -rf /tmp/tinycc-ref
72+ if [ "$attempt" -eq 3 ]; then
73+ exit 1
74+ fi
75+ sleep "$((attempt * 5))"
76+ done
6877 git -C /tmp/tinycc-ref checkout --quiet "$TCC_COMMIT"
6978 hash="$(git -C /tmp/tinycc-ref rev-parse HEAD)"
7079 echo "hash=$hash" >> "$GITHUB_OUTPUT"
@@ -112,12 +121,23 @@ jobs:
112121 shell : bash
113122 env :
114123 BUILD_CMD : TCC_COMMIT=${{ env.TCC_COMMIT }} TCC_FOLDER=thirdparty/tcc bash ${{ matrix.script }}
124+ TCC_REPO : /tmp/tinycc-ref
115125 run : |
116126 set -euo pipefail
117127 TCC_FOLDER=thirdparty/tcc bash "${{ matrix.script }}"
118128 test "$(cat thirdparty/tcc/build_source_hash.txt)" = "${{ steps.tinycc.outputs.hash }}"
119129 thirdparty/tcc/tcc.exe --version
120130 thirdparty/tcc/tcc.exe -v -v
131+ cat > /tmp/tcc-stdatomic-smoke.c <<'EOF'
132+ #include <stdatomic.h>
133+ int main(void) {
134+ atomic_int value = ATOMIC_VAR_INIT(0);
135+ atomic_store(&value, 1);
136+ return atomic_load(&value) == 1 ? 0 : 1;
137+ }
138+ EOF
139+ thirdparty/tcc/tcc.exe /tmp/tcc-stdatomic-smoke.c -o /tmp/tcc-stdatomic-smoke
140+ /tmp/tcc-stdatomic-smoke
121141
122142 - name : Upload TCC bundle artifact
123143 if : steps.rebuild.outputs.skip != 'true'
@@ -182,7 +202,16 @@ jobs:
182202 git config --global user.email vlang-bot@users.noreply.github.com
183203 git config --global --add safe.directory "$PWD"
184204
185- git clone --quiet https://repo.or.cz/tinycc.git /tmp/tinycc-ref
205+ for attempt in 1 2 3; do
206+ if git clone --quiet https://repo.or.cz/tinycc.git /tmp/tinycc-ref; then
207+ break
208+ fi
209+ rm -rf /tmp/tinycc-ref
210+ if [ "$attempt" -eq 3 ]; then
211+ exit 1
212+ fi
213+ sleep "$((attempt * 5))"
214+ done
186215 git -C /tmp/tinycc-ref checkout --quiet "$TCC_COMMIT"
187216 tinycc_hash="$(git -C /tmp/tinycc-ref rev-parse HEAD)"
188217 echo "TinyCC $TCC_COMMIT resolves to $tinycc_hash"
@@ -206,10 +235,20 @@ jobs:
206235 fi
207236
208237 BUILD_CMD="TCC_COMMIT=$TCC_COMMIT TCC_FOLDER=thirdparty/tcc CC=${{ matrix.cc }} bash ${{ matrix.script }}" \
209- TCC_FOLDER=thirdparty/tcc CC="${{ matrix.cc }}" bash "${{ matrix.script }}"
238+ TCC_REPO=/tmp/tinycc-ref TCC_FOLDER=thirdparty/tcc CC="${{ matrix.cc }}" bash "${{ matrix.script }}"
210239 test "$(cat thirdparty/tcc/build_source_hash.txt)" = "$tinycc_hash"
211240 thirdparty/tcc/tcc.exe --version
212241 thirdparty/tcc/tcc.exe -v -v
242+ cat > /tmp/tcc-stdatomic-smoke.c <<'EOF'
243+ #include <stdatomic.h>
244+ int main(void) {
245+ atomic_int value = ATOMIC_VAR_INIT(0);
246+ atomic_store(&value, 1);
247+ return atomic_load(&value) == 1 ? 0 : 1;
248+ }
249+ EOF
250+ thirdparty/tcc/tcc.exe /tmp/tcc-stdatomic-smoke.c -o /tmp/tcc-stdatomic-smoke
251+ /tmp/tcc-stdatomic-smoke
213252
214253 if [ "$PUBLISH" = 'true' ]; then
215254 git -C thirdparty/tcc push origin HEAD:${{ matrix.branch }}
0 commit comments