Skip to content

Access to .gradle/caches on windows-latest  #454

Description

@JakubMosakowski

Hi!

Cache actions seem not to be working with Gradle on the windows machine. Tar doesn't have an access to some files.

Post job cleanup.
C:\windows\System32\tar.exe --posix -z -cf cache.tgz -P -C D:/a/ItemistEvolved/ItemistEvolved --files-from manifest.txt
tar.exe: Couldn't open C:/Users/runneradmin/.gradle/caches/transforms-2/transforms-2.lock: Permission denied
tar.exe: Error exit delayed from previous errors.
Warning: Tar failed with error: The process 'C:\windows\System32\tar.exe' failed with exit code 1
name: Pull Request Workflow

on:
  pull_request:
    branches: [ develop ]

jobs:  
  build:
    runs-on: windows-latest
    steps:
      - name: Checkout the code
        uses: actions/checkout@v2
      - name: Get gradle cache
        uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            ${{ runner.os }}-gradle-

...

Activity

  1. Danielku15 commented on May 13, 2021

    @Danielku15
    Contributor

    I also wanted to activate the caching of some Gradle stuff in my repo and instantly ran into this issue. The issue is caused by the Gradle Daemon which keeps running. I worked around the issue in my CI scrips via:

    1. Adding --no-daemon to my gradlew calls.
    2. Adding an additional gradlew --stop step at the end of my workflow to stop any potentially running daemon which spawned without my knowledge.

    Might be worth noting this in the readme for Gradle that devs need to ensure no gradle daemon is running anymore because it might make the task fail due to locked files.

    Hope with this workaround you're also able to solve your build issues 😉

  2. dhadka commented on May 13, 2021

    @dhadka
    Contributor

    @Danielku15 Thanks, I've merged your PR.

    @JakubMosakowski If this suggestion resolves the issue, please close or let us know if there's any other repair items.

  3. github-actions commented on May 5, 2022

    @github-actions

    This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

  4. github-actions commented on May 11, 2022

    @github-actions

    This issue was closed because it has been inactive for 5 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions