Skip to content

Commit a4a490b

Browse files
authored
Fix llvm-build for almalinux (#5111)
If a directory with LLVM exists in the runner (for example, a leftover from a previous run for the same LLVM commit id), then the new LLVM build will be copied to `install` subdirectory. To avoid this case we should remove the existing LLVM installation directory. Fixes #5096.
1 parent bab3470 commit a4a490b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/llvm-build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,14 @@ jobs:
245245
246246
# Create temporary container to copy cache and installed artifacts.
247247
CONTAINER_ID=$(docker create llvm-build)
248+
249+
# We remove the existing directories, otherwise docker cp will
250+
# create a subdirectory inside the existing directory.
251+
rm -rf "${{ env.SCCACHE_DIR }}" "${{ env.llvm_install_dir }}"
252+
248253
docker cp "${CONTAINER_ID}:/install" "${{ env.llvm_install_dir }}"
249254
tar czf "${{ env.llvm_install_dir }}.tar.gz" "${{ env.llvm_install_dir }}"
250255
251-
# We remove the existing directory, otherwise docker will
252-
# create a subdirectory inside the existing directory.
253-
rm -rf "${{ env.SCCACHE_DIR }}"
254256
docker cp "${CONTAINER_ID}:/sccache" "${{ env.SCCACHE_DIR }}"
255257
sudo chown -R "$(id -u -n):$(id -g -n)" "${{ env.SCCACHE_DIR }}"
256258

0 commit comments

Comments
 (0)