Skip to content

Commit 1fa0dfe

Browse files
committed
fix(build.sh): clear ci directory without removing mount point
When ci/ is bind-mounted into cibuildwheel's container at /project/ci, rm -rf ci fails with "Resource busy" because the mount point cannot be removed from inside the container. Clear the directory contents instead, and use mkdir -p so the command succeeds whether or not the directory already exists. Assisted-by: Kimi Code
1 parent ae38227 commit 1fa0dfe

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ if [ "$CIBUILDWHEEL" = "1" ]; then
9292
exit 0
9393
fi
9494

95-
rm -rf ci
96-
mkdir ci || true
95+
# The ci directory may be a bind-mount (e.g. inside cibuildwheel), so
96+
# remove its contents but keep the directory itself.
97+
rm -rf ci/* ci/.[!.]* ci/..?* 2>/dev/null || true
98+
mkdir -p ci
9799
cd ci
98100
else
99101
# Create a virtual environment

0 commit comments

Comments
 (0)