Skip to content

ccache-action does not work with MSYS2 on Windows #298

@ZJY0516

Description

@ZJY0516

Description:

I'm encountering an issue where ccache-action does not seem to work properly in a GitHub Actions workflow when using MSYS2 on Windows. Specifically, it appears that CMake cannot locate or utilize ccache from the MSYS2 environment, even though the action runs without errors.

Here’s the relevant part of my workflow configuration:

- os: windows-latest
            compiler: gcc
            msys2_arch: ucrt64
            msys2_packages: >-
              git
              mingw-w64-ucrt-x86_64-gcc
              mingw-w64-ucrt-x86_64-cmake
- name: Setup MSYS2
        if: matrix.os == 'windows-latest'
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.msys2_arch }}
          update: true
          install: ${{ matrix.msys2_packages }}

- name: ccache
        uses: hendrikmuhs/[email protected]
        with:
          key: ${{ matrix.os }}-${{ matrix.compiler }}

- name: Configure project (Windows)
        if: matrix.os == 'windows-latest'
        shell: msys2 {0}
        run: |
          cmake -B build

- name: Build project (Windows)
        if: matrix.os == 'windows-latest'
        shell: msys2 {0}
        run: |
          cmake --build build --config Release -j 2

It seems that ccache is not being detected by CMake during the build process within the MSYS2 environment. I suspect this might be related to how ccache-action sets up the environment or how paths are handled in MSYS2, but I’m unsure of the exact cause.

Run cmake -B build
-- Building for: Ninja
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/a/_temp/msys64/ucrt64/bin/cc.exe - skipped
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/a/_temp/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: D:/a/_temp/msys64/usr/bin/git.exe
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF

Has anyone encountered a similar issue with MSYS2 on Windows? Is there a specific configuration step I’m missing to make ccache-action work in this setup? Any help or suggestions would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions