Skip to content

Commit ae3a9fd

Browse files
authored
Prevent concurrent cache access (#135)
`libgit2` fails if we try to access the same cached repository concurrently. This is however very likely to happen when multiple projects in cargo workspace use protofetch to fetch from the same source. This PR makes protofetch acquire a lock on the cache directory before accessing it, so only one instance can work with the cache at a time. The lock is not granular, but it should be good enough.
1 parent 0d7d5fd commit ae3a9fd

File tree

4 files changed

+283
-28
lines changed

4 files changed

+283
-28
lines changed

.github/workflows/ci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ jobs:
8181
cross: true
8282
ext:
8383
- rust: aarch64-apple-darwin
84-
runner: macos-latest-xlarge
84+
runner: macos-14
8585
# We use gtar to make sure compressed files are not detected as sparse
8686
tar: gtar
8787
cross: false
8888
ext:
8989
- rust: x86_64-apple-darwin
90-
runner: macos-latest
90+
runner: macos-12
9191
# We use gtar to make sure compressed files are not detected as sparse
9292
tar: gtar
9393
cross: false
@@ -109,8 +109,7 @@ jobs:
109109

110110
- name: Install cross
111111
if: ${{ matrix.target.cross }}
112-
run: |
113-
cargo install --locked cross
112+
run: cargo install --locked cross
114113

115114
- name: Build
116115
run: ${{ matrix.target.cross && 'cross' || 'cargo' }} build --release --target ${{ matrix.target.rust }} --features vendored-openssl,vendored-libgit2

0 commit comments

Comments
 (0)