From 9e220a05c5961c948064db4107eea040296e7896 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 00:42:42 +0000 Subject: [PATCH] Guard ccache and avoid lib name collisions Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- .github/workflows/build.yaml | 7 +++++++ .github/workflows/release.yaml | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0471176e6..c4fe5a824 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -24,6 +24,13 @@ jobs: with: key: ${{ runner.os }}-ccache-${{ hashFiles('CMakeLists.txt', '.github/workflows/build.yaml') }} + - name: Ensure ccache installed + run: | + if ! command -v ccache >/dev/null 2>&1; then + apt-get update -qq + DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ccache + fi + - name: Mark workspace safe run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4f348dd69..c007792e1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -71,6 +71,15 @@ jobs: zip_add() { zip -uj eqemu-server-linux-x64.zip "$1" } + zip_add_unique() { + local target_name + target_name="$(basename "$1")" + if unzip -Z1 eqemu-server-linux-x64.zip | grep -qx "$target_name"; then + echo "Skipping duplicate library: $target_name" + return 0 + fi + zip_add "$1" + } # Add all executable files (excluding tests) for f in *; do @@ -84,7 +93,7 @@ jobs: if [ "$bin_lib_count" -gt 0 ]; then find . -maxdepth 1 -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \ while IFS= read -r -d '' lib; do - zip_add "$lib" + zip_add_unique "$lib" done fi @@ -93,7 +102,7 @@ jobs: if [ "$lib_count" -gt 0 ]; then find ../libs -type f \( -name "*.so" -o -name "*.so.[0-9]*" \) -print0 | \ while IFS= read -r -d '' lib; do - zip_add "$lib" + zip_add_unique "$lib" done else echo "No shared libraries found in build/libs"