Git fork

Merge branch 'ps/ci-misc-updates'

CI updates (containerization, dropping stale ones, etc.).

* 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

+95 -90
+34 -36
.github/workflows/main.yml
··· 311 311 fail-fast: false 312 312 matrix: 313 313 vector: 314 - - jobname: linux-sha256 315 - cc: clang 316 - pool: ubuntu-latest 317 - - jobname: linux-reftable 318 - cc: clang 319 - pool: ubuntu-latest 320 - - jobname: linux-breaking-changes 321 - cc: gcc 322 - pool: ubuntu-20.04 323 - - jobname: linux-TEST-vars 324 - cc: gcc 325 - cc_package: gcc-8 326 - pool: ubuntu-20.04 327 314 - jobname: osx-clang 328 315 cc: clang 329 316 pool: macos-13 ··· 336 323 - jobname: osx-meson 337 324 cc: clang 338 325 pool: macos-13 339 - - jobname: linux-leaks 340 - cc: gcc 341 - pool: ubuntu-latest 342 - - jobname: linux-reftable-leaks 343 - cc: gcc 344 - pool: ubuntu-latest 345 - - jobname: linux-asan-ubsan 346 - cc: clang 347 - pool: ubuntu-latest 348 - - jobname: linux-meson 349 - cc: gcc 350 - pool: ubuntu-latest 351 326 env: 352 327 CC: ${{matrix.vector.cc}} 353 328 CC_PACKAGE: ${{matrix.vector.cc_package}} 354 329 jobname: ${{matrix.vector.jobname}} 355 - distro: ${{matrix.vector.pool}} 330 + CI_JOB_IMAGE: ${{matrix.vector.pool}} 356 331 TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t 357 332 runs-on: ${{matrix.vector.pool}} 358 333 steps: ··· 390 365 fail-fast: false 391 366 matrix: 392 367 vector: 368 + - jobname: linux-sha256 369 + image: ubuntu:rolling 370 + cc: clang 371 + - jobname: linux-reftable 372 + image: ubuntu:rolling 373 + cc: clang 374 + - jobname: linux-TEST-vars 375 + image: ubuntu:20.04 376 + cc: gcc 377 + cc_package: gcc-8 378 + - jobname: linux-breaking-changes 379 + cc: gcc 380 + image: ubuntu:rolling 381 + - jobname: linux-leaks 382 + image: ubuntu:rolling 383 + cc: gcc 384 + - jobname: linux-reftable-leaks 385 + image: ubuntu:rolling 386 + cc: gcc 387 + - jobname: linux-asan-ubsan 388 + image: ubuntu:rolling 389 + cc: clang 390 + - jobname: linux-meson 391 + image: ubuntu:rolling 392 + cc: gcc 393 393 - jobname: linux-musl 394 - image: alpine 395 - distro: alpine-latest 394 + image: alpine:latest 396 395 # Supported until 2025-04-02. 397 396 - jobname: linux32 398 397 image: i386/ubuntu:focal 399 - distro: ubuntu32-20.04 400 398 - jobname: pedantic 401 - image: fedora 402 - distro: fedora-latest 399 + image: fedora:latest 403 400 # A RHEL 8 compatible distro. Supported until 2029-05-31. 404 401 - jobname: almalinux-8 405 402 image: almalinux:8 406 - distro: almalinux-8 407 403 # Supported until 2026-08-31. 408 404 - jobname: debian-11 409 405 image: debian:11 410 - distro: debian-11 411 406 env: 412 407 jobname: ${{matrix.vector.jobname}} 413 - distro: ${{matrix.vector.distro}} 408 + CC: ${{matrix.vector.cc}} 409 + CI_JOB_IMAGE: ${{matrix.vector.image}} 414 410 runs-on: ubuntu-latest 415 411 container: ${{matrix.vector.image}} 416 412 steps: ··· 419 415 run: apt -q update && apt -q -y install libc6-amd64 lib64stdc++6 420 416 - uses: actions/checkout@v4 421 417 - run: ci/install-dependencies.sh 422 - - run: ci/run-build-and-tests.sh 418 + - run: useradd builder --create-home 419 + - run: chown -R builder . 420 + - run: sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh 423 421 - name: print test failures 424 422 if: failure() && env.FAILED_TEST_ARTIFACTS != '' 425 - run: ci/print-test-failures.sh 423 + run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh 426 424 - name: Upload failed tests' directories 427 425 if: failure() && env.FAILED_TEST_ARTIFACTS != '' 428 426 uses: actions/upload-artifact@v4
+8 -9
.gitlab-ci.yml
··· 36 36 fi 37 37 parallel: 38 38 matrix: 39 - - jobname: linux-old 40 - image: ubuntu:20.04 41 - CC: gcc 42 39 - jobname: linux-sha256 43 - image: ubuntu:latest 40 + image: ubuntu:rolling 44 41 CC: clang 45 42 - jobname: linux-reftable 46 - image: ubuntu:latest 43 + image: ubuntu:rolling 47 44 CC: clang 48 45 - jobname: linux-breaking-changes 49 46 image: ubuntu:20.04 ··· 53 50 CC: gcc 54 51 CC_PACKAGE: gcc-8 55 52 - jobname: linux-leaks 56 - image: ubuntu:latest 53 + image: ubuntu:rolling 57 54 CC: gcc 58 55 - jobname: linux-reftable-leaks 59 - image: ubuntu:latest 56 + image: ubuntu:rolling 60 57 CC: gcc 61 58 - jobname: linux-asan-ubsan 62 - image: ubuntu:latest 59 + image: ubuntu:rolling 63 60 CC: clang 64 61 - jobname: pedantic 65 62 image: fedora:latest 66 63 - jobname: linux-musl 67 64 image: alpine:latest 65 + - jobname: linux32 66 + image: i386/ubuntu:20.04 68 67 - jobname: linux-meson 69 - image: ubuntu:latest 68 + image: ubuntu:rolling 70 69 CC: gcc 71 70 artifacts: 72 71 paths:
+3 -3
ci/install-dependencies.sh
··· 31 31 ;; 32 32 fedora-*|almalinux-*) 33 33 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 35 35 ;; 36 - ubuntu-*|ubuntu32-*|debian-*) 36 + ubuntu-*|i386/ubuntu-*|debian-*) 37 37 # Required so that apt doesn't wait for user input on certain packages. 38 38 export DEBIAN_FRONTEND=noninteractive 39 39 ··· 42 42 SVN='libsvn-perl subversion' 43 43 LANGUAGES='language-pack-is' 44 44 ;; 45 - ubuntu32-*) 45 + i386/ubuntu-*) 46 46 SVN= 47 47 LANGUAGES='language-pack-is' 48 48 ;;
+5 -29
ci/lib.sh
··· 206 206 # Clear MAKEFLAGS that may come from the outside world. 207 207 export MAKEFLAGS= 208 208 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" 229 210 then 230 211 CI_TYPE=github-actions 231 212 CI_BRANCH="$GITHUB_REF" ··· 246 227 247 228 GIT_TEST_OPTS="--github-workflow-markup" 248 229 JOBS=10 230 + 231 + distro=$(echo "$CI_JOB_IMAGE" | tr : -) 249 232 elif test true = "$GITLAB_CI" 250 233 then 251 234 CI_TYPE=gitlab-ci ··· 267 250 CI_OS_NAME=osx 268 251 JOBS=$(nproc) 269 252 ;; 270 - *,alpine:*|*,fedora:*|*,ubuntu:*) 253 + *,alpine:*|*,fedora:*|*,ubuntu:*|*,i386/ubuntu:*) 271 254 CI_OS_NAME=linux 272 255 JOBS=$(nproc) 273 256 ;; ··· 340 323 fi 341 324 MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE" 342 325 343 - case "$distro" in 344 - ubuntu-16.04) 345 - # Apache is too old for HTTP/2. 346 - ;; 347 - *) 348 - export GIT_TEST_HTTPD=true 349 - ;; 350 - esac 326 + export GIT_TEST_HTTPD=true 351 327 352 328 # The Linux build installs the defined dependency versions below. 353 329 # The OS X build installs much more recent versions, whichever
-5
ci/print-test-failures.sh
··· 39 39 test_name="${test_name##*/}" 40 40 trash_dir="trash directory.$test_name" 41 41 case "$CI_TYPE" in 42 - azure-pipelines) 43 - mkdir -p failed-test-artifacts 44 - mv "$trash_dir" failed-test-artifacts 45 - continue 46 - ;; 47 42 github-actions) 48 43 mkdir -p failed-test-artifacts 49 44 echo "FAILED_TEST_ARTIFACTS=${TEST_OUTPUT_DIRECTORY:t}/failed-test-artifacts" >>$GITHUB_ENV
+6 -4
t/t0060-path-utils.sh
··· 592 592 ./git rev-parse 593 593 ' 594 594 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 + 595 600 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 && 597 602 echo "echo HERE" | write_script pretend/libexec/git-core/git-here && 598 - cp "$GIT_EXEC_PATH"/git$X pretend/bin/ && 599 603 GIT_EXEC_PATH= ./pretend/bin/git here >actual && 600 604 echo HERE >expect && 601 605 test_cmp expect actual' 602 606 603 607 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/ && 606 608 git config yes.path "%(prefix)/yes" && 607 609 GIT_EXEC_PATH= ./pretend/bin/git config --path yes.path >actual && 608 610 echo "$(pwd)/pretend/yes" >expect &&
+39 -4
t/t7422-submodule-output.sh
··· 167 167 done 168 168 169 169 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 + ) 174 209 ' 175 210 176 211 test_done