mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
ci: extract disabling git crlf handling into a script
This commit is contained in:
parent
6dd074a8f6
commit
e0b1b3bbc1
@ -1,7 +1,4 @@
|
||||
steps:
|
||||
- bash: git config --replace-all --global core.autocrlf false
|
||||
displayName: "Disable git automatic line ending conversion (on C:/)"
|
||||
|
||||
# Download and install MSYS2, needed primarily for the test suite (run-make) but
|
||||
# also used by the MinGW toolchain for assembling things.
|
||||
#
|
||||
|
@ -87,6 +87,10 @@ steps:
|
||||
displayName: Ensure the build happens on C:\ instead of D:\
|
||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
||||
|
||||
- bash: src/ci/scripts/disable-git-crlf-conversion.sh
|
||||
displayName: "Disable git automatic line ending conversion (on C:/)"
|
||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
||||
|
||||
- template: install-windows-build-deps.yml
|
||||
|
||||
# Looks like docker containers have IPv6 disabled by default, so let's turn it
|
||||
@ -104,8 +108,9 @@ steps:
|
||||
# re-enables autocrlf. We've not tracked down the exact cause -- and there may
|
||||
# be multiple -- but this should ensure submodules are checked out with the
|
||||
# appropriate line endings.
|
||||
- bash: git config --replace-all --global core.autocrlf false
|
||||
displayName: "Disable git automatic line ending conversion"
|
||||
- bash: src/ci/scripts/disable-git-crlf-conversion.sh
|
||||
displayName: Disable git automatic line ending conversion
|
||||
condition: and(succeeded(), not(variables.SKIP_JOB))
|
||||
|
||||
# Check out all our submodules, but more quickly than using git by using one of
|
||||
# our custom scripts
|
||||
|
13
src/ci/scripts/disable-git-crlf-conversion.sh
Executable file
13
src/ci/scripts/disable-git-crlf-conversion.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Disable automatic line ending conversion, which is enabled by default on
|
||||
# Azure's Windows image. Having the conversion enabled caused regressions both
|
||||
# in our test suite (it broke miri tests) and in the ecosystem, since we
|
||||
# started shipping install scripts with CRLF endings instead of the old LF.
|
||||
#
|
||||
# Note that we do this a couple times during the build as the PATH and current
|
||||
# user/directory change, e.g. when mingw is enabled.
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
git config --replace-all --global core.autocrlf false
|
Loading…
Reference in New Issue
Block a user