diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7dbf9f7f123c895348981507f44b0616561671d0..804c64a7c15433f78f1c0681816d8370ce487e6a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -298,7 +298,7 @@ jobs: path: build - name: Test shell: pwsh - run: meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % 10 } | Where-Object Name -EQ ${{ matrix.nr }} | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group } + run: meson test -C build --no-rebuild --print-errorlogs --slice "$(1+${{ matrix.nr }})/10" regular: name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}}) @@ -376,9 +376,6 @@ jobs: image: ubuntu:20.04 cc: gcc cc_package: gcc-8 - - jobname: linux-breaking-changes - cc: gcc - image: ubuntu:rolling - jobname: linux-leaks image: ubuntu:rolling cc: gcc @@ -396,7 +393,7 @@ jobs: # Supported until 2025-04-02. - jobname: linux32 image: i386/ubuntu:focal - - jobname: pedantic + - jobname: linux-breaking-changes image: fedora:latest # A RHEL 8 compatible distro. Supported until 2029-05-31. - jobname: almalinux-8 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb6d5b976cdc36e3cbeedba16c83c1f7d6a500b9..ca7745cc426c50ab9da367c0040f5701ebb2cdd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,9 +42,6 @@ test:linux: - jobname: linux-reftable image: ubuntu:rolling CC: clang - - jobname: linux-breaking-changes - image: ubuntu:20.04 - CC: gcc - jobname: linux-TEST-vars image: ubuntu:20.04 CC: gcc @@ -58,7 +55,7 @@ test:linux: - jobname: linux-asan-ubsan image: ubuntu:rolling CC: clang - - jobname: pedantic + - jobname: linux-breaking-changes image: fedora:latest - jobname: linux-musl-meson image: alpine:latest @@ -178,9 +175,30 @@ test:msvc-meson: - job: "build:msvc-meson" artifacts: true script: - - meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % $Env:CI_NODE_TOTAL + 1 } | Where-Object Name -EQ $Env:CI_NODE_INDEX | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group; if (!$?) { exit $LASTEXITCODE } } + - meson test -C build --no-rebuild --print-errorlogs --slice $Env:CI_NODE_INDEX/$Env:CI_NODE_TOTAL parallel: 10 +build:msys2-meson: + tags: + - saas-windows-medium-amd64 + stage: build + before_script: + # https://www.msys2.org/docs/ci/ + - wget.exe --no-verbose --output-document=msys2.exe https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe + - ./msys2.exe -y -oC:\ + - $env:CHERE_INVOKING = 'yes' + - C:\msys64\usr\bin\bash -lc ' ' + - C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' + - C:\msys64\usr\bin\bash -lc './ci/install-dependencies.sh' + script: + - C:\msys64\usr\bin\bash -lc './ci/run-build.sh' + parallel: + matrix: + - jobname: windows-msys-meson + MSYSTEM: MSYS + - jobname: windows-mingw64-meson + MSYSTEM: MINGW64 + test:fuzz-smoke-tests: image: ubuntu:latest stage: test diff --git a/Documentation/meson.build b/Documentation/meson.build index 2fe1a1369d444d273f3d05c73a23c513665ed30b..4404c623f006dbc2f20a9e373576891701c8cb90 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -375,8 +375,7 @@ foreach manpage, category : manpages output: fs.stem(manpage) + '.xml', ) - manpage_path = fs.stem(manpage) + '.' + category.to_string() - manpage_target = custom_target( + custom_target( command: [ xmlto, '-m', '@INPUT0@', @@ -392,7 +391,7 @@ foreach manpage, category : manpages 'manpage-normal.xsl', 'manpage-bold-literal.xsl', ], - output: manpage_path, + output: fs.stem(manpage) + '.' + category.to_string(), install: true, install_dir: get_option('mandir') / 'man' + category.to_string(), ) diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index d061a4729339e097f868ac3bc5e01461f0ee42f7..edef5f51da8cff39e7e1e8d1d998b2dfa6c130af 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -114,6 +114,16 @@ macos-*) ;; esac +case "$MSYSTEM" in +MSYS) + pacman --noconfirm -Syuu diffutils git gcc libcurl-devel libexpat-devel libzstd-devel meson ninja openssl-devel pcre2-devel pkg-config zlib-devel + ;; +MINGW64) + PREFIX=mingw-w64-x86_64 + pacman --noconfirm -Syuu diffutils git $PREFIX-gcc $PREFIX-curl $PREFIX-expat $PREFIX-zstd $PREFIX-meson $PREFIX-ninja $PREFIX-openssl $PREFIX-pcre2 $PREFIX-pkg-config $PREFIX-zlib + ;; +esac + case "$jobname" in ClangFormat) sudo apt-get -q update diff --git a/ci/lib.sh b/ci/lib.sh index f561884d40166cc6bdde07e178170ba33aac1347..c3656bb2e3e5b477cb8be0420e2acba9add6e08b 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -344,6 +344,12 @@ esac CUSTOM_PATH="${CUSTOM_PATH:-$HOME/path}" export PATH="$CUSTOM_PATH:$PATH" +case "$jobname" in +*-leaks) + export SANITIZE=leak + ;; +esac + case "$jobname" in linux32) CC=gcc @@ -354,14 +360,39 @@ linux-meson) linux-musl-meson) MESONFLAGS="$MESONFLAGS -Dtest_utf8_locale=C.UTF-8" ;; -linux-leaks|linux-reftable-leaks) - export SANITIZE=leak - ;; linux-asan-ubsan) export SANITIZE=address,undefined export NO_SVN_TESTS=LetsSaveSomeTime MAKEFLAGS="$MAKEFLAGS NO_PYTHON=YepBecauseP4FlakesTooOften" ;; +linux-breaking-changes) + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export WITH_BREAKING_CHANGES=YesPlease + ;; +linux-TEST-vars) + export OPENSSL_SHA1_UNSAFE=YesPlease + export GIT_TEST_SPLIT_INDEX=yes + export GIT_TEST_FULL_IN_PACK_ARRAY=true + export GIT_TEST_OE_SIZE=10 + export GIT_TEST_OE_DELTA_SIZE=5 + export GIT_TEST_COMMIT_GRAPH=1 + export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1 + export GIT_TEST_MULTI_PACK_INDEX=1 + export GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL=1 + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master + export GIT_TEST_NO_WRITE_REV_INDEX=1 + export GIT_TEST_CHECKOUT_WORKERS=2 + export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1 + ;; +linux-clang) + export GIT_TEST_DEFAULT_HASH=sha1 + ;; +linux-sha256) + export GIT_TEST_DEFAULT_HASH=sha256 + ;; +linux-reftable|linux-reftable-leaks|osx-reftable) + export GIT_TEST_DEFAULT_REF_FORMAT=reftable + ;; osx-meson) MESONFLAGS="$MESONFLAGS -Dcredential_helpers=osxkeychain" ;; diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 01823fd0f140bb43fc94eedf47384fd6a125f728..e639e65fbbb7b0e02d69b6be8aa5c1050f6b2bf7 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -5,72 +5,19 @@ . ${0%/*}/lib.sh -run_tests=t - -case "$jobname" in -linux-breaking-changes) - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main - export WITH_BREAKING_CHANGES=YesPlease - ;; -linux-TEST-vars) - export OPENSSL_SHA1_UNSAFE=YesPlease - export GIT_TEST_SPLIT_INDEX=yes - export GIT_TEST_FULL_IN_PACK_ARRAY=true - export GIT_TEST_OE_SIZE=10 - export GIT_TEST_OE_DELTA_SIZE=5 - export GIT_TEST_COMMIT_GRAPH=1 - export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1 - export GIT_TEST_MULTI_PACK_INDEX=1 - export GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL=1 - export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master - export GIT_TEST_NO_WRITE_REV_INDEX=1 - export GIT_TEST_CHECKOUT_WORKERS=2 - export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1 - ;; -linux-clang) - export GIT_TEST_DEFAULT_HASH=sha1 - ;; -linux-sha256) - export GIT_TEST_DEFAULT_HASH=sha256 - ;; -linux-reftable|linux-reftable-leaks|osx-reftable) - export GIT_TEST_DEFAULT_REF_FORMAT=reftable - ;; -pedantic) - # Don't run the tests; we only care about whether Git can be - # built. - export DEVOPTS=pedantic - run_tests= - ;; -esac +${0%/*}/run-build.sh case "$jobname" in *-meson) - group "Configure" meson setup build . \ - --fatal-meson-warnings \ - --warnlevel 2 --werror \ - --wrap-mode nofallback \ - -Dfuzzers=true \ - -Dtest_output_directory="${TEST_OUTPUT_DIRECTORY:-$(pwd)/t}" \ - $MESONFLAGS - group "Build" meson compile -C build -- - if test -n "$run_tests" - then - group "Run tests" meson test -C build --print-errorlogs --test-args="$GIT_TEST_OPTS" || ( - ./t/aggregate-results.sh "${TEST_OUTPUT_DIRECTORY:-t}/test-results" - handle_failed_tests - ) - fi + group "Run tests" meson test -C build --print-errorlogs --test-args="$GIT_TEST_OPTS" || ( + ./t/aggregate-results.sh "${TEST_OUTPUT_DIRECTORY:-t}/test-results" + handle_failed_tests + ) ;; *) - group Build make - if test -n "$run_tests" - then - group "Run tests" make test || - handle_failed_tests - fi + group "Run tests" make test || + handle_failed_tests ;; esac -check_unignored_build_artifacts save_good_tree diff --git a/ci/run-build.sh b/ci/run-build.sh new file mode 100755 index 0000000000000000000000000000000000000000..624ae52eb9044ac220ded0dac6e6a7ea74c44830 --- /dev/null +++ b/ci/run-build.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Build Git +# + +. ${0%/*}/lib.sh + +case "$jobname" in +*-meson) + group "Configure" meson setup build . \ + --fatal-meson-warnings \ + --warnlevel 2 --werror \ + --wrap-mode nofallback \ + -Dfuzzers=true \ + -Dtest_output_directory="${TEST_OUTPUT_DIRECTORY:-$(pwd)/t}" \ + $MESONFLAGS + group "Build" meson compile -C build -- + ;; +*) + group Build make + ;; +esac + +check_unignored_build_artifacts diff --git a/meson.build b/meson.build index 7fea4a34d684c579d389d1d3be3a5c1aba021ac6..0da14255820de8af8da5f70915461571271437c8 100644 --- a/meson.build +++ b/meson.build @@ -245,7 +245,7 @@ time = find_program('time', dirs: program_path, required: get_option('benchmarks # "/bin/sh" over a PATH-based lookup, which provides a working shell on most # supported systems. This path is also the default shell path used by our # Makefile. This lookup can be overridden via `program_path`. -target_shell = find_program('sh', dirs: program_path + [ '/bin' ], native: false) +target_shell = find_program('/bin/sh', 'sh', dirs: program_path, native: false) # Sanity-check that programs required for the build exist. foreach tool : ['cat', 'cut', 'grep', 'sort', 'tr', 'uname'] @@ -866,9 +866,8 @@ if host_machine.system() == 'cygwin' or host_machine.system() == 'windows' endif build_options_config.set_quoted('X', executable_suffix) -python = import('python').find_installation('python3', required: get_option('python')) -target_python = find_program('python3', native: false, required: python.found()) -if python.found() +target_python = find_program('python3', native: false, required: get_option('python')) +if target_python.found() build_options_config.set('NO_PYTHON', '') else libgit_c_args += '-DNO_PYTHON' @@ -1597,7 +1596,7 @@ endif git_exec_path = 'libexec/git-core' libexec = get_option('libexecdir') if libexec != 'libexec' and libexec != '.' - git_exec_path = libexec + git_exec_path = libexec / 'git-core' endif if get_option('runtime_prefix') @@ -1979,7 +1978,7 @@ if perl_features_enabled subdir('perl') endif -if python.found() +if target_python.found() scripts_python = [ 'git-p4.py' ] @@ -2194,16 +2193,15 @@ meson.add_dist_script( summary({ 'benchmarks': get_option('tests') and perl.found() and time.found(), - 'curl': curl.found(), - 'expat': expat.found(), - 'gettext': intl.found(), + 'curl': curl, + 'expat': expat, + 'gettext': intl, 'gitweb': gitweb_option.allowed(), - 'https': https_backend, - 'iconv': iconv.found(), - 'pcre2': pcre2.found(), + 'iconv': iconv, + 'pcre2': pcre2, 'perl': perl_features_enabled, - 'python': python.found(), -}, section: 'Auto-detected features') + 'python': target_python.found(), +}, section: 'Auto-detected features', bool_yn: true) summary({ 'csprng': csprng_backend, diff --git a/subprojects/expat.wrap b/subprojects/expat.wrap index 2e0427dcfd144c22d8c0bfd333e3cf31f14855a7..0e9292f97bfb895485620a7c2209c5cd6faff49a 100644 --- a/subprojects/expat.wrap +++ b/subprojects/expat.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = expat-2.6.3 -source_url = https://github.com/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.xz -source_filename = expat-2.6.3.tar.bz2 -source_hash = 274db254a6979bde5aad404763a704956940e465843f2a9bd9ed7af22e2c0efc -patch_filename = expat_2.6.3-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.6.3-1/get_patch -patch_hash = cf017fbe105e31428b2768360bd9be39094df4e948a1e8d1c54b6f7c76460cb1 -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/expat_2.6.3-1/expat-2.6.3.tar.bz2 -wrapdb_version = 2.6.3-1 +directory = expat-2.7.1 +source_url = https://github.com/libexpat/libexpat/releases/download/R_2_7_1/expat-2.7.1.tar.xz +source_filename = expat-2.7.1.tar.bz2 +source_hash = 354552544b8f99012e5062f7d570ec77f14b412a3ff5c7d8d0dae62c0d217c30 +patch_filename = expat_2.7.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/expat_2.7.1-1/get_patch +patch_hash = fe28cbbc427a7c9787d08b969ad54d19f59d8dd18294b4a18651cecfc789d4ef +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/expat_2.7.1-1/expat-2.7.1.tar.bz2 +wrapdb_version = 2.7.1-1 [provide] expat = expat_dep diff --git a/subprojects/pcre2.wrap b/subprojects/pcre2.wrap index 7e184472543bde1572b9e780ae29318fe01e72bc..f45c968e2f3667b64c776aee3e3a7c4c391b06d2 100644 --- a/subprojects/pcre2.wrap +++ b/subprojects/pcre2.wrap @@ -1,13 +1,13 @@ [wrap-file] -directory = pcre2-10.44 -source_url = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.bz2 -source_filename = pcre2-10.44.tar.bz2 -source_hash = d34f02e113cf7193a1ebf2770d3ac527088d485d4e047ed10e5d217c6ef5de96 -patch_filename = pcre2_10.44-2_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.44-2/get_patch -patch_hash = 4336d422ee9043847e5e10dbbbd01940d4c9e5027f31ccdc33a7898a1ca94009 -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/pcre2_10.44-2/pcre2-10.44.tar.bz2 -wrapdb_version = 10.44-2 +directory = pcre2-10.45 +source_url = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.45/pcre2-10.45.tar.bz2 +source_filename = pcre2-10.45.tar.bz2 +source_hash = 21547f3516120c75597e5b30a992e27a592a31950b5140e7b8bfde3f192033c4 +patch_filename = pcre2_10.45-2_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.45-2/get_patch +patch_hash = 7c6f34b703708652a404f9dc2769c67658c437b6043573295fa3428a9b7a6807 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/pcre2_10.45-2/pcre2-10.45.tar.bz2 +wrapdb_version = 10.45-2 [provide] libpcre2-8 = libpcre2_8