Skip to content

Commit c82b87d

Browse files
committed
ci: extract disabling git crlf handling into a script
1 parent 242aee1 commit c82b87d

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/ci/azure-pipelines/steps/install-windows-build-deps.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
steps:
2-
- bash: git config --replace-all --global core.autocrlf false
3-
displayName: "Disable git automatic line ending conversion (on C:/)"
4-
52
# Download and install MSYS2, needed primarily for the test suite (run-make) but
63
# also used by the MinGW toolchain for assembling things.
74
#

src/ci/azure-pipelines/steps/run.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ steps:
8787
displayName: Ensure the build happens on C:\ instead of D:\
8888
condition: and(succeeded(), not(variables.SKIP_JOB))
8989

90+
- bash: src/ci/scripts/disable-git-crlf-conversion.sh
91+
displayName: "Disable git automatic line ending conversion (on C:/)"
92+
condition: and(succeeded(), not(variables.SKIP_JOB))
93+
9094
- template: install-windows-build-deps.yml
9195

9296
# Looks like docker containers have IPv6 disabled by default, so let's turn it
@@ -104,8 +108,9 @@ steps:
104108
# re-enables autocrlf. We've not tracked down the exact cause -- and there may
105109
# be multiple -- but this should ensure submodules are checked out with the
106110
# appropriate line endings.
107-
- bash: git config --replace-all --global core.autocrlf false
108-
displayName: "Disable git automatic line ending conversion"
111+
- bash: src/ci/scripts/disable-git-crlf-conversion.sh
112+
displayName: Disable git automatic line ending conversion
113+
condition: and(succeeded(), not(variables.SKIP_JOB))
109114

110115
# Check out all our submodules, but more quickly than using git by using one of
111116
# our custom scripts
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Disable automatic line ending conversion, which is enabled by default on
3+
# Azure's Windows image. Having the conversion enabled caused regressions both
4+
# in our test suite (it broke miri tests) and in the ecosystem, since we
5+
# started shipping install scripts with CRLF endings instead of the old LF.
6+
#
7+
# Note that we do this a couple times during the build as the PATH and current
8+
# user/directory change, e.g. when mingw is enabled.
9+
10+
set -euo pipefail
11+
IFS=$'\n\t'
12+
13+
git config --replace-all --global core.autocrlf false

0 commit comments

Comments
 (0)