Skip to content

Commit adf2904

Browse files
author
Kevin Willford
authored
Merge pull request #137 Fix the Azure Pipeline (e.g. macOS builds after the upgrade to Mojave)
Fix the Azure Pipeline (e.g. macOS builds after the upgrade to Mojave)
2 parents 8d75d0a + 5239829 commit adf2904

File tree

14 files changed

+246
-182
lines changed

14 files changed

+246
-182
lines changed

azure-pipelines.yml

Lines changed: 166 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,158 @@
1-
resources:
2-
- repo: self
3-
fetchDepth: 1
1+
variables:
2+
Agent.Source.Git.ShallowFetchDepth: 100
3+
4+
jobs:
5+
- job: windows_build
6+
displayName: Windows Build
7+
pool: Hosted
8+
timeoutInMinutes: 240
9+
steps:
10+
- powershell: |
11+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
12+
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
13+
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
14+
}
15+
displayName: 'Mount test-cache'
16+
env:
17+
GITFILESHAREPWD: $(gitfileshare.pwd)
18+
- powershell: |
19+
$urlbase = "https://dev.azure.com/git-for-windows/git/_apis/build/builds"
20+
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=22&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
21+
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[1].resource.downloadUrl
22+
(New-Object Net.WebClient).DownloadFile($downloadUrl,"git-sdk-64-minimal.zip")
23+
Expand-Archive git-sdk-64-minimal.zip -DestinationPath "$(Build.SourcesDirectory)" -Force
24+
Remove-Item git-sdk-64-minimal.zip
25+
26+
# Let Git ignore the SDK and the test-cache
27+
"/git-sdk-64-minimal/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
28+
displayName: 'Download git-sdk-64-minimal'
29+
- powershell: |
30+
# Helper to check the error level of the latest command (exit with error when appropriate)
31+
function c() { if (!$?) { exit(1) } }
32+
33+
cd "$(Build.SourcesDirectory)"; c
434
5-
phases:
6-
- phase: linux_clang
35+
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
36+
export MAKEFLAGS=-j10
37+
export DEVELOPER=1
38+
export NO_PERL=1
39+
40+
mkdir -p artifacts &&
41+
printf '%s\n%s\n\t%s\n\t%s\n' \
42+
'include Makefile' \
43+
'a:: `$(ALL_PROGRAMS) `$(SCRIPT_LIB) `$(BUILT_INS) `$(OTHER_PROGRAMS) GIT-BUILD-OPTIONS `$(TEST_PROGRAMS) `$(test_bindir_programs) `$(NO_INSTALL) `$(MOFILES)' \
44+
'`$(MAKE) -C templates' \
45+
'tar czf artifacts/artifacts.tar.gz `$^ templates/blt/' >mak &&
46+
make -f mak a
47+
"@
48+
c
49+
displayName: 'Build test artifacts'
50+
env:
51+
HOME: $(Build.SourcesDirectory)
52+
MSYSTEM: MINGW64
53+
- task: PublishPipelineArtifact@0
54+
displayName: 'Publish Pipeline Artifact: test artifacts'
55+
inputs:
56+
artifactName: 'windows-artifacts'
57+
targetPath: '$(Build.SourcesDirectory)\artifacts'
58+
- task: PublishPipelineArtifact@0
59+
displayName: 'Publish Pipeline Artifact: git-sdk-64-minimal'
60+
inputs:
61+
artifactName: 'git-sdk-64-minimal'
62+
targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
63+
- powershell: |
64+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
65+
cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
66+
}
67+
displayName: 'Unmount test-cache'
68+
condition: true
69+
env:
70+
GITFILESHAREPWD: $(gitfileshare.pwd)
71+
72+
- job: windows_test
73+
displayName: Windows Test
74+
dependsOn: windows_build
75+
condition: succeeded()
76+
pool: Hosted
77+
timeoutInMinutes: 240
78+
strategy:
79+
parallel: 10
80+
steps:
81+
- powershell: |
82+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
83+
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
84+
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
85+
}
86+
displayName: 'Mount test-cache'
87+
env:
88+
GITFILESHAREPWD: $(gitfileshare.pwd)
89+
- task: DownloadPipelineArtifact@0
90+
displayName: 'Download Pipeline Artifact: test artifacts'
91+
inputs:
92+
artifactName: 'windows-artifacts'
93+
targetPath: '$(Build.SourcesDirectory)'
94+
- task: DownloadPipelineArtifact@0
95+
displayName: 'Download Pipeline Artifact: git-sdk-64-minimal'
96+
inputs:
97+
artifactName: 'git-sdk-64-minimal'
98+
targetPath: '$(Build.SourcesDirectory)\git-sdk-64-minimal'
99+
- powershell: |
100+
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
101+
test -f artifacts.tar.gz || {
102+
echo No test artifacts found\; skipping >&2
103+
exit 0
104+
}
105+
tar xf artifacts.tar.gz || exit 1
106+
107+
# Let Git ignore the SDK and the test-cache
108+
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
109+
110+
cd t &&
111+
T=`$(ls -S t[0-9]`*.sh | awk NR%`$SYSTEM_TOTALJOBSINPHASE==`$((`$SYSTEM_JOBPOSITIONINPHASE-1))) &&
112+
GIT_TEST_OPTS=\"--verbose-log -x\" GIT_PROVE_OPTS=\"--timer --jobs 10\" eval make -j10 `$T
113+
test 0 != `$? || exit 0
114+
cd test-results
115+
for t in `$(grep -l '^[1-9]' *.exit | sed -n 's/\.exit`$//p')
116+
do
117+
echo \"##vso[task.logissue type=error]Failed: `$t\"
118+
cat `$t.out
119+
done
120+
exit 1
121+
"@
122+
if (!$?) { exit(1) }
123+
displayName: 'Test (parallel)'
124+
env:
125+
HOME: $(Build.SourcesDirectory)
126+
MSYSTEM: MINGW64
127+
NO_SVN_TESTS: 1
128+
GIT_TEST_SKIP_REBASE_P: 1
129+
- powershell: |
130+
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
131+
cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
132+
}
133+
displayName: 'Unmount test-cache'
134+
condition: true
135+
env:
136+
GITFILESHAREPWD: $(gitfileshare.pwd)
137+
- task: PublishTestResults@2
138+
displayName: 'Publish Test Results **/TEST-*.xml'
139+
inputs:
140+
mergeTestResults: true
141+
testRunTitle: 'windows'
142+
platform: Windows
143+
publishRunAttachments: false
144+
condition: succeededOrFailed()
145+
- task: PublishBuildArtifacts@1
146+
displayName: 'Publish trash directories of failed tests'
147+
condition: failed()
148+
inputs:
149+
PathtoPublish: t/failed-test-artifacts
150+
ArtifactName: failed-test-artifacts
151+
152+
- job: linux_clang
7153
displayName: linux-clang
8154
condition: succeeded()
9-
queue:
10-
name: Hosted Ubuntu 1604
155+
pool: Hosted Ubuntu 1604
11156
steps:
12157
- bash: |
13158
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -37,11 +182,10 @@ phases:
37182
publishRunAttachments: false
38183
condition: succeededOrFailed()
39184

40-
- phase: linux_gcc
185+
- job: linux_gcc
41186
displayName: linux-gcc
42187
condition: succeeded()
43-
queue:
44-
name: Hosted Ubuntu 1604
188+
pool: Hosted Ubuntu 1604
45189
steps:
46190
- bash: |
47191
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -69,11 +213,10 @@ phases:
69213
publishRunAttachments: false
70214
condition: succeededOrFailed()
71215

72-
- phase: osx_clang
216+
- job: osx_clang
73217
displayName: osx-clang
74218
condition: succeeded()
75-
queue:
76-
name: Hosted macOS
219+
pool: Hosted macOS
77220
steps:
78221
- bash: |
79222
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -99,11 +242,10 @@ phases:
99242
publishRunAttachments: false
100243
condition: succeededOrFailed()
101244

102-
- phase: osx_gcc
245+
- job: osx_gcc
103246
displayName: osx-gcc
104247
condition: succeeded()
105-
queue:
106-
name: Hosted macOS
248+
pool: Hosted macOS
107249
steps:
108250
- bash: |
109251
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -127,11 +269,10 @@ phases:
127269
publishRunAttachments: false
128270
condition: succeededOrFailed()
129271

130-
- phase: gettext_poison
272+
- job: gettext_poison
131273
displayName: GETTEXT_POISON
132274
condition: succeeded()
133-
queue:
134-
name: Hosted Ubuntu 1604
275+
pool: Hosted Ubuntu 1604
135276
steps:
136277
- bash: |
137278
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -160,106 +301,10 @@ phases:
160301
publishRunAttachments: false
161302
condition: succeededOrFailed()
162303

163-
- phase: windows
164-
displayName: Windows
165-
queue:
166-
name: Hosted
167-
timeoutInMinutes: 240
168-
steps:
169-
- powershell: |
170-
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
171-
net use s: \\gitfileshare.file.core.windows.net\test-cache "$GITFILESHAREPWD" /user:AZURE\gitfileshare /persistent:no
172-
cmd /c mklink /d "$(Build.SourcesDirectory)\test-cache" S:\
173-
}
174-
displayName: 'Mount test-cache'
175-
env:
176-
GITFILESHAREPWD: $(gitfileshare.pwd)
177-
- powershell: |
178-
# Helper to check the error level of the latest command (exit with error when appropriate)
179-
function c() { if (!$?) { exit(1) } }
180-
181-
# Add build agent's MinGit to PATH
182-
$env:PATH = $env:AGENT_HOMEDIRECTORY +"\externals\\git\cmd;" +$env:PATH
183-
184-
# Helper to initialize (or update) a Git worktree
185-
function init ($path, $url, $set_origin) {
186-
if (Test-Path $path) {
187-
cd $path; c
188-
if (Test-Path .git) {
189-
git init; c
190-
} else {
191-
git status
192-
}
193-
} else {
194-
git init $path; c
195-
cd $path; c
196-
}
197-
git config core.autocrlf false; c
198-
git config core.untrackedCache true; c
199-
if (($set_origin -ne 0) -and !(git config remote.origin.url)) {
200-
git remote add origin $url; c
201-
}
202-
git fetch --depth=1 $url master; c
203-
git reset --hard FETCH_HEAD; c
204-
git clean -df; c
205-
}
206-
207-
# Initialize Git for Windows' SDK
208-
$sdk_path = "$(Build.SourcesDirectory)\git-sdk-64"
209-
init "$sdk_path" "https://dev.azure.com/git-for-windows/git-sdk-64/_git/git-sdk-64" 0
210-
init usr\src\build-extra https://github.com/git-for-windows/build-extra 1
211-
212-
# Let Git ignore the SDK and the test-cache
213-
"/git-sdk-64/`n/test-cache/`n" | Out-File -NoNewLine -Encoding ascii -Append "$(Build.SourcesDirectory)\.git\info\exclude"
214-
215-
# Help MSYS2 runtime startup by initializing /etc/passwd
216-
& "$sdk_path\git-cmd" --command=usr\\bin\\bash.exe -lc "mkpasswd -c >>/etc/passwd"; c
217-
displayName: 'Initialize the Git for Windows SDK'
218-
- powershell: |
219-
# Helper to check the error level of the latest command (exit with error when appropriate)
220-
function c() { if (!$?) { exit(1) } }
221-
222-
cd "$(Build.SourcesDirectory)"; c
223-
224-
git-sdk-64\git-cmd --command=usr\\bin\\bash.exe -lc @"
225-
export MAKEFLAGS=-j10
226-
export DEVELOPER=1
227-
export NO_PERL=1
228-
export NO_SVN_TESTS=1
229-
export GIT_TEST_SKIP_REBASE_P=1
230-
231-
ci/run-build-and-tests.sh || {
232-
ci/print-test-failures.sh
233-
exit 1
234-
}
235-
"@
236-
c
237-
displayName: 'Build & Test'
238-
env:
239-
HOME: $(Build.SourcesDirectory)
240-
MSYSTEM: MINGW64
241-
- powershell: |
242-
if ("$GITFILESHAREPWD" -ne "" -and "$GITFILESHAREPWD" -ne "`$`(gitfileshare.pwd)") {
243-
cmd /c rmdir "$(Build.SourcesDirectory)\test-cache"
244-
}
245-
displayName: 'Unmount test-cache'
246-
condition: true
247-
env:
248-
GITFILESHAREPWD: $(gitfileshare.pwd)
249-
- task: PublishTestResults@2
250-
displayName: 'Publish Test Results **/TEST-*.xml'
251-
inputs:
252-
mergeTestResults: true
253-
testRunTitle: 'windows'
254-
platform: Windows
255-
publishRunAttachments: false
256-
condition: succeededOrFailed()
257-
258-
- phase: linux32
304+
- job: linux32
259305
displayName: Linux32
260306
condition: succeeded()
261-
queue:
262-
name: Hosted Ubuntu 1604
307+
pool: Hosted Ubuntu 1604
263308
steps:
264309
- bash: |
265310
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -296,11 +341,10 @@ phases:
296341
publishRunAttachments: false
297342
condition: succeededOrFailed()
298343

299-
- phase: static_analysis
344+
- job: static_analysis
300345
displayName: StaticAnalysis
301346
condition: succeeded()
302-
queue:
303-
name: Hosted Ubuntu 1604
347+
pool: Hosted Ubuntu 1604
304348
steps:
305349
- bash: |
306350
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -318,11 +362,10 @@ phases:
318362
env:
319363
GITFILESHAREPWD: $(gitfileshare.pwd)
320364
321-
- phase: documentation
365+
- job: documentation
322366
displayName: Documentation
323367
condition: succeeded()
324-
queue:
325-
name: Hosted Ubuntu 1604
368+
pool: Hosted Ubuntu 1604
326369
steps:
327370
- bash: |
328371
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

builtin/fetch.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv, int pru
15881588

15891589
sigchain_push_common(unlock_pack_on_signal);
15901590
atexit(unlock_pack);
1591+
sigchain_push(SIGPIPE, SIG_IGN);
15911592
exit_code = do_fetch(gtransport, &rs);
1593+
sigchain_pop(SIGPIPE);
15921594
refspec_clear(&rs);
15931595
transport_disconnect(gtransport);
15941596
gtransport = NULL;

0 commit comments

Comments
 (0)