12
12
# Azure's Windows image. Having the conversion enabled caused regressions both
13
13
# in our test suite (it broke miri tests) and in the ecosystem, since we
14
14
# started shipping install scripts with CRLF endings instead of the old LF.
15
+ #
16
+ # Note that we do this a couple times during the build as the PATH and current
17
+ # user/directory change, e.g. when mingw is enabled.
15
18
- bash : git config --global core.autocrlf false
16
19
displayName : " Disable git automatic line ending conversion"
17
20
@@ -70,6 +73,14 @@ steps:
70
73
displayName : Enable IPv6
71
74
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
72
75
76
+ # Disable automatic line ending conversion (again). On Windows, when we're
77
+ # installing dependencies, something switches the git configuration directory or
78
+ # re-enables autocrlf. We've not tracked down the exact cause -- and there may
79
+ # be multiple -- but this should ensure submodules are checked out with the
80
+ # appropriate line endings.
81
+ - bash : git config --replace-all --global core.autocrlf false
82
+ displayName : " Disable git automatic line ending conversion"
83
+
73
84
# Check out all our submodules, but more quickly than using git by using one of
74
85
# our custom scripts
75
86
- bash : |
@@ -84,6 +95,26 @@ steps:
84
95
condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
85
96
displayName : Check out submodules (Windows)
86
97
98
+ # See also the disable for autocrlf above, this just checks that it worked
99
+ #
100
+ # We check both in rust-lang/rust and in a submodule to make sure both are
101
+ # accurate. Submodules are checked out significantly later than the main
102
+ # repository in this script, so settings can (and do!) change between then.
103
+ #
104
+ # Linux (and maybe macOS) builders don't currently have dos2unix so just only
105
+ # run this step on Windows.
106
+ - bash : |
107
+ set -x
108
+ # print out the git configuration so we can better investigate failures in
109
+ # the following
110
+ git config --list --show-origin
111
+ dos2unix -ih Cargo.lock src/tools/rust-installer/install-template.sh
112
+ endings=$(dos2unix -ic Cargo.lock src/tools/rust-installer/install-template.sh)
113
+ # if endings has non-zero length, error out
114
+ if [ -n "$endings" ]; then exit 1 ; fi
115
+ condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
116
+ displayName : Verify line endings are LF
117
+
87
118
# Ensure the `aws` CLI is installed so we can deploy later on, cache docker
88
119
# images, etc.
89
120
- bash : |
0 commit comments