Skip to content

Commit 97daf31

Browse files
thesamesamP-E-P
authored andcommitted
ci: disable network
Disable network access via 'unshare' in two CI workflows to catch issues like PR119333 where importing polonius meant bootstrap tried to pull crates from the internet. ChangeLog: PR rust/119333 * .github/workflows/bootstrap.yml: Disable network via 'unshare'. * .github/workflows/ccpp.yml: Ditto.
1 parent 8c91ed5 commit 97daf31

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/bootstrap.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
- name: Build
4343
run: |
4444
cd gccrs-build; \
45-
make -j $(nproc)
45+
# Build without network access
46+
unshare --net --ipc -r /bin/bash -c "make -j $(nproc)"
4647
4748
- name: Run Tests
4849
run: |

.github/workflows/ccpp.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ jobs:
6161
run: |
6262
cd gccrs-build; \
6363
# Add cargo to our path quickly
64-
. "$HOME/.cargo/env";
65-
make -Otarget -j $(nproc) 2>&1 | tee log
64+
. "$HOME/.cargo/env"; \
65+
# Build without network access
66+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
6667
6768
- name: Check for new warnings
6869
run: |

0 commit comments

Comments
 (0)