Skip to content

Commit 7be274b

Browse files
committed
Merge branch 'js/ci-windows-update' into maint
Updates to the CI settings. * js/ci-windows-update: Azure Pipeline: switch to the latest agent pools ci: prevent `perforce` from being quarantined t/lib-httpd: avoid using macOS' sed
2 parents 9a75ecd + 7f487ce commit 7be274b

10 files changed

+93
-73
lines changed

azure-pipelines.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ jobs:
55
- job: windows_build
66
displayName: Windows Build
77
condition: succeeded()
8-
pool: Hosted
8+
pool:
9+
vmImage: windows-latest
910
timeoutInMinutes: 240
1011
steps:
1112
- powershell: |
@@ -61,7 +62,8 @@ jobs:
6162
displayName: Windows Test
6263
dependsOn: windows_build
6364
condition: succeeded()
64-
pool: Hosted
65+
pool:
66+
vmImage: windows-latest
6567
timeoutInMinutes: 240
6668
strategy:
6769
parallel: 10
@@ -133,7 +135,8 @@ jobs:
133135
- job: vs_build
134136
displayName: Visual Studio Build
135137
condition: succeeded()
136-
pool: Hosted VS2017
138+
pool:
139+
vmImage: windows-latest
137140
timeoutInMinutes: 240
138141
steps:
139142
- powershell: |
@@ -181,6 +184,7 @@ jobs:
181184
platform: x64
182185
configuration: Release
183186
maximumCpuCount: 4
187+
msbuildArguments: /p:PlatformToolset=v142
184188
- powershell: |
185189
& compat\vcbuild\vcpkg_copy_dlls.bat release
186190
if (!$?) { exit(1) }
@@ -224,7 +228,8 @@ jobs:
224228
displayName: Visual Studio Test
225229
dependsOn: vs_build
226230
condition: succeeded()
227-
pool: Hosted
231+
pool:
232+
vmImage: windows-latest
228233
timeoutInMinutes: 240
229234
strategy:
230235
parallel: 10
@@ -292,7 +297,8 @@ jobs:
292297
- job: linux_clang
293298
displayName: linux-clang
294299
condition: succeeded()
295-
pool: Hosted Ubuntu 1604
300+
pool:
301+
vmImage: ubuntu-latest
296302
steps:
297303
- bash: |
298304
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -330,7 +336,8 @@ jobs:
330336
- job: linux_gcc
331337
displayName: linux-gcc
332338
condition: succeeded()
333-
pool: Hosted Ubuntu 1604
339+
pool:
340+
vmImage: ubuntu-latest
334341
steps:
335342
- bash: |
336343
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -367,7 +374,8 @@ jobs:
367374
- job: osx_clang
368375
displayName: osx-clang
369376
condition: succeeded()
370-
pool: Hosted macOS
377+
pool:
378+
vmImage: macOS-latest
371379
steps:
372380
- bash: |
373381
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -402,7 +410,8 @@ jobs:
402410
- job: osx_gcc
403411
displayName: osx-gcc
404412
condition: succeeded()
405-
pool: Hosted macOS
413+
pool:
414+
vmImage: macOS-latest
406415
steps:
407416
- bash: |
408417
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -435,7 +444,8 @@ jobs:
435444
- job: gettext_poison
436445
displayName: GETTEXT_POISON
437446
condition: succeeded()
438-
pool: Hosted Ubuntu 1604
447+
pool:
448+
vmImage: ubuntu-latest
439449
steps:
440450
- bash: |
441451
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -472,7 +482,8 @@ jobs:
472482
- job: linux32
473483
displayName: Linux32
474484
condition: succeeded()
475-
pool: Hosted Ubuntu 1604
485+
pool:
486+
vmImage: ubuntu-latest
476487
steps:
477488
- bash: |
478489
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -506,7 +517,8 @@ jobs:
506517
- job: static_analysis
507518
displayName: StaticAnalysis
508519
condition: succeeded()
509-
pool: Hosted Ubuntu 1604
520+
pool:
521+
vmImage: ubuntu-latest
510522
steps:
511523
- bash: |
512524
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1
@@ -526,7 +538,8 @@ jobs:
526538
- job: documentation
527539
displayName: Documentation
528540
condition: succeeded()
529-
pool: Hosted Ubuntu 1604
541+
pool:
542+
vmImage: ubuntu-latest
530543
steps:
531544
- bash: |
532545
test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1

ci/install-dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ osx-clang|osx-gcc)
4040
test -z "$BREW_INSTALL_PACKAGES" ||
4141
brew install $BREW_INSTALL_PACKAGES
4242
brew link --force gettext
43-
brew cask install perforce || {
43+
brew cask install --no-quarantine perforce || {
4444
# Update the definitions and try again
4545
cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
4646
git -C "$cask_repo" pull --no-stat &&
47-
brew cask install perforce
47+
brew cask install --no-quarantine perforce
4848
} ||
4949
brew install caskroom/cask/perforce
5050
case "$jobname" in

t/lib-httpd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ prepare_httpd() {
132132
install_script broken-smart-http.sh
133133
install_script error-smart-http.sh
134134
install_script error.sh
135-
install_script apply-one-time-sed.sh
135+
install_script apply-one-time-perl.sh
136136

137137
ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
138138

t/lib-httpd/apache.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Alias /auth/dumb/ www/auth/dumb/
113113
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
114114
SetEnv GIT_HTTP_EXPORT_ALL
115115
</LocationMatch>
116-
<LocationMatch /one_time_sed/>
116+
<LocationMatch /one_time_perl/>
117117
SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
118118
SetEnv GIT_HTTP_EXPORT_ALL
119119
</LocationMatch>
@@ -122,7 +122,7 @@ ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
122122
ScriptAlias /broken_smart/ broken-smart-http.sh/
123123
ScriptAlias /error_smart/ error-smart-http.sh/
124124
ScriptAlias /error/ error.sh/
125-
ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
125+
ScriptAliasMatch /one_time_perl/(.*) apply-one-time-perl.sh/$1
126126
<Directory ${GIT_EXEC_PATH}>
127127
Options FollowSymlinks
128128
</Directory>
@@ -135,7 +135,7 @@ ScriptAliasMatch /one_time_sed/(.*) apply-one-time-sed.sh/$1
135135
<Files error.sh>
136136
Options ExecCGI
137137
</Files>
138-
<Files apply-one-time-sed.sh>
138+
<Files apply-one-time-perl.sh>
139139
Options ExecCGI
140140
</Files>
141141
<Files ${GIT_EXEC_PATH}/git-http-backend>

t/lib-httpd/apply-one-time-perl.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
# If "one-time-perl" exists in $HTTPD_ROOT_PATH, run perl on the HTTP response,
4+
# using the contents of "one-time-perl" as the perl command to be run. If the
5+
# response was modified as a result, delete "one-time-perl" so that subsequent
6+
# HTTP responses are no longer modified.
7+
#
8+
# This can be used to simulate the effects of the repository changing in
9+
# between HTTP request-response pairs.
10+
if test -f one-time-perl
11+
then
12+
LC_ALL=C
13+
export LC_ALL
14+
15+
"$GIT_EXEC_PATH/git-http-backend" >out
16+
perl -pe "$(cat one-time-perl)" out >out_modified
17+
18+
if cmp -s out out_modified
19+
then
20+
cat out
21+
else
22+
cat out_modified
23+
rm one-time-perl
24+
fi
25+
else
26+
"$GIT_EXEC_PATH/git-http-backend"
27+
fi

t/lib-httpd/apply-one-time-sed.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

t/t5537-fetch-shallow.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
233233
git -C "$REPO" config protocol.version 2 &&
234234
git -C client config protocol.version 2 &&
235235
236-
git -C client fetch --depth=2 "$HTTPD_URL/one_time_sed/repo" master:a_branch &&
236+
git -C client fetch --depth=2 "$HTTPD_URL/one_time_perl/repo" master:a_branch &&
237237
238238
# Craft a situation in which the server sends back an unshallow request
239239
# with an empty packfile. This is done by refetching with a shorter
@@ -242,13 +242,13 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f
242242
printf "s/0034shallow %s/0036unshallow %s/" \
243243
"$(git -C "$REPO" rev-parse HEAD)" \
244244
"$(git -C "$REPO" rev-parse HEAD^)" \
245-
>"$HTTPD_ROOT_PATH/one-time-sed" &&
245+
>"$HTTPD_ROOT_PATH/one-time-perl" &&
246246
test_must_fail env GIT_TEST_SIDEBAND_ALL=0 git -C client \
247-
fetch --depth=1 "$HTTPD_URL/one_time_sed/repo" \
247+
fetch --depth=1 "$HTTPD_URL/one_time_perl/repo" \
248248
master:a_branch &&
249249
250-
# Ensure that the one-time-sed script was used.
251-
! test -e "$HTTPD_ROOT_PATH/one-time-sed" &&
250+
# Ensure that the one-time-perl script was used.
251+
! test -e "$HTTPD_ROOT_PATH/one-time-perl" &&
252252
253253
# Ensure that the resulting repo is consistent, despite our failure to
254254
# fetch.

t/t5616-partial-clone.sh

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,18 @@ intersperse () {
429429
sed 's/\(..\)/'$1'\1/g'
430430
}
431431

432-
# Create a one-time-sed command to replace the existing packfile with $1.
432+
# Create a one-time-perl command to replace the existing packfile with $1.
433433
replace_packfile () {
434434
# The protocol requires that the packfile be sent in sideband 1, hence
435435
# the extra \x01 byte at the beginning.
436-
printf "1,/packfile/!c %04x\\\\x01%s0000" \
437-
"$(($(wc -c <$1) + 5))" \
438-
"$(hex_unpack <$1 | intersperse '\\x')" \
439-
>"$HTTPD_ROOT_PATH/one-time-sed"
436+
cp $1 "$HTTPD_ROOT_PATH/one-time-pack" &&
437+
echo 'if (/packfile/) {
438+
print;
439+
my $length = -s "one-time-pack";
440+
printf "%04x\x01", $length + 5;
441+
print `cat one-time-pack` . "0000";
442+
last
443+
}' >"$HTTPD_ROOT_PATH/one-time-perl"
440444
}
441445

442446
test_expect_success 'upon cloning, check that all refs point to objects' '
@@ -460,16 +464,16 @@ test_expect_success 'upon cloning, check that all refs point to objects' '
460464
# \x01 byte at the beginning.
461465
replace_packfile incomplete.pack &&
462466
463-
# Use protocol v2 because the sed command looks for the "packfile"
467+
# Use protocol v2 because the perl command looks for the "packfile"
464468
# section header.
465469
test_config -C "$SERVER" protocol.version 2 &&
466470
test_must_fail git -c protocol.version=2 clone \
467-
--filter=blob:none $HTTPD_URL/one_time_sed/server repo 2>err &&
471+
--filter=blob:none $HTTPD_URL/one_time_perl/server repo 2>err &&
468472
469473
test_i18ngrep "did not send all necessary objects" err &&
470474
471-
# Ensure that the one-time-sed script was used.
472-
! test -e "$HTTPD_ROOT_PATH/one-time-sed"
475+
# Ensure that the one-time-perl script was used.
476+
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
473477
'
474478

475479
test_expect_success 'when partial cloning, tolerate server not sending target of tag' '
@@ -500,17 +504,17 @@ test_expect_success 'when partial cloning, tolerate server not sending target of
500504
# \x01 byte at the beginning.
501505
replace_packfile incomplete.pack &&
502506
503-
# Use protocol v2 because the sed command looks for the "packfile"
507+
# Use protocol v2 because the perl command looks for the "packfile"
504508
# section header.
505509
test_config -C "$SERVER" protocol.version 2 &&
506510
507511
# Exercise to make sure it works.
508512
git -c protocol.version=2 clone \
509-
--filter=blob:none $HTTPD_URL/one_time_sed/server repo 2> err &&
513+
--filter=blob:none $HTTPD_URL/one_time_perl/server repo 2> err &&
510514
! grep "missing object referenced by" err &&
511515
512-
# Ensure that the one-time-sed script was used.
513-
! test -e "$HTTPD_ROOT_PATH/one-time-sed"
516+
# Ensure that the one-time-perl script was used.
517+
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
514518
'
515519

516520
test_expect_success 'tolerate server sending REF_DELTA against missing promisor objects' '
@@ -533,7 +537,7 @@ test_expect_success 'tolerate server sending REF_DELTA against missing promisor
533537
534538
# Clone. The client has deltabase_have but not deltabase_missing.
535539
git -c protocol.version=2 clone --no-checkout \
536-
--filter=blob:none $HTTPD_URL/one_time_sed/server repo &&
540+
--filter=blob:none $HTTPD_URL/one_time_perl/server repo &&
537541
git -C repo hash-object -w -- "$SERVER/have.txt" &&
538542
539543
# Sanity check to ensure that the client does not have
@@ -574,7 +578,7 @@ test_expect_success 'tolerate server sending REF_DELTA against missing promisor
574578
575579
replace_packfile thin.pack &&
576580
577-
# Use protocol v2 because the sed command looks for the "packfile"
581+
# Use protocol v2 because the perl command looks for the "packfile"
578582
# section header.
579583
test_config -C "$SERVER" protocol.version 2 &&
580584
@@ -587,8 +591,8 @@ test_expect_success 'tolerate server sending REF_DELTA against missing promisor
587591
grep "want $(cat deltabase_missing)" trace &&
588592
! grep "want $(cat deltabase_have)" trace &&
589593
590-
# Ensure that the one-time-sed script was used.
591-
! test -e "$HTTPD_ROOT_PATH/one-time-sed"
594+
# Ensure that the one-time-perl script was used.
595+
! test -e "$HTTPD_ROOT_PATH/one-time-perl"
592596
'
593597

594598
# DO NOT add non-httpd-specific tests here, because the last part of this

t/t5702-protocol-v2.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,11 +712,11 @@ test_expect_success 'when server sends "ready", expect DELIM' '
712712
713713
# After "ready" in the acknowledgments section, pretend that a FLUSH
714714
# (0000) was sent instead of a DELIM (0001).
715-
printf "/ready/,$ s/0001/0000/" \
716-
>"$HTTPD_ROOT_PATH/one-time-sed" &&
715+
printf "\$ready = 1 if /ready/; \$ready && s/0001/0000/" \
716+
>"$HTTPD_ROOT_PATH/one-time-perl" &&
717717
718718
test_must_fail git -C http_child -c protocol.version=2 \
719-
fetch "$HTTPD_URL/one_time_sed/http_parent" 2> err &&
719+
fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err &&
720720
test_i18ngrep "expected packfile to be sent after .ready." err
721721
'
722722

@@ -737,12 +737,12 @@ test_expect_success 'when server does not send "ready", expect FLUSH' '
737737
738738
# After the acknowledgments section, pretend that a DELIM
739739
# (0001) was sent instead of a FLUSH (0000).
740-
printf "/acknowledgments/,$ s/0000/0001/" \
741-
>"$HTTPD_ROOT_PATH/one-time-sed" &&
740+
printf "\$ack = 1 if /acknowledgments/; \$ack && s/0000/0001/" \
741+
>"$HTTPD_ROOT_PATH/one-time-perl" &&
742742
743743
test_must_fail env GIT_TRACE_PACKET="$(pwd)/log" git -C http_child \
744744
-c protocol.version=2 \
745-
fetch "$HTTPD_URL/one_time_sed/http_parent" 2> err &&
745+
fetch "$HTTPD_URL/one_time_perl/http_parent" 2> err &&
746746
grep "fetch< .*acknowledgments" log &&
747747
! grep "fetch< .*ready" log &&
748748
test_i18ngrep "expected no other sections to be sent after no .ready." err

0 commit comments

Comments
 (0)