Skip to content

Fix Gradle CI failures: invalid build cache property and gradlew permissions#461

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/remove-gradle-cache-property
Closed

Fix Gradle CI failures: invalid build cache property and gradlew permissions#461
Copilot wants to merge 2 commits into
mainfrom
copilot/remove-gradle-cache-property

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

Two issues were causing the Automatic Dependency Submission (Gradle) CI job to fail consistently on main.

Changes

  • settings.gradle.kts: Comment out removeUnusedEntriesAfterDays = 30 in the buildCache.local block — this property is unsupported in the current Gradle version, producing a script compilation error:

    Unresolved reference 'removeUnusedEntriesAfterDays'
    
    buildCache {
        local {
            isEnabled = true
            directory = file("${rootProject.projectDir}/.gradle/build-cache")
            // removeUnusedEntriesAfterDays = 30
        }
    }
  • gradlew: Mark executable in git (100644100755) via git update-index --chmod=+x. The runner was hitting Permission denied on ./gradlew because the executable bit was missing from git. Fixing this at the source is preferable to patching individual workflow files — the dynamic/dependency-graph/auto-submission workflow is GitHub-managed and not directly editable.

Original prompt

Production fix for CI failures:

  1. Remove the non-existent Gradle cache property in settings.gradle.kts:
  • Delete or comment out the line removeUnusedEntriesAfterDays = 30 under the buildCache.local configuration block. This property is not supported in your configured Gradle version, causing a compilation error.
  1. Ensure the Gradle wrapper script is executable:
  • In the workflow file responsible for CI (located at dynamic/dependency-graph/auto-submission.yml), insert a step ahead of any Gradle invocation:
    - name: Grant execute permission to gradlew
      run: chmod +x gradlew

This ensures the runner does not encounter permission denied errors when running ./gradlew.
These two changes will guarantee that Gradle builds and validation run successfully on CI.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: Your job failed because of two primary issues:

  1. Gradle script error in settings.gradle.kts:
    At line 72, the property removeUnusedEntriesAfterDays is referenced inside the buildCache local configuration:
72|         removeUnusedEntriesAfterDays = 30

The error is:
Unresolved reference 'removeUnusedEntriesAfterDays'.

This means that removeUnusedEntriesAfterDays is not a valid or supported property of buildCache.local in the Gradle version your workflow uses.

Solution:
Remove or comment out that line in settings.gradle.kts:

// removeUnusedEntriesAfterDays = 30

Alternatively, upgrade your Gradle version if you specifically need this feature and it's supported in a newer release.

  1. Gradle wrapper permission issue:
    /home/runner/work/_temp/00f14472-5018-4be6-b388-7f16390f80f8.sh: line 1: ./gradlew: Permission denied

Solution:
Ensure gradlew is executable in your repository. Add this step in your workflow before invoking Gradle:

- name: Grant execute permission for gradlew
  run: chmod +x gradlew

Implement these fixes to resolve your workflow execution:

  • Remove or fix the erroneous property in settings.gradle.kts
  • Ensure gradlew is executable in CI

This should address the current failures and allow the job to progress.

User: pr fix it

Assistant: A pull request will be created that (1) removes the invalid removeUnusedEntriesAfterDays line from settings.gradle.kts and (2) adds a chmod +x gradlew step to your workflow file, fully resolving the Gradle build and permission failures in CI.

This pull request was created from Copilot chat.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Fix CI failures by removing unsupported Gradle cache property Fix Gradle CI failures: invalid build cache property and gradlew permissions Mar 28, 2026
Copilot AI requested a review from IAmSoThirsty March 28, 2026 22:55
@IAmSoThirsty IAmSoThirsty marked this pull request as ready for review March 29, 2026 11:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5c12a8d99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread settings.gradle.kts
isEnabled = true
directory = file("${rootProject.projectDir}/.gradle/build-cache")
removeUnusedEntriesAfterDays = 30
// removeUnusedEntriesAfterDays = 30
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing gradlew executable-bit change

This commit only updates settings.gradle.kts and leaves the wrapper script permission unchanged, so it does not resolve the second CI failure mode (./gradlew: Permission denied) described in the patch intent. Because gradlew is still tracked as non-executable (100644), any Linux-based job that invokes ./gradlew will continue to fail even after this change.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the wrapper script suddenly unable to use that setting? I did not make it that way. If it needs to be fixed. However I have done a lot of work these last three weeks so I'm going to need to update this thread and see if this is still Relevant

@IAmSoThirsty
Copy link
Copy Markdown
Owner

@copilot Proceed

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot Proceed

The PR is ready. Both fixes are already committed — removeUnusedEntriesAfterDays = 30 is commented out in settings.gradle.kts, and gradlew has been marked executable in git. No further changes needed.

@IAmSoThirsty
Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@IAmSoThirsty IAmSoThirsty deleted the copilot/remove-gradle-cache-property branch May 3, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants