Skip to content

Commit f9d4bb7

Browse files
committed
Merge branch 'ps/ci-misc-updates' into jk/ci-coverity-update
* ps/ci-misc-updates: ci: remove stale code for Azure Pipelines ci: use latest Ubuntu release ci: stop special-casing for Ubuntu 16.04 gitlab-ci: add linux32 job testing against i386 gitlab-ci: remove the "linux-old" job github: simplify computation of the job's distro github: convert all Linux jobs to be containerized github: adapt containerized jobs to be rootless t7422: fix flaky test caused by buffered stdout t0060: fix EBUSY in MinGW when setting up runtime prefix
2 parents f93ff17 + e39e332 commit f9d4bb7

File tree

7 files changed

+100
-95
lines changed

7 files changed

+100
-95
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -259,20 +259,6 @@ jobs:
259259
fail-fast: false
260260
matrix:
261261
vector:
262-
- jobname: linux-sha256
263-
cc: clang
264-
pool: ubuntu-latest
265-
- jobname: linux-reftable
266-
cc: clang
267-
pool: ubuntu-latest
268-
- jobname: linux-gcc
269-
cc: gcc
270-
cc_package: gcc-8
271-
pool: ubuntu-20.04
272-
- jobname: linux-TEST-vars
273-
cc: gcc
274-
cc_package: gcc-8
275-
pool: ubuntu-20.04
276262
- jobname: osx-clang
277263
cc: clang
278264
pool: macos-13
@@ -285,26 +271,11 @@ jobs:
285271
- jobname: osx-meson
286272
cc: clang
287273
pool: macos-13
288-
- jobname: linux-gcc-default
289-
cc: gcc
290-
pool: ubuntu-latest
291-
- jobname: linux-leaks
292-
cc: gcc
293-
pool: ubuntu-latest
294-
- jobname: linux-reftable-leaks
295-
cc: gcc
296-
pool: ubuntu-latest
297-
- jobname: linux-asan-ubsan
298-
cc: clang
299-
pool: ubuntu-latest
300-
- jobname: linux-meson
301-
cc: gcc
302-
pool: ubuntu-latest
303274
env:
304275
CC: ${{matrix.vector.cc}}
305276
CC_PACKAGE: ${{matrix.vector.cc_package}}
306277
jobname: ${{matrix.vector.jobname}}
307-
distro: ${{matrix.vector.pool}}
278+
CI_JOB_IMAGE: ${{matrix.vector.pool}}
308279
TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
309280
runs-on: ${{matrix.vector.pool}}
310281
steps:
@@ -342,27 +313,52 @@ jobs:
342313
fail-fast: false
343314
matrix:
344315
vector:
316+
- jobname: linux-sha256
317+
image: ubuntu:rolling
318+
cc: clang
319+
- jobname: linux-reftable
320+
image: ubuntu:rolling
321+
cc: clang
322+
- jobname: linux-gcc
323+
image: ubuntu:20.04
324+
cc: gcc
325+
cc_package: gcc-8
326+
- jobname: linux-TEST-vars
327+
image: ubuntu:20.04
328+
cc: gcc
329+
cc_package: gcc-8
330+
- jobname: linux-gcc-default
331+
image: ubuntu:rolling
332+
cc: gcc
333+
- jobname: linux-leaks
334+
image: ubuntu:rolling
335+
cc: gcc
336+
- jobname: linux-reftable-leaks
337+
image: ubuntu:rolling
338+
cc: gcc
339+
- jobname: linux-asan-ubsan
340+
image: ubuntu:rolling
341+
cc: clang
342+
- jobname: linux-meson
343+
image: ubuntu:rolling
344+
cc: gcc
345345
- jobname: linux-musl
346-
image: alpine
347-
distro: alpine-latest
346+
image: alpine:latest
348347
# Supported until 2025-04-02.
349348
- jobname: linux32
350349
image: i386/ubuntu:focal
351-
distro: ubuntu32-20.04
352350
- jobname: pedantic
353-
image: fedora
354-
distro: fedora-latest
351+
image: fedora:latest
355352
# A RHEL 8 compatible distro. Supported until 2029-05-31.
356353
- jobname: almalinux-8
357354
image: almalinux:8
358-
distro: almalinux-8
359355
# Supported until 2026-08-31.
360356
- jobname: debian-11
361357
image: debian:11
362-
distro: debian-11
363358
env:
364359
jobname: ${{matrix.vector.jobname}}
365-
distro: ${{matrix.vector.distro}}
360+
CC: ${{matrix.vector.cc}}
361+
CI_JOB_IMAGE: ${{matrix.vector.image}}
366362
runs-on: ubuntu-latest
367363
container: ${{matrix.vector.image}}
368364
steps:
@@ -371,10 +367,12 @@ jobs:
371367
run: apt -q update && apt -q -y install libc6-amd64 lib64stdc++6
372368
- uses: actions/checkout@v4
373369
- run: ci/install-dependencies.sh
374-
- run: ci/run-build-and-tests.sh
370+
- run: useradd builder --create-home
371+
- run: chown -R builder .
372+
- run: sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh
375373
- name: print test failures
376374
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
377-
run: ci/print-test-failures.sh
375+
run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh
378376
- name: Upload failed tests' directories
379377
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
380378
uses: actions/upload-artifact@v4

.gitlab-ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@ test:linux:
3636
fi
3737
parallel:
3838
matrix:
39-
- jobname: linux-old
40-
image: ubuntu:20.04
41-
CC: gcc
4239
- jobname: linux-sha256
43-
image: ubuntu:latest
40+
image: ubuntu:rolling
4441
CC: clang
4542
- jobname: linux-reftable
46-
image: ubuntu:latest
43+
image: ubuntu:rolling
4744
CC: clang
4845
- jobname: linux-gcc
4946
image: ubuntu:20.04
@@ -54,23 +51,25 @@ test:linux:
5451
CC: gcc
5552
CC_PACKAGE: gcc-8
5653
- jobname: linux-gcc-default
57-
image: ubuntu:latest
54+
image: ubuntu:rolling
5855
CC: gcc
5956
- jobname: linux-leaks
60-
image: ubuntu:latest
57+
image: ubuntu:rolling
6158
CC: gcc
6259
- jobname: linux-reftable-leaks
63-
image: ubuntu:latest
60+
image: ubuntu:rolling
6461
CC: gcc
6562
- jobname: linux-asan-ubsan
66-
image: ubuntu:latest
63+
image: ubuntu:rolling
6764
CC: clang
6865
- jobname: pedantic
6966
image: fedora:latest
7067
- jobname: linux-musl
7168
image: alpine:latest
69+
- jobname: linux32
70+
image: i386/ubuntu:20.04
7271
- jobname: linux-meson
73-
image: ubuntu:latest
72+
image: ubuntu:rolling
7473
CC: gcc
7574
artifacts:
7675
paths:

ci/install-dependencies.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ alpine-*)
3131
;;
3232
fedora-*|almalinux-*)
3333
dnf -yq update >/dev/null &&
34-
dnf -yq install make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
34+
dnf -yq install shadow-utils sudo make gcc findutils diffutils perl python3 gettext zlib-devel expat-devel openssl-devel curl-devel pcre2-devel >/dev/null
3535
;;
36-
ubuntu-*|ubuntu32-*|debian-*)
36+
ubuntu-*|i386/ubuntu-*|debian-*)
3737
# Required so that apt doesn't wait for user input on certain packages.
3838
export DEBIAN_FRONTEND=noninteractive
3939

@@ -42,7 +42,7 @@ ubuntu-*|ubuntu32-*|debian-*)
4242
SVN='libsvn-perl subversion'
4343
LANGUAGES='language-pack-is'
4444
;;
45-
ubuntu32-*)
45+
i386/ubuntu-*)
4646
SVN=
4747
LANGUAGES='language-pack-is'
4848
;;

ci/lib.sh

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,7 @@ export TERM=${TERM:-dumb}
206206
# Clear MAKEFLAGS that may come from the outside world.
207207
export MAKEFLAGS=
208208

209-
if test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
210-
then
211-
CI_TYPE=azure-pipelines
212-
# We are running in Azure Pipelines
213-
CI_BRANCH="$BUILD_SOURCEBRANCH"
214-
CI_COMMIT="$BUILD_SOURCEVERSION"
215-
CI_JOB_ID="$BUILD_BUILDID"
216-
CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
217-
CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
218-
test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
219-
CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
220-
CC="${CC:-gcc}"
221-
222-
# use a subdirectory of the cache dir (because the file share is shared
223-
# among *all* phases)
224-
cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
225-
226-
GIT_TEST_OPTS="--write-junit-xml"
227-
JOBS=10
228-
elif test true = "$GITHUB_ACTIONS"
209+
if test true = "$GITHUB_ACTIONS"
229210
then
230211
CI_TYPE=github-actions
231212
CI_BRANCH="$GITHUB_REF"
@@ -246,6 +227,8 @@ then
246227

247228
GIT_TEST_OPTS="--github-workflow-markup"
248229
JOBS=10
230+
231+
distro=$(echo "$CI_JOB_IMAGE" | tr : -)
249232
elif test true = "$GITLAB_CI"
250233
then
251234
CI_TYPE=gitlab-ci
@@ -267,7 +250,7 @@ then
267250
CI_OS_NAME=osx
268251
JOBS=$(nproc)
269252
;;
270-
*,alpine:*|*,fedora:*|*,ubuntu:*)
253+
*,alpine:*|*,fedora:*|*,ubuntu:*|*,i386/ubuntu:*)
271254
CI_OS_NAME=linux
272255
JOBS=$(nproc)
273256
;;
@@ -345,14 +328,7 @@ ubuntu-*)
345328
fi
346329
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
347330

348-
case "$distro" in
349-
ubuntu-16.04)
350-
# Apache is too old for HTTP/2.
351-
;;
352-
*)
353-
export GIT_TEST_HTTPD=true
354-
;;
355-
esac
331+
export GIT_TEST_HTTPD=true
356332

357333
# The Linux build installs the defined dependency versions below.
358334
# The OS X build installs much more recent versions, whichever

ci/print-test-failures.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ do
3939
test_name="${test_name##*/}"
4040
trash_dir="trash directory.$test_name"
4141
case "$CI_TYPE" in
42-
azure-pipelines)
43-
mkdir -p failed-test-artifacts
44-
mv "$trash_dir" failed-test-artifacts
45-
continue
46-
;;
4742
github-actions)
4843
mkdir -p failed-test-artifacts
4944
echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV

t/t0060-path-utils.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,17 +592,19 @@ test_lazy_prereq CAN_EXEC_IN_PWD '
592592
./git rev-parse
593593
'
594594

595+
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'setup runtime prefix' '
596+
mkdir -p pretend/bin &&
597+
cp "$GIT_EXEC_PATH"/git$X pretend/bin/
598+
'
599+
595600
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD 'RUNTIME_PREFIX works' '
596-
mkdir -p pretend/bin pretend/libexec/git-core &&
601+
mkdir -p pretend/libexec/git-core &&
597602
echo "echo HERE" | write_script pretend/libexec/git-core/git-here &&
598-
cp "$GIT_EXEC_PATH"/git$X pretend/bin/ &&
599603
GIT_EXEC_PATH= ./pretend/bin/git here >actual &&
600604
echo HERE >expect &&
601605
test_cmp expect actual'
602606

603607
test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD '%(prefix)/ works' '
604-
mkdir -p pretend/bin &&
605-
cp "$GIT_EXEC_PATH"/git$X pretend/bin/ &&
606608
git config yes.path "%(prefix)/yes" &&
607609
GIT_EXEC_PATH= ./pretend/bin/git config --path yes.path >actual &&
608610
echo "$(pwd)/pretend/yes" >expect &&

t/t7422-submodule-output.sh

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,45 @@ do
167167
done
168168

169169
test_expect_success !MINGW 'git submodule status --recursive propagates SIGPIPE' '
170-
{ git submodule status --recursive 2>err; echo $?>status; } |
171-
grep -q X/S &&
172-
test_must_be_empty err &&
173-
test_match_signal 13 "$(cat status)"
170+
# The test setup is somewhat involved because triggering a SIGPIPE is
171+
# racy with buffered pipes. To avoid the raciness we thus need to make
172+
# sure that the subprocess in question fills the buffers completely,
173+
# which requires a couple thousand submodules in total.
174+
test_when_finished "rm -rf submodule repo" &&
175+
git init submodule &&
176+
(
177+
cd submodule &&
178+
test_commit initial &&
179+
180+
COMMIT=$(git rev-parse HEAD) &&
181+
for i in $(test_seq 2000)
182+
do
183+
printf "[submodule \"sm-$i\"]\npath = recursive-submodule-path-$i\n" "$i" ||
184+
return 1
185+
done >gitmodules &&
186+
BLOB=$(git hash-object -w --stdin <gitmodules) &&
187+
188+
printf "100644 blob $BLOB\t.gitmodules\n" >tree &&
189+
for i in $(test_seq 2000)
190+
do
191+
printf "160000 commit $COMMIT\trecursive-submodule-path-%d\n" "$i" ||
192+
return 1
193+
done >>tree &&
194+
TREE=$(git mktree <tree) &&
195+
196+
COMMIT=$(git commit-tree "$TREE") &&
197+
git reset --hard "$COMMIT"
198+
) &&
199+
200+
git init repo &&
201+
(
202+
cd repo &&
203+
GIT_ALLOW_PROTOCOL=file git submodule add "$(pwd)"/../submodule &&
204+
{ git submodule status --recursive 2>err; echo $?>status; } |
205+
grep -q recursive-submodule-path-1 &&
206+
test_must_be_empty err &&
207+
test_match_signal 13 "$(cat status)"
208+
)
174209
'
175210

176211
test_done

0 commit comments

Comments
 (0)