rive-app / rive-app/rive-runtime

tests/android_tests/gradlew.bat is dirty in every fresh clone (*.bat text eol=crlf vs LF blob) — breaks rive-ios SPM submodule resolution in Xcode

Open Beginner friendly
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.2k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

Summary

tests/android_tests/gradlew.bat shows as modified in every fresh clone of this repo. The root .gitattributes declares *.bat text eol=crlf, but the blob is stored LF-normalized — with that combination, git writes CRLF into the working tree at checkout and immediately reports the path as dirty ("warning: in the working copy of 'tests/android_tests/gradlew.bat', LF will be replaced by CRLF the next time Git touches it").

Repro
$ git clone https://github.com/rive-app/rive-runtime && cd rive-runtime
$ git status --porcelain
 M tests/android_tests/gradlew.bat

Minimal isolated repro of the mechanism (git 2.50.1):

$ git init repo && cd repo
$ printf '*.bat text eol=crlf\n' > .gitattributes
$ printf '@rem\n@rem test\n' > gradlew.bat        # LF endings, like the committed blob
$ git add -A && git commit -m init
$ cd .. && git clone repo clone && git -C clone status --porcelain
 M gradlew.bat

Note git add --renormalize stages nothing (the blob is already LF), so the dirt can't be cleaned up by renormalizing — every clone is dirty by construction until the attribute changes.

Why it matters downstream

rive-ios embeds this repo as a git submodule, and Swift Package Manager clones it into Xcode's DerivedData/.../SourcePackages/checkouts/. The perpetually-dirty submodule breaks SPM package resolution — Xcode surfaces it as "Failed to analyze workspace", and a rive-ios version bump fails to resolve until the checkout is manually repaired. (Observed with rive-ios 6.22.0, Xcode 26.x.)

Suggested fix

Exempt the wrapper script from text normalization so the working tree is byte-identical to the blob, e.g. in .gitattributes:

tests/android_tests/gradlew.bat -text

(Optionally re-commit the file with CRLF endings at the same time if CRLF-on-disk is desired for Windows — with -text git no longer converts either way. gradle init's own generated .gitattributes handles it this way.)

Workaround for consumers

Add the override to a global attributes file so all checkouts (including SPM's) stay clean:

$ printf 'tests/android_tests/gradlew.bat -text\n' >> ~/.config/git/attributes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the root .gitattributes entry and tests/android_tests/gradlew.bat, then reproduce the issue with a fresh clone and git status --porcelain. Update the attribute handling for this path and verify that a clean checkout no longer reports the batch file as modified, including when the repository is consumed as a submodule.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.