Check Gradle wrapper jar sha256 on Windows - #3137
Open
rootkiller6788 wants to merge 1 commit into
Open
Conversation
Fixes google#3103. The "Check valid Gradle wrapper jar" step was skipped on windows-latest because gradle-wrapper.jar.sha256sum was checked out with CRLF line endings there (via `* text=auto` under core.autocrlf). With a trailing \r in the filename, `sha256sum --check` fails to find the file and the check cannot run on Windows. Force LF for *.sha256sum in .gitattributes so the file is byte-for-byte identical on every platform, and drop the `if: matrix.os != 'windows-latest'` condition so the check also runs on Windows.
rootkiller6788
requested review from
hfmehmed,
jaschdoc and
troelsbjerre
as code owners
August 18, 2026 15:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CI workflow uses
sha256sum --check gradle-wrapper.jar.sha256sumto verify the committed wrapper JAR.However, this step is guarded by
if: matrix.os != 'windows-latest', so it has never run on Windows runners.Root cause
On Windows, the
.sha256sumfile is checked out with CRLF line endings.There is no dedicated rule for
*.sha256sumin.gitattributes, so it falls back to the catch-all* text=auto. Combined with Windows’ defaultcore.autocrlf=true, the file gets converted to CRLF.As a result,
sha256sum --checktreats the trailing\ras part of the filename and attempts to look forgradle-wrapper.jar\r, producing the error:sha256sum: 'gradle-wrapper.jar'$'\r': No such file or directoryChanges
*.sha256sum text eol=lfto.gitattributesto ensure the checksum file is always checked out with LF line endings across all platforms for byte-identical content.if: matrix.os != 'windows-latest'condition so the verification step executes on Windows as well.Verification
497c8c2a…).sha256sum --checkagainst the LF-versioned file outputsgradle-wrapper.jar: OK.Closes #3103.