Git fork

GIT-BUILD-OPTIONS: wire up NO_GITWEB option

Building our "gitweb" interface is optional in our Makefile and in Meson
and not wired up at all with CMake, but disabling it causes a couple of
tests in the t950* range that pull in "t/lib-gitweb.sh". This is because
the test library knows to execute gitweb-tests based on whether or not
Perl is available, but we may have Perl available and still end up not
building gitweb e.g. with `make test NO_GITWEB=YesPlease`.

Fix this issue by wiring up a new "NO_GITWEB" build option so that we
can skip these tests in case gitweb is not built.

Note that this new build option requires us to move the configuration of
GIT-BUILD-OPTIONS to a later point in our Meson build instructions. But
as that file is only consumed by our tests at runtime this change does
not cause any issues.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
cbcc2f79 cfa1f2ae

+40 -28
+1
GIT-BUILD-OPTIONS.in
··· 24 24 NO_CURL=@NO_CURL@ 25 25 NO_EXPAT=@NO_EXPAT@ 26 26 NO_GETTEXT=@NO_GETTEXT@ 27 + NO_GITWEB=@NO_GITWEB@ 27 28 NO_ICONV=@NO_ICONV@ 28 29 NO_PERL=@NO_PERL@ 29 30 NO_PERL_CPAN_FALLBACKS=@NO_PERL_CPAN_FALLBACKS@
+1
Makefile
··· 3171 3171 -e "s|@NO_CURL@|\'$(NO_CURL)\'|" \ 3172 3172 -e "s|@NO_EXPAT@|\'$(NO_EXPAT)\'|" \ 3173 3173 -e "s|@NO_GETTEXT@|\'$(NO_GETTEXT)\'|" \ 3174 + -e "s|@NO_GITWEB@|\'$(NO_GITWEB)\'|" \ 3174 3175 -e "s|@NO_ICONV@|\'$(NO_ICONV)\'|" \ 3175 3176 -e "s|@NO_PERL@|\'$(NO_PERL)\'|" \ 3176 3177 -e "s|@NO_PERL_CPAN_FALLBACKS@|\'$(NO_PERL_CPAN_FALLBACKS_SQ)\'|" \
+1
contrib/buildsystems/CMakeLists.txt
··· 1184 1184 string(REPLACE "@NO_CURL@" "${NO_CURL}" git_build_options "${git_build_options}") 1185 1185 string(REPLACE "@NO_EXPAT@" "${NO_EXPAT}" git_build_options "${git_build_options}") 1186 1186 string(REPLACE "@NO_GETTEXT@" "${NO_GETTEXT}" git_build_options "${git_build_options}") 1187 + string(REPLACE "@NO_GITWEB@" "1" git_build_options "${git_build_options}") 1187 1188 string(REPLACE "@NO_ICONV@" "${NO_ICONV}" git_build_options "${git_build_options}") 1188 1189 string(REPLACE "@NO_PERL@" "${NO_PERL}" git_build_options "${git_build_options}") 1189 1190 string(REPLACE "@NO_PERL_CPAN_FALLBACKS@" "" git_build_options "${git_build_options}")
+31 -28
meson.build
··· 1456 1456 build_options_config.set('RUNTIME_PREFIX', 'false') 1457 1457 endif 1458 1458 1459 - foreach key, value : { 1460 - 'DIFF': diff.full_path(), 1461 - 'GIT_TEST_CMP': diff.full_path() + ' -u', 1462 - 'GIT_TEST_GITPERLLIB': meson.project_build_root() / 'perl', 1463 - 'GIT_TEST_MERGE_TOOLS_DIR': meson.project_source_root() / 'mergetools', 1464 - 'GIT_TEST_POPATH': meson.project_source_root() / 'po', 1465 - 'GIT_TEST_TEMPLATE_DIR': meson.project_build_root() / 'templates', 1466 - 'GIT_TEST_TEXTDOMAINDIR': meson.project_build_root() / 'po', 1467 - 'PAGER_ENV': get_option('pager_environment'), 1468 - 'PERL_PATH': perl.found() ? perl.full_path() : '', 1469 - 'PYTHON_PATH': python.found () ? python.full_path() : '', 1470 - 'SHELL_PATH': shell.full_path(), 1471 - 'TAR': tar.full_path(), 1472 - 'TEST_OUTPUT_DIRECTORY': test_output_directory, 1473 - 'TEST_SHELL_PATH': shell.full_path(), 1474 - } 1475 - if value != '' and cygpath.found() 1476 - value = run_command(cygpath, value, check: true).stdout().strip() 1477 - endif 1478 - build_options_config.set_quoted(key, value) 1479 - endforeach 1480 - 1481 - configure_file( 1482 - input: 'GIT-BUILD-OPTIONS.in', 1483 - output: 'GIT-BUILD-OPTIONS', 1484 - configuration: build_options_config, 1485 - ) 1486 - 1487 1459 git_version_file = custom_target( 1488 1460 command: [ 1489 1461 shell, ··· 1893 1865 gitweb_option = get_option('gitweb').disable_auto_if(not perl.found()) 1894 1866 if gitweb_option.enabled() 1895 1867 subdir('gitweb') 1868 + build_options_config.set('NO_GITWEB', '') 1869 + else 1870 + build_options_config.set('NO_GITWEB', '1') 1896 1871 endif 1897 1872 1898 1873 subdir('templates') ··· 1908 1883 if get_option('docs') != [] 1909 1884 subdir('Documentation') 1910 1885 endif 1886 + 1887 + foreach key, value : { 1888 + 'DIFF': diff.full_path(), 1889 + 'GIT_TEST_CMP': diff.full_path() + ' -u', 1890 + 'GIT_TEST_GITPERLLIB': meson.project_build_root() / 'perl', 1891 + 'GIT_TEST_MERGE_TOOLS_DIR': meson.project_source_root() / 'mergetools', 1892 + 'GIT_TEST_POPATH': meson.project_source_root() / 'po', 1893 + 'GIT_TEST_TEMPLATE_DIR': meson.project_build_root() / 'templates', 1894 + 'GIT_TEST_TEXTDOMAINDIR': meson.project_build_root() / 'po', 1895 + 'PAGER_ENV': get_option('pager_environment'), 1896 + 'PERL_PATH': perl.found() ? perl.full_path() : '', 1897 + 'PYTHON_PATH': python.found () ? python.full_path() : '', 1898 + 'SHELL_PATH': shell.full_path(), 1899 + 'TAR': tar.full_path(), 1900 + 'TEST_OUTPUT_DIRECTORY': test_output_directory, 1901 + 'TEST_SHELL_PATH': shell.full_path(), 1902 + } 1903 + if value != '' and cygpath.found() 1904 + value = run_command(cygpath, value, check: true).stdout().strip() 1905 + endif 1906 + build_options_config.set_quoted(key, value) 1907 + endforeach 1908 + 1909 + configure_file( 1910 + input: 'GIT-BUILD-OPTIONS.in', 1911 + output: 'GIT-BUILD-OPTIONS', 1912 + configuration: build_options_config, 1913 + ) 1911 1914 1912 1915 summary({ 1913 1916 'curl': curl.found(),
+5
t/lib-gitweb.sh
··· 105 105 test_done 106 106 fi 107 107 108 + if ! test_have_prereq GITWEB; then 109 + skip_all='skipping gitweb tests, gitweb not available' 110 + test_done 111 + fi 112 + 108 113 perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || { 109 114 skip_all='skipping gitweb tests, perl version is too old' 110 115 test_done
+1
t/test-lib.sh
··· 1687 1687 1688 1688 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1 1689 1689 test -z "$NO_CURL" && test_set_prereq LIBCURL 1690 + test -z "$NO_GITWEB" && test_set_prereq GITWEB 1690 1691 test -z "$NO_ICONV" && test_set_prereq ICONV 1691 1692 test -z "$NO_PERL" && test_set_prereq PERL 1692 1693 test -z "$NO_PTHREADS" && test_set_prereq PTHREADS