Bug 1647582 Comment 15 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Ok final summary of this bug. It is in fact two bugs:

1. `cargo vendor` behaves poorly when `git config core.autocrlf=true`, needlessly rewriting the vendored library's newlines
2. `cargo vendor` in versions of rust earlier than 1.45 (the latest stable) will deterministically but nonsensically [delete and modify some files when run on windows (msys?)](https://bugzilla.mozilla.org/show_bug.cgi?id=1647582#c6) (for historical record, you can reproduce this on gecko commit 540166:426eecf976c0).

Issue 2 ends up being fairly straightforward: at most we just need to add a version check to `mach vendor rust`. We could make it conditional on windows, but honestly we might as well make it universal for simplicity, since it's the latest stable release, and `vendor` is an ~advanced developer feature.

Issue 1 is more subtle. Some observations:

* If you have not installed git, cargo's libgit2 will default to `autocrlf=false` (good!) (presumably it's the absence of standard git config files more than anything)
* If you do install git with the official wizard, it will prompt you for the value you want, but defaults to `autocrlf=true` (bad!)

Glandium asserts that `true` is actually a good value for end user development on windows (no opinion), and therefore believes we should regard this as a bug in cargo/libgit2/mach-vendor-rust to set/ignore the value properly.

Alternatively, we can regard this as just a "bad configuration" for firefox development, and teach `mach vcs-setup` and/or `mach bootstrap` to prompt you to reconfigure it.
Ok final summary of this bug. It is in fact two bugs:

1. `cargo vendor` behaves poorly when `git config core.autocrlf=true`, needlessly rewriting the vendored library's newlines
2. `cargo vendor` in versions of rust earlier than 1.45 (the latest stable) will deterministically but nonsensically [delete and modify some files when run on windows (msys?)](https://bugzilla.mozilla.org/show_bug.cgi?id=1647582#c6) (for historical record, you can reproduce this on gecko commit 540166:426eecf976c0).

----------------

Issue 2 ends up being fairly straightforward: at most we just need to add a version check to `mach vendor rust`. We could make it conditional on windows, but honestly we might as well make it universal for simplicity, since it's the latest stable release, and `vendor` is an ~advanced developer feature.

That said, it would be nice to know *why* it was fixed in 1.45. Nothing in the cargo release notes suggests an answer.

--------------------

Issue 1 is more subtle. Some observations:

* If you have not installed git, cargo's libgit2 will default to `autocrlf=false` (good!) (presumably it's the absence of standard git config files more than anything)
* If you do install git with the official wizard, it will prompt you for the value you want, but defaults to `autocrlf=true` (bad!)

Glandium asserts that `true` is actually a good value for end user development on windows (no opinion), and therefore believes we should regard this as a bug in cargo/libgit2/mach-vendor-rust to set/ignore the value properly.

Alternatively, we can regard this as just a "bad configuration" for firefox development, and teach `mach vcs-setup` and/or `mach bootstrap` to prompt you to reconfigure it.

Back to Bug 1647582 Comment 15