Issues with vendored packages changing checksums without any (manual) changes

So i got some weirdnes going on here and I suspect git is the culprit:

On a linux host I created a rust project, added rand as a dependency, vendored the dependencies, committed everything and pushed to origin

Now when I clone onto a linux host everything works out of the box. however on a windows host I get this error

PS C:\Users\VoreLuka\Documents\rust-test> cargo run 
error: the listed checksum of `C:\Users\VoreLuka\Documents\rust-test\vendor\rand\src/rngs/small.rs` has changed:
expected: a8e61c6e0bad62f06db1325e3b93eff1d4aa9e82cf0316fbfd02da2ef5b85b83
actual:   88d03f9fcccf969a3b3a689a32fe1482891fa0c66d30e38b903272a579f2b94f 
directory sources are not intended to be edited, if modifications are required then it is
recommended that `[patch]` is used with a forked copy of the source   

I just realized the path seems to be weird, maybe thats the issue?

Do you have Windows or Linux line endings in your local copy? This might be the difference.

First thing: How do i check that?
Second thing: Shouldn't git keep that consistent?

git trying to keep things consistent is what's causing this. Windows standard is CRLF, Unix standard is LF, git by default tries transparently converting between those when you push and pull. You can disable this by setting core.autocrlf to false.

Setting it on linux before I push or windows before I pull?

What editor do you use for the project? Both VSCode and IntelliJ-based ones can show this, AFAIK, as well as several others.

On windows before you pull. You can also add a .gitattributes file to your repo containing * text=auto eol=lf to disable autocrlf for everyone who works on your repo.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.