Skip to content

Commit c93dcfb

Browse files
authored
Merge pull request #670 from frstrtr/ci-steward/release-apt-flock
release.yml: flock apt-get to serialize concurrent coin package jobs
2 parents 1aa0bf2 + 35a7c57 commit c93dcfb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ jobs:
7676
7777
- name: Install system dependencies
7878
if: steps.presence.outputs.exists == '1'
79+
# Serialize apt across the concurrent coin package jobs sharing the one
80+
# c2pool-build self-hosted host. Without this, the 5 Linux matrix cells
81+
# race on /var/lib/apt/lists/lock (and corrupt srcpkgcache.bin), and the
82+
# loser fails before the build starts (e.g. LTC on v0.2.0, run
83+
# 29148852306). flock on a host-wide lock makes apt atomic; on
84+
# github-hosted runners the lock is per-VM and uncontended, so no-op.
7985
run: |
86+
exec {lockfd}>/tmp/c2pool-apt.lock
87+
flock "$lockfd"
8088
sudo apt-get update -qq
8189
sudo apt-get install -y --no-install-recommends \
8290
g++ cmake make libleveldb-dev libsecp256k1-dev

0 commit comments

Comments
 (0)