Skip to content

Conversation

@matemoln
Copy link
Contributor

@matemoln matemoln commented Nov 14, 2025

BUILD-9398

Builds on the Windows runners are failing with

shell: C:\Program Files\Git\usr\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
# Generate cache key from all Gradle files
find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; | sort > gradle-md5-sums.txt
File not found - *.gradle.kts
Error: Process completed with exit code 2.

We need to ensure that the Linux find command is used

Tested with https://github.com/SonarSource/sonar-dummy-gradle-oss/actions/runs/19371526333?pr=313

@matemoln matemoln requested a review from a team as a code owner November 14, 2025 16:44
@sonarqubecloud
Copy link

SonarQube reviewer guide

Summary: Updates find command to use absolute path in Gradle cache key generation.

Review Focus: Verify this change resolves the intended issue and doesn't break compatibility across different environments or CI systems.

Start review at: config-gradle/action.yml. This is the only changed file and the modification affects cache key generation, which is critical for build performance and correctness.

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues
0 Dependency risks

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@matemoln matemoln enabled auto-merge (squash) November 14, 2025 16:52
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, this will fail on macOS.
@SamirM-BE fixed it with this:

  find_bin="/bin/find"
  if [[ ! -x "$find_bin" ]]; then
    find_bin="/usr/bin/find"
  fi

Preferably use

if ! command -v /bin/find >/dev/null; then

A possibly even better fix (to be tested on Windows) would be to fix the PATH:

export PATH="/bin:/usr/bin:$PATH"

or

export PATH="/usr/bin:/bin:$PATH"

There's historical debate and contradictory implementations regarding the order of the two.
Nowadays, /bin/* mostly redirects to /usr/bin/*

@matemoln matemoln merged commit 3227f97 into master Nov 14, 2025
13 checks passed
@matemoln matemoln deleted the fix/mm/BUILD-9398-fix-gradle-cache-key-step branch November 14, 2025 17:05
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