{"thread":{"id":"63423","subject":"[PATCH 0/5] miscellaneous build mods (part 2)","startedAt":"2025-05-08T16:48:37Z","lastAt":"2025-06-16T22:08:35Z","messageCount":48,"participants":["Ramsay Jones","Eli Schwartz","Junio C Hamano","Patrick Steinhardt","irecca.kun@gmail.com"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"517574","messageId":"20250508164443.1506440-1-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":null,"subject":"[PATCH 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:34Z","receivedAt":"2025-05-08T16:48:37Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"This series (part 2) continues the miscellaneous changes to the make,\nmeson and autoconf build systems. I am sending this part a little\nearlier than I expected, so there will now be a part 3!\n\nThe reason for the early posting is to try and avoid an regression in\nthe autoconf build system (see patch #5). Hopefully, we still have time\nin this cycle to get patch #5 included.\n\nThis series is based on commit 6f84262c44 (\"The eleventh batch\", 2025-05-05)\n\nI did a test merge to 'next'@629a3ecd64 without issue, but 'seen'@71cfd25022\nhad a small conflict with commit 1a2929c851 (\"meson: allow customize perl\ninstallation path\", 2025-04-24) on the 'dd/meson-perl-custom-path' branch.\n(I note that a new version of that patch was posted to the list today).\n\nThe fixup looks like:\n\n    diff --cc perl/Git/SVN/Memoize/meson.build\n    index 4c589b30c3,8c2e80d2d2..d6209dc3bf\n    --- a/perl/Git/SVN/Memoize/meson.build\n    +++ b/perl/Git/SVN/Memoize/meson.build\n    @@@ -3,6 -3,6 +3,6 @@@ test_dependencies += custom_target\n        output: 'YAML.pm',\n        command: generate_perl_command,\n        install: true,\n    -   install_dir: perllibdir / 'Git/SVN',\n     -  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n    ++  install_dir: perllibdir / 'Git/SVN/Memoize',\n        depends: [git_version_file],\n      )\n\nATB,\nRamsay Jones\n\n\nRamsay Jones (5):\n  meson.build: quote the GITWEBDIR build configuration\n  meson: correct install location of YAML.pm\n  meson: correct path to system config/attribute files\n  meson.build: correct setting of GIT_EXEC_PATH\n  configure.ac: upgrade to a compilation check for sysinfo\n\n configure.ac                     | 25 ++++++++++++++++++++++---\n meson.build                      | 28 +++++++++++++++++++++++-----\n meson_options.txt                |  4 ++--\n perl/Git/SVN/Memoize/meson.build |  2 +-\n 4 files changed, 48 insertions(+), 11 deletions(-)\n\n-- \n2.49.0\n\n"},{"id":"517575","messageId":"20250508164443.1506440-2-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-1-ramsay@ramsayjones.plus.com","subject":"[PATCH 1/5] meson.build: quote the GITWEBDIR build configuration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:35Z","receivedAt":"2025-05-08T16:48:45Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The build configuration options with (non-empty) values, for example\nfilesystem paths potentially containing spaces, have been set using\nthe '.set_quoted()' method. However, the GITWEBDIR value has been\nset using the '.set()' method instead. In order to correctly quote\nthe GITWEBDIR value, replace the '.set()' method with '.set_quoted()'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/meson.build b/meson.build\nindex 270ce933d0..48f31157a0 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -739,7 +739,7 @@ build_options_config.set('GIT_TEST_OPTS', '')\n build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')\n build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n-build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n+build_options_config.set_quoted('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n if get_option('sane_tool_path').length() != 0\n   sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))\n-- \n2.49.0\n\n"},{"id":"517576","messageId":"20250508164443.1506440-3-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-2-ramsay@ramsayjones.plus.com","subject":"[PATCH 2/5] meson: correct install location of YAML.pm","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:36Z","receivedAt":"2025-05-08T16:48:50Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"When executing an 'meson install' the YAML.pm file is incorrectly\nplaced in the <prefix>/share/perl5/Git/SVN directory. The YAML.pm\nfile should be placed in a 'Memoize' subdirectory instead. In order\nto correct the location, update the 'install_dir' of the relevant\ntarget in the 'perl/Git/SVN/Memoize/meson.build' file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n perl/Git/SVN/Memoize/meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Memoize/meson.build b/perl/Git/SVN/Memoize/meson.build\nindex 233ec670d7..8c2e80d2d2 100644\n--- a/perl/Git/SVN/Memoize/meson.build\n+++ b/perl/Git/SVN/Memoize/meson.build\n@@ -3,6 +3,6 @@ test_dependencies += custom_target(\n   output: 'YAML.pm',\n   command: generate_perl_command,\n   install: true,\n-  install_dir: get_option('datadir') / 'perl5/Git/SVN',\n+  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n   depends: [git_version_file],\n )\n-- \n2.49.0\n\n"},{"id":"517577","messageId":"20250508164443.1506440-4-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-3-ramsay@ramsayjones.plus.com","subject":"[PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:37Z","receivedAt":"2025-05-08T16:48:58Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The path to the system-wide config and attributes files are not being\nset correctly in the meson build. Unless explicitly overridden on the\ncommand line during setup, the 'gitconfig' and 'gitattributes' options\nare defaulting to absolute paths in the '/etc' system directory. This\nis only appropriate if the <prefix> is set specifically to '/usr'.\n\nThe directory in which these files are placed is generally referred to\nas the 'system configuration directory' or 'sysconfdir' for short. When\nthe prefix is '/usr' then the sysconfdir is usually set to '/etc', but\nany other value for prefix results in the relative directory value 'etc'\ninstead. (eg if prefix is '/usr/local', then the 'etc' relative value\nresults in a system configuration directory of '/usr/local/etc'). When\nsetting the 'sysconfdir' builtin option value, the meson system uses\nexactly this algorithm, so we can use get_option('sysconfdir') directly\nwhen setting the (non-overridden) build variables.\n\nIn order to allow for overriding from the command line, remove the\ndefault values specified for the 'gitconfig' and 'gitattributes' options\nin the 'meson_options.txt' file. This allows the user to specify any\npathname for those options, while being able to test for the unset\n(empty) value. An absolute pathname will be used unchanged and a relative\npathname will be appended to '<prefix>/'. These values are then used to\nset the 'ETC_GITCONFIG' and 'ETC_GITATTRIBUTES' build variables which are,\nin turn, passed to the compiler as '-D' arguments.\n\nWhen the 'gitconfig' or 'gitattributes' options are not used, then use\nthe built-in 'sysconfdir' and set the ETC_GITCONFIG build variable to\nthe string \"<sysconfdir>/gitconfig\". Similarly, set ETC_ATTRIBUTES to\n\"<sysconfdir>/gitattributes\".\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build       | 14 ++++++++++++--\n meson_options.txt |  4 ++--\n 2 files changed, 14 insertions(+), 4 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 48f31157a0..106cb17612 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -757,8 +757,6 @@ endif\n libgit_c_args = [\n   '-DBINDIR=\"' + get_option('bindir') + '\"',\n   '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n-  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n-  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n   '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n   '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n   '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n@@ -769,6 +767,18 @@ libgit_c_args = [\n   '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n ]\n \n+system_attributes = get_option('gitattributes')\n+if system_attributes != ''\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n+else\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n+endif\n+system_config = get_option('gitconfig')\n+if system_config != ''\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n+else\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n+endif\n editor_opt = get_option('default_editor')\n if editor_opt != '' and editor_opt != 'vi'\n   libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 8547c0eb47..4d78d4c7ac 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n   description: 'Fall-back pager.')\n option('default_editor', type: 'string', value: 'vi',\n   description: 'Fall-back editor.')\n-option('gitconfig', type: 'string', value: '/etc/gitconfig',\n+option('gitconfig', type: 'string',\n   description: 'Path to the global git configuration file.')\n-option('gitattributes', type: 'string', value: '/etc/gitattributes',\n+option('gitattributes', type: 'string',\n   description: 'Path to the global git attributes file.')\n option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n   description: 'Environment used when spawning the pager')\n-- \n2.49.0\n\n"},{"id":"517578","messageId":"20250508164443.1506440-5-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-4-ramsay@ramsayjones.plus.com","subject":"[PATCH 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:38Z","receivedAt":"2025-05-08T16:49:06Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"For the non-'runtime prefix' case, the meson build sets the GIT_EXEC_PATH\nbuild variable to an absolute path equivalent to <prefix>/libexec/git-core.\nIn comparison, the default make build sets it to a relative path equivalent\nto 'libexec/git-core'. Indeed, the make build requires the use of some\nmeans outside of the Makefile (eg. config.mak[.*] or the command-line)\nto set GIT_EXEC_PATH to anything other than 'libexec/git-core'.\n\nFor example, the make invocation:\n\n  $ make gitexecdir=/some/other/bin all install\n\nwill build git with GIT_EXEC_PATH set to '/some/other/bin' and install\nthe 'library' executables to that location. However, without setting the\n'gitexecdir' make variable, irrespective of the 'runtime prefix' setting,\nthe GIT_EXEC_PATH is always set to 'libexec/git-core'.\n\nThe meson built-in 'libexecdir' option can be used to provide a similar\nconfigurability. The default value for the option is 'libexec'. Attempting\nto set the option to '' on the command-line, will reset it to the '.'\nstring, presumably to ensure a relative path value.\n\nThis commit allows the meson build, similar to the above, to configure the\nproject like:\n\n  $ meson setup --buildtype=debugoptimized -Dprefix=$HOME -Dpcre2=disabled \\\n      -Dlibexecdir=/some/other/bin build\n\nso that the GIT_EXEC_PATH is set to '/some/other/bin'. Absent the\n-Dlibexecdir argument, the GIT_EXEC_PATH is set to 'libexec/git-core'.\n\nIn order to correct the value of GIT_EXEC_PATH, default the value to the\nstatic string value 'libexec/git-core', and only override if the value\nof the 'libexecdir' option has a value different to 'libexec' or '.'.\nAlso, like the Makefile, add a check for an absolute path when the\nruntime prefix option is true (and if so, error out).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 106cb17612..0101a8179e 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1590,10 +1590,19 @@ else\n   error('Unsupported CSPRNG backend: ' + csprng_backend)\n endif\n \n+git_exec_path = 'libexec/git-core'\n+libexec = get_option('libexecdir')\n+if libexec != 'libexec' and libexec != '.'\n+  git_exec_path = libexec\n+endif\n+\n if get_option('runtime_prefix')\n   libgit_c_args += '-DRUNTIME_PREFIX'\n   build_options_config.set('RUNTIME_PREFIX', 'true')\n-  git_exec_path = get_option('libexecdir') / 'git-core'\n+\n+  if git_exec_path.startswith('/')\n+    error('runtime_prefix requires a relative libexecdir not:', libexec)\n+  endif\n \n   if compiler.has_header('mach-o/dyld.h')\n     libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'\n@@ -1630,7 +1639,6 @@ if get_option('runtime_prefix')\n   endif\n else\n   build_options_config.set('RUNTIME_PREFIX', 'false')\n-  git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core'\n endif\n libgit_c_args += '-DGIT_EXEC_PATH=\"' + git_exec_path + '\"'\n \n-- \n2.49.0\n\n"},{"id":"517579","messageId":"20250508164443.1506440-6-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-5-ramsay@ramsayjones.plus.com","subject":"[PATCH 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T16:44:39Z","receivedAt":"2025-05-08T16:49:14Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Commit f5e3c6c57d (\"meson: do a full usage-based compile check for\nsysinfo\", 2025-04-25) updated the 'sysinfo()' check, as part of the\nmeson build, due to the failure of the check on Solaris. Prior to\nthat commit, the meson build only checked the availability of the\n'<sys/sysinfo.h>' header file. On Solaris, both the header and the\n'sysinfo()' function exist, but are completely unrelated to the same\nfunction on Linux (and cygwin).\n\nCommit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\ncygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\nbuild. This check looked for the 'sysinfo()' function itself, rather\nthan just the header, but it will fail (incorrectly set HAVE_SYSINFO)\nfor the same reason.\n\nIn order to correctly identify the 'sysinfo()' function we require as\npart of 'git-gc' (used in the 'total_ram() function), we also upgrade\nto a compilation check, in a similar way to the meson commit. Note that\nsince commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\nusing sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\nof the 'struct sysinfo' are used, so the new check includes both of\nthose fields in the compile check.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n configure.ac | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex d7e0503f1e..f6caab919a 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1069,9 +1069,28 @@ GIT_CONF_SUBST([CHARSET_LIB])\n \n #\n # Define HAVE_SYSINFO=YesPlease if sysinfo is available.\n-GIT_CHECK_FUNC(sysinfo,\n-\t[HAVE_SYSINFO=YesPlease],\n-\t[HAVE_SYSINFO=])\n+#\n+AC_DEFUN([HAVE_SYSINFO_SRC], [\n+AC_LANG_PROGRAM([[\n+#include <stdint.h>\n+#include <sys/sysinfo.h>\n+]], [[\n+struct sysinfo si;\n+uint64_t t = 0;\n+if (!sysinfo(&si)) {\n+\tt = si.totalram;\n+\tif (si.mem_unit > 1)\n+\t\tt *= (uint64_t)si.mem_unit;\n+}\n+return t;\n+]])])\n+\n+AC_MSG_CHECKING([for sysinfo])\n+AC_COMPILE_IFELSE([HAVE_SYSINFO_SRC],\n+\t[AC_MSG_RESULT([yes])\n+\tHAVE_SYSINFO=YesPlease],\n+\t[AC_MSG_RESULT([no])\n+\tHAVE_SYSINFO=])\n GIT_CONF_SUBST([HAVE_SYSINFO])\n \n #\n-- \n2.49.0\n\n"},{"id":"517584","messageId":"e961ef56-f39e-40ea-85fe-964b66b9bcce@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-1-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T17:36:57Z","receivedAt":"2025-05-08T17:40:11Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Hmm, I seem to have misunderstood the '--chain-reply-to' documentation\non the 'git send-email' man page! :( Sorry about that.\n\n[I had intended a shallow threading].\n\nOn 08/05/2025 17:44, Ramsay Jones wrote:\n> This series (part 2) continues the miscellaneous changes to the make,\n> meson and autoconf build systems. I am sending this part a little\n> earlier than I expected, so there will now be a part 3!\n> \n> The reason for the early posting is to try and avoid an regression in\n> the autoconf build system (see patch #5). Hopefully, we still have time\n> in this cycle to get patch #5 included.\n\nNote that I cannot test the new autoconf check in patch #5 (I don't have\naccess to a Solaris system). I _think_ it will correctly unset HAVE_SYSINFO\non Solaris, but I cannot confirm that. (I can only test on Linux and cygwin).\n\n> \n> This series is based on commit 6f84262c44 (\"The eleventh batch\", 2025-05-05)\n> \n> I did a test merge to 'next'@629a3ecd64 without issue, but 'seen'@71cfd25022\n> had a small conflict with commit 1a2929c851 (\"meson: allow customize perl\n> installation path\", 2025-04-24) on the 'dd/meson-perl-custom-path' branch.\n> (I note that a new version of that patch was posted to the list today).\n\nNote that it is patch #2 \"meson: correct install location of YAML.pm\" that\nconflicts with the 'seen' branch.\n\n> \n> The fixup looks like:\n> \n>     diff --cc perl/Git/SVN/Memoize/meson.build\n>     index 4c589b30c3,8c2e80d2d2..d6209dc3bf\n>     --- a/perl/Git/SVN/Memoize/meson.build\n>     +++ b/perl/Git/SVN/Memoize/meson.build\n>     @@@ -3,6 -3,6 +3,6 @@@ test_dependencies += custom_target\n>         output: 'YAML.pm',\n>         command: generate_perl_command,\n>         install: true,\n>     -   install_dir: perllibdir / 'Git/SVN',\n>      -  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n>     ++  install_dir: perllibdir / 'Git/SVN/Memoize',\n>         depends: [git_version_file],\n>       )\n> \n> ATB,\n> Ramsay Jones\n> \n> \n> Ramsay Jones (5):\n>   meson.build: quote the GITWEBDIR build configuration\n>   meson: correct install location of YAML.pm\n>   meson: correct path to system config/attribute files\n>   meson.build: correct setting of GIT_EXEC_PATH\n>   configure.ac: upgrade to a compilation check for sysinfo\n> \n>  configure.ac                     | 25 ++++++++++++++++++++++---\n>  meson.build                      | 28 +++++++++++++++++++++++-----\n>  meson_options.txt                |  4 ++--\n>  perl/Git/SVN/Memoize/meson.build |  2 +-\n>  4 files changed, 48 insertions(+), 11 deletions(-)\n> \n\n"},{"id":"517601","messageId":"9baad29d-a5bf-443d-98a1-36d7020e5835@gentoo.org","threadId":"63423","inReplyTo":"20250508164443.1506440-6-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Eli Schwartz","fromEmail":"eschwartz@gentoo.org","sentAt":"2025-05-08T21:07:37Z","receivedAt":"2025-05-08T21:07:43Z","isPatch":true,"sender":{"key":"eschwartz@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/6551424?v=4"},"body":"On 5/8/25 12:44 PM, Ramsay Jones wrote:\n> Commit f5e3c6c57d (\"meson: do a full usage-based compile check for\n> sysinfo\", 2025-04-25) updated the 'sysinfo()' check, as part of the\n> meson build, due to the failure of the check on Solaris. Prior to\n> that commit, the meson build only checked the availability of the\n> '<sys/sysinfo.h>' header file. On Solaris, both the header and the\n> 'sysinfo()' function exist, but are completely unrelated to the same\n> function on Linux (and cygwin).\n> \n> Commit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\n> cygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\n> build. This check looked for the 'sysinfo()' function itself, rather\n> than just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n> for the same reason.\n> \n> In order to correctly identify the 'sysinfo()' function we require as\n> part of 'git-gc' (used in the 'total_ram() function), we also upgrade\n> to a compilation check, in a similar way to the meson commit. Note that\n> since commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\n> using sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\n> of the 'struct sysinfo' are used, so the new check includes both of\n> those fields in the compile check.\n\nand\n\n> Note that I cannot test the new autoconf check in patch #5 (I don't have\n> access to a Solaris system). I _think_ it will correctly unset HAVE_SYSINFO\n> on Solaris, but I cannot confirm that. (I can only test on Linux and cygwin).\n\n\nWell, I can confirm this results in the detection being correctly\nchanged on Solaris 11.3 and stop reporting sysinfo as available during\n./configure, so this has my ACK on technical grounds. That being said,\nin the original meson thread, there was this review:\n\n\nOn 4/22/25 3:31 AM, Patrick Steinhardt wrote:\n> On Mon, Apr 21, 2025 at 01:51:46PM -0400, Eli Schwartz wrote:\n>> It is deprecated and removed in SUS v3 / POSIX 2001, so various systems\n>> may not include it. Solaris, in particular, carefully refrains from\n>> defining it except inside of a maze of `#ifdef` to make sure you have\n>> kept your nose clean and only used it in code that *targets* SUS v2 or\n>> earlier.\n>>\n>> config.mak.uname defines this automatically, though only for QNX.\n> \n> Ah, interesting. I mostly went by our autoconf infrastructure when\n> converting the checks, which didn't have a check for `getpagesize()`\n> either. We might want to teach autoconf to check for this function while\n> at it.\n> \n> In all honesty though, I rather hope that we're soon in a state where we\n> can just drop autoconf altogether in favor of Meson. The only two\n> blockers I'm aware of are wiring up git-gui and gitk. The former project\n> has already been adapted upstream, the latter is still in review. But\n> once those have landed, we should be ready to mark Meson as stable and\n> then we can start deprecating autoconf unless there are good reasons not\n> to do so.\n\n\nSo you are indeed teaching autoconf to check for this function, but\nshould we also ask whether it's worth continued maintenance of autoconf?\nIt was/is not clear to me who the stakeholders are for the autoconf support.\n\nOn the one hand, it exists so maybe it should be fixed when we know it\nhas issues.\n\nOn the other hand, it sounds like this patch (and commit 50dec7c566\n\"config.mak.uname: add sysinfo() configuration for cygwin\") only modify\nautoconf out of a sense of duty, rather than finding autoconf useful.\nWhat does it say about the autoconf support if the people finding bugs\nin it don't even use it, but only discovered the bug while working on a\ndifferent build system they do use and depend on (config.mak.uname, or\nmeson.build, both count here). Who *is* using it? Apparently not Solaris\nusers?\n\n\n-- \nEli Schwartz\n"},{"id":"517603","messageId":"xmqqr00y4vvd.fsf@gitster.g","threadId":"63423","inReplyTo":"20250508164443.1506440-4-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-08T21:48:22Z","receivedAt":"2025-05-08T21:48:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> -  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n> -  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n> ...\n> +system_attributes = get_option('gitattributes')\n> +if system_attributes != ''\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n> +else\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n> +endif\n\nJust out of curiosity (because this cannot be a regression, since\nthe original removed one used the same constructs).\n\nI am guessing from the presence of double quote around the value\nthat these strings are not directly used to invoke the compiler\nwithout involving any shell (in other words, you wouldn't want these\nquotes if you are shoving these strings in argv[] yourself to feed\nexecv()).\n\nHow does the above, and get_option() in particular, cope with a\npathname that has letters with special meanings to the shell when\nthey appear inside double-quote pair (like backquote or backslash or\neven a dollar sign)?  On the Makefile side we give VAR_SQ for a raw\nvariable VAR and use the latter to write something like\n\n        -DETC_GITATTRIBUTES='\"$(ETC_GITATTRIBUTES_SQ)\"'\n\nto make sure we won't be broken by them.  Is Meson giving us an\nequivalent to us for free by simply using get_option() here?\n\nThanks.\n"},{"id":"517604","messageId":"xmqqmsbm4vjg.fsf@gitster.g","threadId":"63423","inReplyTo":"20250508164443.1506440-5-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-08T21:55:31Z","receivedAt":"2025-05-08T21:55:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n>  if get_option('runtime_prefix')\n>    libgit_c_args += '-DRUNTIME_PREFIX'\n>    build_options_config.set('RUNTIME_PREFIX', 'true')\n> -  git_exec_path = get_option('libexecdir') / 'git-core'\n> +\n> +  if git_exec_path.startswith('/')\n> +    error('runtime_prefix requires a relative libexecdir not:', libexec)\n> +  endif\n\nCertainly nice to see these settings taught to be more careful.\n\nThanks.\n"},{"id":"517606","messageId":"5a91094a-08d5-4bf8-a4c3-1d54cc970f67@gentoo.org","threadId":"63423","inReplyTo":"xmqqr00y4vvd.fsf@gitster.g","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Eli Schwartz","fromEmail":"eschwartz@gentoo.org","sentAt":"2025-05-08T22:50:59Z","receivedAt":"2025-05-08T22:51:03Z","isPatch":true,"sender":{"key":"eschwartz@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/6551424?v=4"},"body":"On 5/8/25 5:48 PM, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n>> -  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n>> -  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n>> ...\n>> +system_attributes = get_option('gitattributes')\n>> +if system_attributes != ''\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>> +endif\n> \n> Just out of curiosity (because this cannot be a regression, since\n> the original removed one used the same constructs).\n> \n> I am guessing from the presence of double quote around the value\n> that these strings are not directly used to invoke the compiler\n> without involving any shell (in other words, you wouldn't want these\n> quotes if you are shoving these strings in argv[] yourself to feed\n> execv()).\n> \n> How does the above, and get_option() in particular, cope with a\n> pathname that has letters with special meanings to the shell when\n> they appear inside double-quote pair (like backquote or backslash or\n> even a dollar sign)?  On the Makefile side we give VAR_SQ for a raw\n> variable VAR and use the latter to write something like\n> \n>         -DETC_GITATTRIBUTES='\"$(ETC_GITATTRIBUTES_SQ)\"'\n> \n> to make sure we won't be broken by them.  Is Meson giving us an\n> equivalent to us for free by simply using get_option() here?\n> \n> Thanks.\n\n\nMeson uses strong implicit typing. The object type of '\"' is a string\nwith value of double-quote-char, and the type of libgit_c_args is\n\"array\". It's not a result of get_option() here, except inasmuch as\nget_option() returned a string type.\n\nMeson guarantees that arrays of strings e.g.\n\nlibgit_c_args = [\n    '-Dfoo=string containing the $ (mighty dollar)',\n    '-Dbar=string containing the ` soft-deprecated',\n    '-Doopsies=string containing the \\' (you read that right)',\n]\n\n\nare passed to the shell in a manner suitable for reinterpretation as an\nargv array, notwithstanding other concerns (e.g. I believe there's some\nmingw hack regarding doubling backslash escapes so they don't get\neaten). And of course this is conditional on the idea that it is\npossible to reliably pass arguments on the Windows command line, which\ndoesn't have the notion of an array.\n\nSo, given that meson takes care of this, the actual value of the -D\ndefine will be\n\nstring containing the $ (mighty dollar)\n\n\netc.\n\ne.g. here is the ninja output:\n\n\n[1/3] ccache cc -Ifoo.p -I. -I.. -fdiagnostics-color=always\n-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g '-Dfoo=string\ncontaining the $ (mighty dollar)' '-Dbar=string containing the `\nsoft-deprecated' '-Doopsies=string containing the '\"'\"' (you read that\nright)' -MD -MQ foo.p/foo.c.o -MF foo.p/foo.c.o.d -o foo.p/foo.c.o -c\n../foo.c\n<command-line>: warning: missing terminating ' character\n\nNotice that the array contained a single quote using a meson string type\nbackslash escape, but the generated command line chose to shell-escape\nit as ' ... '\"'\"' .... '\n\n\n\nIn this case, the Makefile does:\n\n-DETC_GITATTRIBUTES='\"$(ETC_GITATTRIBUTES_SQ)\"'\n\n\nand if I understand correctly the _SQ is to handle single quotes in the\ndirectory name:\n\n\n-DETC_GITATTRIBUTES='\"/etc/git'\\''s attribute file\"'\n\n\nOr in meson,\n\nlibgit_c_args += [\n    '-DETC_GITATTRIBUTES=\"/etc/git\\'s attribute file\"',\n]\n\n\ncompiles as:\n\n[1/3] ccache cc -Ifoo.p -I. -I.. -fdiagnostics-color=always\n-D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g '-Dfoo=string\ncontaining the $ (mighty dollar)' '-Dbar=string containing the `\nsoft-deprecated' '-Doopsies=string containing the '\"'\"' (you read that\nright)' '-DETC_GITATTRIBUTES=\"/etc/git'\"'\"'s attribute file\"' -MD -MQ\nfoo.p/foo.c.o -MF foo.p/foo.c.o.d -o foo.p/foo.c.o -c ../foo.c\n\n\nMeson has refrained from backslashes again:\n\nccache cc '-DETC_GITATTRIBUTES=\"/etc/git'\"'\"'s attribute file\"'\n\nDouble quotes are part of the define value, single quote gets de-escaped\nvia the sequence:\n\n'\"'\"'\n\ninstead of the sequence\n\n'\\''\n\n\n-- \nEli Schwartz\n"},{"id":"517607","messageId":"56706ad8-93c6-48cd-ad16-9d8b00a669c9@ramsayjones.plus.com","threadId":"63423","inReplyTo":"9baad29d-a5bf-443d-98a1-36d7020e5835@gentoo.org","subject":"Re: [PATCH 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T23:01:14Z","receivedAt":"2025-05-08T23:04:25Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 08/05/2025 22:07, Eli Schwartz wrote:\n> On 5/8/25 12:44 PM, Ramsay Jones wrote:\n[snip]\n>> In order to correctly identify the 'sysinfo()' function we require as\n>> part of 'git-gc' (used in the 'total_ram() function), we also upgrade\n>> to a compilation check, in a similar way to the meson commit. Note that\n>> since commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\n>> using sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\n>> of the 'struct sysinfo' are used, so the new check includes both of\n>> those fields in the compile check.\n> \n> and\n> \n>> Note that I cannot test the new autoconf check in patch #5 (I don't have\n>> access to a Solaris system). I _think_ it will correctly unset HAVE_SYSINFO\n>> on Solaris, but I cannot confirm that. (I can only test on Linux and cygwin).\n> \n> \n> Well, I can confirm this results in the detection being correctly\n> changed on Solaris 11.3 and stop reporting sysinfo as available during\n> ./configure, so this has my ACK on technical grounds.\n\nThank you very much for testing this patch, much appreciated!\n\n[snip]\n\n> \n> So you are indeed teaching autoconf to check for this function, but\n> should we also ask whether it's worth continued maintenance of autoconf?\n> It was/is not clear to me who the stakeholders are for the autoconf support.\n\nHmm, someone posted a list of people using autoconf somewhat recently\nto the mailing-list ... I don't have it to hand, but cygwin was one\nof the projects using it.\n\n> On the one hand, it exists so maybe it should be fixed when we know it\n> has issues.\n\nYes, exactly.\n\n> On the other hand, it sounds like this patch (and commit 50dec7c566\n> \"config.mak.uname: add sysinfo() configuration for cygwin\") only modify\n> autoconf out of a sense of duty, rather than finding autoconf useful.\n\nHmm, I am not convinced (yet) that meson is all that useful either. ;)\n \n> What does it say about the autoconf support if the people finding bugs\n> in it don't even use it, but only discovered the bug while working on a\n> different build system they do use and depend on (config.mak.uname, or\n> meson.build, both count here).\n\nI am trying very hard not to express a view on this debate. :)\n\n[well, except that I find CMake to be absolutely awful!]\n\nThanks!\n\nATB,\nRamsay Jones\n\n\n\n\n"},{"id":"517608","messageId":"90deee16-18a0-47e6-9111-a0c467404386@ramsayjones.plus.com","threadId":"63423","inReplyTo":"xmqqr00y4vvd.fsf@gitster.g","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-08T23:16:37Z","receivedAt":"2025-05-08T23:16:40Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 08/05/2025 22:48, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n>> -  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n>> -  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n>> ...\n>> +system_attributes = get_option('gitattributes')\n>> +if system_attributes != ''\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>> +endif\n> \n> Just out of curiosity (because this cannot be a regression, since\n> the original removed one used the same constructs).\n> \n> I am guessing from the presence of double quote around the value\n> that these strings are not directly used to invoke the compiler\n> without involving any shell (in other words, you wouldn't want these\n> quotes if you are shoving these strings in argv[] yourself to feed\n> execv()).\n> \n> How does the above, and get_option() in particular, cope with a\n> pathname that has letters with special meanings to the shell when\n> they appear inside double-quote pair (like backquote or backslash or\n> even a dollar sign)?  On the Makefile side we give VAR_SQ for a raw\n> variable VAR and use the latter to write something like\n> \n>         -DETC_GITATTRIBUTES='\"$(ETC_GITATTRIBUTES_SQ)\"'\n> \n> to make sure we won't be broken by them.  Is Meson giving us an\n> equivalent to us for free by simply using get_option() here?\n\nErr ... no, meson is somewhat broken here, for example see [0].\nTo be fair, it could simply be that I am too dumb to understand\nwhat meson is doing (and I haven't really studied the documentation\nor the code).\n\nHopefully, someone who knows meson will be able to answer your question.\n\n[0] https://lore.kernel.org/git/a5795bfa-cc02-4c9a-b7d2-4924a94cd0db@ramsayjones.plus.com/\n\nThanks.\n\nATB,\nRamsay Jones\n\n\n"},{"id":"517615","messageId":"xmqqcyci4mu8.fsf@gitster.g","threadId":"63423","inReplyTo":"5a91094a-08d5-4bf8-a4c3-1d54cc970f67@gentoo.org","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-09T01:03:27Z","receivedAt":"2025-05-09T01:03:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eli Schwartz <eschwartz@gentoo.org> writes:\n\n> Meson guarantees that arrays of strings e.g.\n>\n> libgit_c_args = [\n>     '-Dfoo=string containing the $ (mighty dollar)',\n>     '-Dbar=string containing the ` soft-deprecated',\n>     '-Doopsies=string containing the \\' (you read that right)',\n> ]\n>\n>\n> are passed to the shell in a manner suitable for reinterpretation as an\n> argv array,...\n\nVery nice.  Just I wanted to hear from a system that we are trying\nto adopt and promote ;-)\n\n"},{"id":"517636","messageId":"aB3CDOljn9zJsVwt@pks.im","threadId":"63423","inReplyTo":"20250508164443.1506440-4-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-05-09T08:51:24Z","receivedAt":"2025-05-09T08:51:33Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, May 08, 2025 at 05:44:37PM +0100, Ramsay Jones wrote:\n> diff --git a/meson.build b/meson.build\n> index 48f31157a0..106cb17612 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -757,8 +757,6 @@ endif\n>  libgit_c_args = [\n>    '-DBINDIR=\"' + get_option('bindir') + '\"',\n>    '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n> -  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n> -  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n>    '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n>    '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n>    '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n> @@ -769,6 +767,18 @@ libgit_c_args = [\n>    '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n>  ]\n>  \n> +system_attributes = get_option('gitattributes')\n> +if system_attributes != ''\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n> +else\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n> +endif\n> +system_config = get_option('gitconfig')\n> +if system_config != ''\n> +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n> +else\n> +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n\nInstead of `get_option('sysconfdir') + '/gitconfig'` you can say\n`get_option('sysconfdir') / 'gitconfig'`. It's a bit pointless in this\ncase and not really needed, but '/' has some special magic for handling\nabsolute and relative paths.\n\n> +endif\n>  editor_opt = get_option('default_editor')\n>  if editor_opt != '' and editor_opt != 'vi'\n>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n\nNit: let's maybe add an empty newline after each of these blocks to make\nit a bit easier to see where handling for each specific option stops.\n\n> diff --git a/meson_options.txt b/meson_options.txt\n> index 8547c0eb47..4d78d4c7ac 100644\n> --- a/meson_options.txt\n> +++ b/meson_options.txt\n> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n>    description: 'Fall-back pager.')\n>  option('default_editor', type: 'string', value: 'vi',\n>    description: 'Fall-back editor.')\n> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n> +option('gitconfig', type: 'string',\n>    description: 'Path to the global git configuration file.')\n> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n> +option('gitattributes', type: 'string',\n>    description: 'Path to the global git attributes file.')\n>  option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n>    description: 'Environment used when spawning the pager')\n\nMakes sense. Should we maybe document the default values here now that\nthey aren't immediately obvious anymore?\n\nPatrick\n"},{"id":"517687","messageId":"348ccba5-66c1-4c09-a478-3cffdd862d8b@ramsayjones.plus.com","threadId":"63423","inReplyTo":"aB3CDOljn9zJsVwt@pks.im","subject":"Re: [PATCH 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-09T15:23:20Z","receivedAt":"2025-05-09T15:26:33Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 09/05/2025 09:51, Patrick Steinhardt wrote:\n> On Thu, May 08, 2025 at 05:44:37PM +0100, Ramsay Jones wrote:\n>> diff --git a/meson.build b/meson.build\n>> index 48f31157a0..106cb17612 100644\n>> --- a/meson.build\n>> +++ b/meson.build\n>> @@ -757,8 +757,6 @@ endif\n>>  libgit_c_args = [\n>>    '-DBINDIR=\"' + get_option('bindir') + '\"',\n>>    '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n>> -  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n>> -  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n>>    '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n>>    '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n>>    '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n>> @@ -769,6 +767,18 @@ libgit_c_args = [\n>>    '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n>>  ]\n>>  \n>> +system_attributes = get_option('gitattributes')\n>> +if system_attributes != ''\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>> +endif\n>> +system_config = get_option('gitconfig')\n>> +if system_config != ''\n>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n> \n> Instead of `get_option('sysconfdir') + '/gitconfig'` you can say\n> `get_option('sysconfdir') / 'gitconfig'`. It's a bit pointless in this\n> case and not really needed, but '/' has some special magic for handling\n> absolute and relative paths.\n\nOK, TIL. I just looked this up ([0]) and I am not sure such 'magic' is\nalways a good thing. ;)\n\n[0] https://mesonbuild.com/Syntax.html#string-path-building\n\n>> +endif\n>>  editor_opt = get_option('default_editor')\n>>  if editor_opt != '' and editor_opt != 'vi'\n>>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n> \n> Nit: let's maybe add an empty newline after each of these blocks to make\n> it a bit easier to see where handling for each specific option stops.\n\nOK, will do.\n\n>> diff --git a/meson_options.txt b/meson_options.txt\n>> index 8547c0eb47..4d78d4c7ac 100644\n>> --- a/meson_options.txt\n>> +++ b/meson_options.txt\n>> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n>>    description: 'Fall-back pager.')\n>>  option('default_editor', type: 'string', value: 'vi',\n>>    description: 'Fall-back editor.')\n>> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n>> +option('gitconfig', type: 'string',\n>>    description: 'Path to the global git configuration file.')\n>> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n>> +option('gitattributes', type: 'string',\n>>    description: 'Path to the global git attributes file.')\n>>  option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n>>    description: 'Environment used when spawning the pager')\n> \n> Makes sense. Should we maybe document the default values here now that\n> they aren't immediately obvious anymore?\n\ngood idea.\n\nThanks!\n\nATB,\nRamsay Jones\n\n\n"},{"id":"517970","messageId":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250508164443.1506440-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:21Z","receivedAt":"2025-05-13T19:21:17Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nChanges in v2:\n\nPatch #3 is the only one changed (as a result of Patrick's review [0]):\n\n - add some blank lines to make the option handling blocks\n   easier to see.\n - add a comment to 'gitconfig' and 'gitattributes' options\n   to indicate the default values.\n\nNote: The indicated defaults for the 'gitconfig' and 'gitattributes'\nare only valid when the 'prefix' option is defaulted (or not /usr).\nIndicating the 'correct' value when -Dprefix=/usr in the comment\nwould consume too much space. Is this acceptable, or is it too\nconfusing/misleading?\n\nAlso, thanks to Eli for testing patch #5 on Solaris and confirming\nthat it fixes the regression [1].\n\nNote that I did a test merge to master@38af977b81 without issue and\nto next@889b7c5bd8 and seen@d8088176ab. The conflict which showed\nup in v1 against the 'seen' branch now appears in 'next' and has\nthe same resolution as v1.\n\nA range-diff against v1 is given below.\n\n[0] https://lore.kernel.org/git/aB3CDOljn9zJsVwt@pks.im/\n[1] https://lore.kernel.org/git/9baad29d-a5bf-443d-98a1-36d7020e5835@gentoo.org/\n\nv1 cover letter follows:\n\nThis series (part 2) continues the miscellaneous changes to the make,\nmeson and autoconf build systems. I am sending this part a little\nearlier than I expected, so there will now be a part 3!\n\nThe reason for the early posting is to try and avoid an regression in\nthe autoconf build system (see patch #5). Hopefully, we still have time\nin this cycle to get patch #5 included.\n\nThis series is based on commit 6f84262c44 (\"The eleventh batch\", 2025-05-05)\n\nI did a test merge to 'next'@629a3ecd64 without issue, but 'seen'@71cfd25022\nhad a small conflict with commit 1a2929c851 (\"meson: allow customize perl\ninstallation path\", 2025-04-24) on the 'dd/meson-perl-custom-path' branch.\n(I note that a new version of that patch was posted to the list today).\n\nThe fixup looks like:\n\n    diff --cc perl/Git/SVN/Memoize/meson.build\n    index 4c589b30c3,8c2e80d2d2..d6209dc3bf\n    --- a/perl/Git/SVN/Memoize/meson.build\n    +++ b/perl/Git/SVN/Memoize/meson.build\n    @@@ -3,6 -3,6 +3,6 @@@ test_dependencies += custom_target\n        output: 'YAML.pm',\n        command: generate_perl_command,\n        install: true,\n    -   install_dir: perllibdir / 'Git/SVN',\n     -  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n    ++  install_dir: perllibdir / 'Git/SVN/Memoize',\n        depends: [git_version_file],\n      )\n\nATB,\nRamsay Jones\n\n\nRamsay Jones (5):\n  meson.build: quote the GITWEBDIR build configuration\n  meson: correct install location of YAML.pm\n  meson: correct path to system config/attribute files\n  meson.build: correct setting of GIT_EXEC_PATH\n  configure.ac: upgrade to a compilation check for sysinfo\n\n configure.ac                     | 25 ++++++++++++++++++++++---\n meson.build                      | 30 +++++++++++++++++++++++++-----\n meson_options.txt                |  4 ++--\n perl/Git/SVN/Memoize/meson.build |  2 +-\n 4 files changed, 50 insertions(+), 11 deletions(-)\n\nrange-diff against v1:\n\n1:  d5847ef791 = 1:  1f3d34eafd meson.build: quote the GITWEBDIR build configuration\n2:  49e2ec6fd2 = 2:  1b7751914a meson: correct install location of YAML.pm\n3:  fece809f11 ! 3:  a385bbed83 meson: correct path to system config/attribute files\n    @@ meson.build: libgit_c_args = [\n     +else\n     +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n     +endif\n    ++\n     +system_config = get_option('gitconfig')\n     +if system_config != ''\n     +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n     +else\n     +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n     +endif\n    ++\n      editor_opt = get_option('default_editor')\n      if editor_opt != '' and editor_opt != 'vi'\n        libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n    @@ meson_options.txt: option('default_pager', type: 'string', value: 'less',\n      option('default_editor', type: 'string', value: 'vi',\n        description: 'Fall-back editor.')\n     -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n    -+option('gitconfig', type: 'string',\n    ++option('gitconfig', type: 'string', # default 'etc/gitconfig'\n        description: 'Path to the global git configuration file.')\n     -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n    -+option('gitattributes', type: 'string',\n    ++option('gitattributes', type: 'string', # default 'etc/gitattributes'\n        description: 'Path to the global git attributes file.')\n      option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n        description: 'Environment used when spawning the pager')\n4:  d49afaedf3 = 4:  0d00951475 meson.build: correct setting of GIT_EXEC_PATH\n5:  69848e557f = 5:  150e4110d2 configure.ac: upgrade to a compilation check for sysinfo\n-- \n2.49.0\n\n"},{"id":"517971","messageId":"20250513191739.1513460-2-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 1/5] meson.build: quote the GITWEBDIR build configuration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:22Z","receivedAt":"2025-05-13T19:21:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The build configuration options with (non-empty) values, for example\nfilesystem paths potentially containing spaces, have been set using\nthe '.set_quoted()' method. However, the GITWEBDIR value has been\nset using the '.set()' method instead. In order to correctly quote\nthe GITWEBDIR value, replace the '.set()' method with '.set_quoted()'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/meson.build b/meson.build\nindex 270ce933d0..48f31157a0 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -739,7 +739,7 @@ build_options_config.set('GIT_TEST_OPTS', '')\n build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')\n build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n-build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n+build_options_config.set_quoted('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n if get_option('sane_tool_path').length() != 0\n   sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))\n-- \n2.49.0\n\n"},{"id":"517972","messageId":"20250513191739.1513460-3-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 2/5] meson: correct install location of YAML.pm","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:23Z","receivedAt":"2025-05-13T19:21:22Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"When executing an 'meson install' the YAML.pm file is incorrectly\nplaced in the <prefix>/share/perl5/Git/SVN directory. The YAML.pm\nfile should be placed in a 'Memoize' subdirectory instead. In order\nto correct the location, update the 'install_dir' of the relevant\ntarget in the 'perl/Git/SVN/Memoize/meson.build' file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n perl/Git/SVN/Memoize/meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Memoize/meson.build b/perl/Git/SVN/Memoize/meson.build\nindex 233ec670d7..8c2e80d2d2 100644\n--- a/perl/Git/SVN/Memoize/meson.build\n+++ b/perl/Git/SVN/Memoize/meson.build\n@@ -3,6 +3,6 @@ test_dependencies += custom_target(\n   output: 'YAML.pm',\n   command: generate_perl_command,\n   install: true,\n-  install_dir: get_option('datadir') / 'perl5/Git/SVN',\n+  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n   depends: [git_version_file],\n )\n-- \n2.49.0\n\n"},{"id":"517973","messageId":"20250513191739.1513460-4-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:24Z","receivedAt":"2025-05-13T19:21:26Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The path to the system-wide config and attributes files are not being\nset correctly in the meson build. Unless explicitly overridden on the\ncommand line during setup, the 'gitconfig' and 'gitattributes' options\nare defaulting to absolute paths in the '/etc' system directory. This\nis only appropriate if the <prefix> is set specifically to '/usr'.\n\nThe directory in which these files are placed is generally referred to\nas the 'system configuration directory' or 'sysconfdir' for short. When\nthe prefix is '/usr' then the sysconfdir is usually set to '/etc', but\nany other value for prefix results in the relative directory value 'etc'\ninstead. (eg if prefix is '/usr/local', then the 'etc' relative value\nresults in a system configuration directory of '/usr/local/etc'). When\nsetting the 'sysconfdir' builtin option value, the meson system uses\nexactly this algorithm, so we can use get_option('sysconfdir') directly\nwhen setting the (non-overridden) build variables.\n\nIn order to allow for overriding from the command line, remove the\ndefault values specified for the 'gitconfig' and 'gitattributes' options\nin the 'meson_options.txt' file. This allows the user to specify any\npathname for those options, while being able to test for the unset\n(empty) value. An absolute pathname will be used unchanged and a relative\npathname will be appended to '<prefix>/'. These values are then used to\nset the 'ETC_GITCONFIG' and 'ETC_GITATTRIBUTES' build variables which are,\nin turn, passed to the compiler as '-D' arguments.\n\nWhen the 'gitconfig' or 'gitattributes' options are not used, then use\nthe built-in 'sysconfdir' and set the ETC_GITCONFIG build variable to\nthe string \"<sysconfdir>/gitconfig\". Similarly, set ETC_ATTRIBUTES to\n\"<sysconfdir>/gitattributes\".\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build       | 16 ++++++++++++++--\n meson_options.txt |  4 ++--\n 2 files changed, 16 insertions(+), 4 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 48f31157a0..7f811030bd 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -757,8 +757,6 @@ endif\n libgit_c_args = [\n   '-DBINDIR=\"' + get_option('bindir') + '\"',\n   '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n-  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n-  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n   '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n   '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n   '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n@@ -769,6 +767,20 @@ libgit_c_args = [\n   '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n ]\n \n+system_attributes = get_option('gitattributes')\n+if system_attributes != ''\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n+else\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n+endif\n+\n+system_config = get_option('gitconfig')\n+if system_config != ''\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n+else\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n+endif\n+\n editor_opt = get_option('default_editor')\n if editor_opt != '' and editor_opt != 'vi'\n   libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 8547c0eb47..ff877e67ce 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n   description: 'Fall-back pager.')\n option('default_editor', type: 'string', value: 'vi',\n   description: 'Fall-back editor.')\n-option('gitconfig', type: 'string', value: '/etc/gitconfig',\n+option('gitconfig', type: 'string', # default 'etc/gitconfig'\n   description: 'Path to the global git configuration file.')\n-option('gitattributes', type: 'string', value: '/etc/gitattributes',\n+option('gitattributes', type: 'string', # default 'etc/gitattributes'\n   description: 'Path to the global git attributes file.')\n option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n   description: 'Environment used when spawning the pager')\n-- \n2.49.0\n\n"},{"id":"517974","messageId":"20250513191739.1513460-5-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:25Z","receivedAt":"2025-05-13T19:21:30Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"For the non-'runtime prefix' case, the meson build sets the GIT_EXEC_PATH\nbuild variable to an absolute path equivalent to <prefix>/libexec/git-core.\nIn comparison, the default make build sets it to a relative path equivalent\nto 'libexec/git-core'. Indeed, the make build requires the use of some\nmeans outside of the Makefile (eg. config.mak[.*] or the command-line)\nto set GIT_EXEC_PATH to anything other than 'libexec/git-core'.\n\nFor example, the make invocation:\n\n  $ make gitexecdir=/some/other/bin all install\n\nwill build git with GIT_EXEC_PATH set to '/some/other/bin' and install\nthe 'library' executables to that location. However, without setting the\n'gitexecdir' make variable, irrespective of the 'runtime prefix' setting,\nthe GIT_EXEC_PATH is always set to 'libexec/git-core'.\n\nThe meson built-in 'libexecdir' option can be used to provide a similar\nconfigurability. The default value for the option is 'libexec'. Attempting\nto set the option to '' on the command-line, will reset it to the '.'\nstring, presumably to ensure a relative path value.\n\nThis commit allows the meson build, similar to the above, to configure the\nproject like:\n\n  $ meson setup --buildtype=debugoptimized -Dprefix=$HOME -Dpcre2=disabled \\\n      -Dlibexecdir=/some/other/bin build\n\nso that the GIT_EXEC_PATH is set to '/some/other/bin'. Absent the\n-Dlibexecdir argument, the GIT_EXEC_PATH is set to 'libexec/git-core'.\n\nIn order to correct the value of GIT_EXEC_PATH, default the value to the\nstatic string value 'libexec/git-core', and only override if the value\nof the 'libexecdir' option has a value different to 'libexec' or '.'.\nAlso, like the Makefile, add a check for an absolute path when the\nruntime prefix option is true (and if so, error out).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 7f811030bd..28276e5305 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1592,10 +1592,19 @@ else\n   error('Unsupported CSPRNG backend: ' + csprng_backend)\n endif\n \n+git_exec_path = 'libexec/git-core'\n+libexec = get_option('libexecdir')\n+if libexec != 'libexec' and libexec != '.'\n+  git_exec_path = libexec\n+endif\n+\n if get_option('runtime_prefix')\n   libgit_c_args += '-DRUNTIME_PREFIX'\n   build_options_config.set('RUNTIME_PREFIX', 'true')\n-  git_exec_path = get_option('libexecdir') / 'git-core'\n+\n+  if git_exec_path.startswith('/')\n+    error('runtime_prefix requires a relative libexecdir not:', libexec)\n+  endif\n \n   if compiler.has_header('mach-o/dyld.h')\n     libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'\n@@ -1632,7 +1641,6 @@ if get_option('runtime_prefix')\n   endif\n else\n   build_options_config.set('RUNTIME_PREFIX', 'false')\n-  git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core'\n endif\n libgit_c_args += '-DGIT_EXEC_PATH=\"' + git_exec_path + '\"'\n \n-- \n2.49.0\n\n"},{"id":"517975","messageId":"20250513191739.1513460-6-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v2 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T19:17:26Z","receivedAt":"2025-05-13T19:21:34Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Commit f5e3c6c57d (\"meson: do a full usage-based compile check for\nsysinfo\", 2025-04-25) updated the 'sysinfo()' check, as part of the\nmeson build, due to the failure of the check on Solaris. Prior to\nthat commit, the meson build only checked the availability of the\n'<sys/sysinfo.h>' header file. On Solaris, both the header and the\n'sysinfo()' function exist, but are completely unrelated to the same\nfunction on Linux (and cygwin).\n\nCommit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\ncygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\nbuild. This check looked for the 'sysinfo()' function itself, rather\nthat just the header, but it will fail (incorrectly set HAVE_SYSINFO)\nfor the same reason.\n\nIn order to correctly identify the 'sysinfo()' function we require as\npart of 'git-gc' (used in the 'total_ram() function), we also upgrade\nto a compilation check, in a similar way to the meson commit. Note that\nsince commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\nusing sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\nof the 'struct sysinfo' are used, so the new check includes both of\nthose fields in the compile check.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n configure.ac | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex d7e0503f1e..f6caab919a 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1069,9 +1069,28 @@ GIT_CONF_SUBST([CHARSET_LIB])\n \n #\n # Define HAVE_SYSINFO=YesPlease if sysinfo is available.\n-GIT_CHECK_FUNC(sysinfo,\n-\t[HAVE_SYSINFO=YesPlease],\n-\t[HAVE_SYSINFO=])\n+#\n+AC_DEFUN([HAVE_SYSINFO_SRC], [\n+AC_LANG_PROGRAM([[\n+#include <stdint.h>\n+#include <sys/sysinfo.h>\n+]], [[\n+struct sysinfo si;\n+uint64_t t = 0;\n+if (!sysinfo(&si)) {\n+\tt = si.totalram;\n+\tif (si.mem_unit > 1)\n+\t\tt *= (uint64_t)si.mem_unit;\n+}\n+return t;\n+]])])\n+\n+AC_MSG_CHECKING([for sysinfo])\n+AC_COMPILE_IFELSE([HAVE_SYSINFO_SRC],\n+\t[AC_MSG_RESULT([yes])\n+\tHAVE_SYSINFO=YesPlease],\n+\t[AC_MSG_RESULT([no])\n+\tHAVE_SYSINFO=])\n GIT_CONF_SUBST([HAVE_SYSINFO])\n \n #\n-- \n2.49.0\n\n"},{"id":"517981","messageId":"xmqqr00sfeuy.fsf@gitster.g","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH v2 0/5] miscellaneous build mods (part 2)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-13T20:13:57Z","receivedAt":"2025-05-13T20:14:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> Changes in v2:\n>\n> Patch #3 is the only one changed (as a result of Patrick's review [0]):\n>\n>  - add some blank lines to make the option handling blocks\n>    easier to see.\n>  - add a comment to 'gitconfig' and 'gitattributes' options\n>    to indicate the default values.\n>\n> Note: The indicated defaults for the 'gitconfig' and 'gitattributes'\n> are only valid when the 'prefix' option is defaulted (or not /usr).\n> Indicating the 'correct' value when -Dprefix=/usr in the comment\n> would consume too much space. Is this acceptable, or is it too\n> confusing/misleading?\n>\n> Also, thanks to Eli for testing patch #5 on Solaris and confirming\n> that it fixes the regression [1].\n\nYeah, thanks, all.\n\n> A range-diff against v1 is given below.\n> ...\n> 3:  fece809f11 ! 3:  a385bbed83 meson: correct path to system config/attribute files\n>     @@ meson.build: libgit_c_args = [\n> ...\n>         description: 'Environment used when spawning the pager')\n> 4:  d49afaedf3 = 4:  0d00951475 meson.build: correct setting of GIT_EXEC_PATH\n> 5:  69848e557f = 5:  150e4110d2 configure.ac: upgrade to a compilation check for sysinfo\n\nHmph, For #5 I am seeing this difference:\n\n    @@ Commit message\n         Commit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\n         cygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\n         build. This check looked for the 'sysinfo()' function itself, rather\n    -    than just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n    +    that just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n         for the same reason.\n     \n         In order to correctly identify the 'sysinfo()' function we require as\n\nThe original comes from what was posted in the first iteration, and\nsomehow the change is not showing in your range-diff, which is a bit\ndisturbing.\n\nI think for now I'll just amend the log message of #5 back to what\nwas in the previous round locally.\n\nThanks.\n\n"},{"id":"517982","messageId":"4e55f005-f51f-4c3f-9ba3-8ff415e10b30@ramsayjones.plus.com","threadId":"63423","inReplyTo":"xmqqr00sfeuy.fsf@gitster.g","subject":"Re: [PATCH v2 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-13T20:55:11Z","receivedAt":"2025-05-13T20:58:23Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 13/05/2025 21:13, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n>> Changes in v2:\n>>\n>> Patch #3 is the only one changed (as a result of Patrick's review [0]):\n>>\n>>  - add some blank lines to make the option handling blocks\n>>    easier to see.\n>>  - add a comment to 'gitconfig' and 'gitattributes' options\n>>    to indicate the default values.\n>>\n>> Note: The indicated defaults for the 'gitconfig' and 'gitattributes'\n>> are only valid when the 'prefix' option is defaulted (or not /usr).\n>> Indicating the 'correct' value when -Dprefix=/usr in the comment\n>> would consume too much space. Is this acceptable, or is it too\n>> confusing/misleading?\n>>\n>> Also, thanks to Eli for testing patch #5 on Solaris and confirming\n>> that it fixes the regression [1].\n> \n> Yeah, thanks, all.\n> \n>> A range-diff against v1 is given below.\n>> ...\n>> 3:  fece809f11 ! 3:  a385bbed83 meson: correct path to system config/attribute files\n>>     @@ meson.build: libgit_c_args = [\n>> ...\n>>         description: 'Environment used when spawning the pager')\n>> 4:  d49afaedf3 = 4:  0d00951475 meson.build: correct setting of GIT_EXEC_PATH\n>> 5:  69848e557f = 5:  150e4110d2 configure.ac: upgrade to a compilation check for sysinfo\n> \n> Hmph, For #5 I am seeing this difference:\n> \n>     @@ Commit message\n>          Commit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\n>          cygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\n>          build. This check looked for the 'sysinfo()' function itself, rather\n>     -    than just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n>     +    that just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n>          for the same reason.\n>      \n>          In order to correctly identify the 'sysinfo()' function we require as\n> \n> The original comes from what was posted in the first iteration, and\n> somehow the change is not showing in your range-diff, which is a bit\n> disturbing.\n\nOops! yeah, I noticed the typo late in the last round and changed that\npatch text directly. :)\n\nI could have sworn that I made the same change to the commit message\nas well, but ...\n\nSorry about that!\n\n> I think for now I'll just amend the log message of #5 back to what\n> was in the previous round locally.\n\nYes please! Thanks.\n\nATB,\nRamsay Jones\n\n\n"},{"id":"517999","messageId":"aCQdznsNfaIeSPDI@pks.im","threadId":"63423","inReplyTo":"20250513191739.1513460-4-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-05-14T04:36:30Z","receivedAt":"2025-05-14T04:36:36Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, May 13, 2025 at 08:17:24PM +0100, Ramsay Jones wrote:\n> diff --git a/meson.build b/meson.build\n> index 48f31157a0..7f811030bd 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -769,6 +767,20 @@ libgit_c_args = [\n>    '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n>  ]\n>  \n> +system_attributes = get_option('gitattributes')\n> +if system_attributes != ''\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n> +else\n> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n> +endif\n> +\n> +system_config = get_option('gitconfig')\n> +if system_config != ''\n> +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n> +else\n> +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n> +endif\n\nNit: I still think that we should use `get_option('sysconfdir') /\n'gitattributes'`, with the slash instead of a plus, mostly because it is\nmore idiomatic and reads better. But that alone doesn't warrant a\nreroll.\n\n>  editor_opt = get_option('default_editor')\n>  if editor_opt != '' and editor_opt != 'vi'\n>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n> diff --git a/meson_options.txt b/meson_options.txt\n> index 8547c0eb47..ff877e67ce 100644\n> --- a/meson_options.txt\n> +++ b/meson_options.txt\n> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n>    description: 'Fall-back pager.')\n>  option('default_editor', type: 'string', value: 'vi',\n>    description: 'Fall-back editor.')\n> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n> +option('gitconfig', type: 'string', # default 'etc/gitconfig'\n>    description: 'Path to the global git configuration file.')\n> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n> +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n>    description: 'Path to the global git attributes file.')\n\nI'd prefer if we documented the default value in the description.\nOtherwise it is impossible to discover it without having a look at the\nsources.\n\nOther than that the range-diff looks as expected, thanks!\n\nPatrick\n"},{"id":"518151","messageId":"a163d515-2e71-4a42-b843-26d5d2ccdc59@ramsayjones.plus.com","threadId":"63423","inReplyTo":"aCQdznsNfaIeSPDI@pks.im","subject":"Re: [PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-15T16:42:00Z","receivedAt":"2025-05-15T16:42:13Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 14/05/2025 05:36, Patrick Steinhardt wrote:\n> On Tue, May 13, 2025 at 08:17:24PM +0100, Ramsay Jones wrote:\n>> diff --git a/meson.build b/meson.build\n>> index 48f31157a0..7f811030bd 100644\n>> --- a/meson.build\n>> +++ b/meson.build\n>> @@ -769,6 +767,20 @@ libgit_c_args = [\n>>    '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n>>  ]\n>>  \n>> +system_attributes = get_option('gitattributes')\n>> +if system_attributes != ''\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>> +endif\n>> +\n>> +system_config = get_option('gitconfig')\n>> +if system_config != ''\n>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n>> +else\n>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n>> +endif\n> \n> Nit: I still think that we should use `get_option('sysconfdir') /\n> 'gitattributes'`, with the slash instead of a plus, mostly because it is\n> more idiomatic and reads better. But that alone doesn't warrant a\n> reroll.\n\nOK, if I need to re-roll, I will fix this up. (but see below)\n\n>>  editor_opt = get_option('default_editor')\n>>  if editor_opt != '' and editor_opt != 'vi'\n>>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n>> diff --git a/meson_options.txt b/meson_options.txt\n>> index 8547c0eb47..ff877e67ce 100644\n>> --- a/meson_options.txt\n>> +++ b/meson_options.txt\n>> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n>>    description: 'Fall-back pager.')\n>>  option('default_editor', type: 'string', value: 'vi',\n>>    description: 'Fall-back editor.')\n>> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n>> +option('gitconfig', type: 'string', # default 'etc/gitconfig'\n>>    description: 'Path to the global git configuration file.')\n>> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n>> +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n>>    description: 'Path to the global git attributes file.')\n> \n> I'd prefer if we documented the default value in the description.\n> Otherwise it is impossible to discover it without having a look at the\n> sources.\n\nHmm, but how do you get the description! :)\n\n\nI applied the following patch on top:\n\n  diff --git a/meson.build b/meson.build\n  index 28276e5305..bd14bc15a1 100644\n  --- a/meson.build\n  +++ b/meson.build\n  @@ -771,14 +771,14 @@ system_attributes = get_option('gitattributes')\n   if system_attributes != ''\n     libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n   else\n  -  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n  +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') / 'gitattributes\"'\n   endif\n   \n   system_config = get_option('gitconfig')\n   if system_config != ''\n     libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n   else\n  -  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n  +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') / 'gitconfig\"'\n   endif\n   \n   editor_opt = get_option('default_editor')\n  diff --git a/meson_options.txt b/meson_options.txt\n  index ff877e67ce..7a4b896f7e 100644\n  --- a/meson_options.txt\n  +++ b/meson_options.txt\n  @@ -4,9 +4,9 @@ option('default_pager', type: 'string', value: 'less',\n   option('default_editor', type: 'string', value: 'vi',\n     description: 'Fall-back editor.')\n   option('gitconfig', type: 'string', # default 'etc/gitconfig'\n  -  description: 'Path to the global git configuration file.')\n  +  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n   option('gitattributes', type: 'string', # default 'etc/gitattributes'\n  -  description: 'Path to the global git attributes file.')\n  +  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n   option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n     description: 'Environment used when spawning the pager')\n   option('perl_cpan_fallback', type: 'boolean', value: true,\n----\n\nSo, the addition of the '(default: <value>)' to the description field is\nintended to mimic the setup help text for the built-in meson options:\n\n  $ meson help setup\n  usage: meson setup [-h] [--prefix PREFIX] [--bindir BINDIR] [--datadir DATADIR]\n  \n  ...\n  \n  options:\n    -h, --help                            show this help message and exit\n    --prefix PREFIX                       Installation prefix (default:\n                                          /usr/local).\n    --bindir BINDIR                       Executable directory (default: bin).\n    --datadir DATADIR                     Data file directory (default: share).\n    --includedir INCLUDEDIR               Header file directory (default:\n                                          include).\n    --infodir INFODIR                     Info page directory (default:\n                                          share/info).\n    --libdir LIBDIR                       Library directory (default:\n                                          lib/x86_64-linux-gnu).\n    --licensedir LICENSEDIR               Licenses directory (default: ).\n    --libexecdir LIBEXECDIR               Library executable directory (default:\n                                          libexec).\n    --localedir LOCALEDIR                 Locale data directory (default:\n                                          share/locale).\n    --localstatedir LOCALSTATEDIR         Localstate data directory (default:\n                                          var).\n    --mandir MANDIR                       Manual page directory (default:\n                                          share/man).\n    --sbindir SBINDIR                     System executable directory (default:\n                                          sbin).\n    --sharedstatedir SHAREDSTATEDIR       Architecture-independent data directory\n                                          (default: com).\n    --sysconfdir SYSCONFDIR               Sysconf data directory (default: etc).\n  \n  ...\n  \n  $ \n\nIndeed, there appears to be no way to display the project specific options\nto the user *before* configuring a build directory. \n\n  $ pwd\n  /home/ramsay/git\n  $ meson introspect --buildoptions\n  Current directory is not a meson build directory.\n  Please specify a valid build dir or change the working directory to it.\n  $ \n\nNote that I don't recommend 'meson introspect --buildoptions' as a means\nfor the user to inspect the available options, but it does allow me to\ncheck that the description field looks correct:\n\n  $ meson introspect --buildoptions build | jq | grep gitconfig\n      \"name\": \"gitconfig\",\n      \"description\": \"Path to the global git configuration file. (default: etc/gitconfig)\"\n  $ meson introspect --buildoptions build | jq | grep gitattributes\n      \"name\": \"gitattributes\",\n      \"description\": \"Path to the global git attributes file. (default: etc/gitattributes)\"\n  $ \n\nThe only way I have found to display the project options to the user (after\nconfiguring the project) is using 'meson configure', thus:  \n  \n  $ meson configure build\n  \n  ...\n  \n    Project options    Current Value        Possible Values      Description      \n    -----------------  -------------        ---------------      -----------      \n  benchmark_large_repo                                           Large repository \n                                                                 to copy for the  \n                                                                 performance      \n                                                                 tests. Should be \n                                                                 at least the size\n                                                                 of the Linux     \n                                                                 repository.      \n\n  ...\n\n    gitattributes                                                Path to the      \n                                                                 global git       \n                                                                 attributes file. \n                                                                 (default: etc/git\n                                                                 attributes)      \n    gitconfig                                                    Path to the      \n                                                                 global git       \n                                                                 configuration    \n                                                                 file. (default:  \n                                                                 etc/gitconfig)   \n  \n  ...\n  \n  $ \n\n[Yes, I use 80 column terminals! :) ]\n\nNote that this display shows the *current* value, not the default value, and\n(once again) in this case there really isn't a default value! ;) (iff prefix\nis exactly '/usr', then the 'default' is eg. '/etc/gitconfig').\n\nOf course, the current value would be the default value unless you have\nset the value on the command-line (of which you would presumably be aware).\n\n[Well, it can be argued that eg. 'etc/gitconfig' is the default value for\nthe project option 'gitconfig', but that is just one input to determine\nthe actual path compiled into git (which _may_depend on the value of another\noption ie. 'prefix')].\n\nHaving said that, the --sysconfdir default is shown as 'etc' (see above) and\nthat has (*is*) the same problem (ie it is '/etc' iff prefix is '/usr').\n\nAlso, looking through that list, other options which are similarly specified\nto gitconfig/gitattributes don't have their 'default' noted in the description.\nWhy make an exception for these options?\n\nIs this what you wanted to see? If so, then I can submit a v3 with the\nabove changes. Just let me know.\n\nThanks.\n\nATB,\nRamsay Jones\n\n\n \n\n"},{"id":"518158","messageId":"8ca4ebd7-1058-4694-ba50-baf248b45050@gentoo.org","threadId":"63423","inReplyTo":"a163d515-2e71-4a42-b843-26d5d2ccdc59@ramsayjones.plus.com","subject":"Re: [PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Eli Schwartz","fromEmail":"eschwartz@gentoo.org","sentAt":"2025-05-15T17:51:23Z","receivedAt":"2025-05-15T17:51:26Z","isPatch":true,"sender":{"key":"eschwartz@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/6551424?v=4"},"body":"On 5/15/25 12:42 PM, Ramsay Jones wrote:\n> \n> \n> On 14/05/2025 05:36, Patrick Steinhardt wrote:\n>> On Tue, May 13, 2025 at 08:17:24PM +0100, Ramsay Jones wrote:\n>>> diff --git a/meson.build b/meson.build\n>>> index 48f31157a0..7f811030bd 100644\n>>> --- a/meson.build\n>>> +++ b/meson.build\n>>> @@ -769,6 +767,20 @@ libgit_c_args = [\n>>>    '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n>>>  ]\n>>>  \n>>> +system_attributes = get_option('gitattributes')\n>>> +if system_attributes != ''\n>>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>>> +else\n>>> +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>>> +endif\n>>> +\n>>> +system_config = get_option('gitconfig')\n>>> +if system_config != ''\n>>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n>>> +else\n>>> +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n>>> +endif\n>>\n>> Nit: I still think that we should use `get_option('sysconfdir') /\n>> 'gitattributes'`, with the slash instead of a plus, mostly because it is\n>> more idiomatic and reads better. But that alone doesn't warrant a\n>> reroll.\n> \n> OK, if I need to re-roll, I will fix this up. (but see below)\n> \n>>>  editor_opt = get_option('default_editor')\n>>>  if editor_opt != '' and editor_opt != 'vi'\n>>>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n>>> diff --git a/meson_options.txt b/meson_options.txt\n>>> index 8547c0eb47..ff877e67ce 100644\n>>> --- a/meson_options.txt\n>>> +++ b/meson_options.txt\n>>> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n>>>    description: 'Fall-back pager.')\n>>>  option('default_editor', type: 'string', value: 'vi',\n>>>    description: 'Fall-back editor.')\n>>> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n>>> +option('gitconfig', type: 'string', # default 'etc/gitconfig'\n>>>    description: 'Path to the global git configuration file.')\n>>> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n>>> +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n>>>    description: 'Path to the global git attributes file.')\n>>\n>> I'd prefer if we documented the default value in the description.\n>> Otherwise it is impossible to discover it without having a look at the\n>> sources.\n> \n> Hmm, but how do you get the description! :)\n> \n> \n> I applied the following patch on top:\n> \n>   diff --git a/meson.build b/meson.build\n>   index 28276e5305..bd14bc15a1 100644\n>   --- a/meson.build\n>   +++ b/meson.build\n>   @@ -771,14 +771,14 @@ system_attributes = get_option('gitattributes')\n>    if system_attributes != ''\n>      libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n>    else\n>   -  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n>   +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') / 'gitattributes\"'\n>    endif\n>    \n>    system_config = get_option('gitconfig')\n>    if system_config != ''\n>      libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n>    else\n>   -  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n>   +  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') / 'gitconfig\"'\n>    endif\n>    \n>    editor_opt = get_option('default_editor')\n>   diff --git a/meson_options.txt b/meson_options.txt\n>   index ff877e67ce..7a4b896f7e 100644\n>   --- a/meson_options.txt\n>   +++ b/meson_options.txt\n>   @@ -4,9 +4,9 @@ option('default_pager', type: 'string', value: 'less',\n>    option('default_editor', type: 'string', value: 'vi',\n>      description: 'Fall-back editor.')\n>    option('gitconfig', type: 'string', # default 'etc/gitconfig'\n>   -  description: 'Path to the global git configuration file.')\n>   +  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n>    option('gitattributes', type: 'string', # default 'etc/gitattributes'\n>   -  description: 'Path to the global git attributes file.')\n>   +  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n>    option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n>      description: 'Environment used when spawning the pager')\n>    option('perl_cpan_fallback', type: 'boolean', value: true,\n> ----\n> \n> So, the addition of the '(default: <value>)' to the description field is\n> intended to mimic the setup help text for the built-in meson options:\n> \n>   $ meson help setup\n>   usage: meson setup [-h] [--prefix PREFIX] [--bindir BINDIR] [--datadir DATADIR]\n>   \n>   ...\n>   \n>   options:\n>     -h, --help                            show this help message and exit\n>     --prefix PREFIX                       Installation prefix (default:\n>                                           /usr/local).\n>     --bindir BINDIR                       Executable directory (default: bin).\n>     --datadir DATADIR                     Data file directory (default: share).\n>     --includedir INCLUDEDIR               Header file directory (default:\n>                                           include).\n>     --infodir INFODIR                     Info page directory (default:\n>                                           share/info).\n>     --libdir LIBDIR                       Library directory (default:\n>                                           lib/x86_64-linux-gnu).\n>     --licensedir LICENSEDIR               Licenses directory (default: ).\n>     --libexecdir LIBEXECDIR               Library executable directory (default:\n>                                           libexec).\n>     --localedir LOCALEDIR                 Locale data directory (default:\n>                                           share/locale).\n>     --localstatedir LOCALSTATEDIR         Localstate data directory (default:\n>                                           var).\n>     --mandir MANDIR                       Manual page directory (default:\n>                                           share/man).\n>     --sbindir SBINDIR                     System executable directory (default:\n>                                           sbin).\n>     --sharedstatedir SHAREDSTATEDIR       Architecture-independent data directory\n>                                           (default: com).\n>     --sysconfdir SYSCONFDIR               Sysconf data directory (default: etc).\n>   \n>   ...\n>   \n>   $ \n> \n> Indeed, there appears to be no way to display the project specific options\n> to the user *before* configuring a build directory. \n> \n>   $ pwd\n>   /home/ramsay/git\n>   $ meson introspect --buildoptions\n>   Current directory is not a meson build directory.\n>   Please specify a valid build dir or change the working directory to it.\n>   $ \n> \n> Note that I don't recommend 'meson introspect --buildoptions' as a means\n> for the user to inspect the available options, but it does allow me to\n> check that the description field looks correct:\n> \n>   $ meson introspect --buildoptions build | jq | grep gitconfig\n>       \"name\": \"gitconfig\",\n>       \"description\": \"Path to the global git configuration file. (default: etc/gitconfig)\"\n>   $ meson introspect --buildoptions build | jq | grep gitattributes\n>       \"name\": \"gitattributes\",\n>       \"description\": \"Path to the global git attributes file. (default: etc/gitattributes)\"\n>   $ \n> \n> The only way I have found to display the project options to the user (after\n> configuring the project) is using 'meson configure', thus:  \n>   \n>   $ meson configure build\n>   \n>   ...\n> \n> Note that this display shows the *current* value, not the default value, and\n> (once again) in this case there really isn't a default value! ;) (iff prefix\n> is exactly '/usr', then the 'default' is eg. '/etc/gitconfig').\n> \n> Of course, the current value would be the default value unless you have\n> set the value on the command-line (of which you would presumably be aware).\n\n\nWell, so-so.\n\n\neschwartz@acleverhostname ~/git/git $ meson configure .\n\nmeson.build:208:0: ERROR: None of values [] are supported by the C\ncompiler. Possible values for option \"C_std\" are ['none', 'c89', 'c99',\n'c11', 'c17', 'c18', 'c2x', 'c23', 'gnu89', 'gnu99', 'gnu11', 'gnu17',\n'gnu18', 'gnu2x', 'gnu23']\n\n\nBut also,\n\n$ sed -i '/c_std=/d' meson.build && PAGER=cat COLUMNS=80 meson configure .\n\nWARNING: The source directory instead of the build directory was specified.\nWARNING: Only the default values for the project are printed.\n\nCore properties:\n  Source dir /home/eschwartz/git/git\n\nMain project options:\n\n  Core options       Default Value        Possible Values\nDescription\n  --------------     -------------        ---------------\n-----------\n  auto_features      auto                 [enabled, disabled,  Override\nvalue of\n                                           auto]               all\n'auto'\n                                                               features\n\n\n[...]\n\n\nI'm not completely certain why this evaluates as an empty node:\n\n```(meson.version().version_compare('>=1.3.0') ? 'gnu99,c11' : 'gnu99')\n```\n\n\nbut it (meson configure) is part of the AST interpreter, not the runtime\none, which I know less about...\n\n\n-- \nEli Schwartz\n"},{"id":"518169","messageId":"411ba125-68f3-4874-9fce-6f9f83eabe8b@ramsayjones.plus.com","threadId":"63423","inReplyTo":"8ca4ebd7-1058-4694-ba50-baf248b45050@gentoo.org","subject":"Re: [PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-15T19:53:17Z","receivedAt":"2025-05-15T19:53:28Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 15/05/2025 18:51, Eli Schwartz wrote:\n> On 5/15/25 12:42 PM, Ramsay Jones wrote:\n[snip]\n> Well, so-so.\n> \n> \n> eschwartz@acleverhostname ~/git/git $ meson configure .\n> \n> meson.build:208:0: ERROR: None of values [] are supported by the C\n> compiler. Possible values for option \"C_std\" are ['none', 'c89', 'c99',\n> 'c11', 'c17', 'c18', 'c2x', 'c23', 'gnu89', 'gnu99', 'gnu11', 'gnu17',\n> 'gnu18', 'gnu2x', 'gnu23']\n> \n> \n> But also,\n> \n> $ sed -i '/c_std=/d' meson.build && PAGER=cat COLUMNS=80 meson configure .\n> \n> WARNING: The source directory instead of the build directory was specified.\n> WARNING: Only the default values for the project are printed.\n> \n> Core properties:\n>   Source dir /home/eschwartz/git/git\n> \n> Main project options:\n> \n>   Core options       Default Value        Possible Values\n> Description\n>   --------------     -------------        ---------------\n> -----------\n>   auto_features      auto                 [enabled, disabled,  Override\n> value of\n>                                            auto]               all\n> 'auto'\n>                                                                features\n> \n> \n> [...]\n> \n> \n> I'm not completely certain why this evaluates as an empty node:\n> \n> ```(meson.version().version_compare('>=1.3.0') ? 'gnu99,c11' : 'gnu99')\n> ```\n> \n> \n> but it (meson configure) is part of the AST interpreter, not the runtime\n> one, which I know less about...\n\n\nAh, interesting. When it came time to test this patch, I spent about\nhalf an hour trying to get 'meson configure' to tell me about the\nproject options, because I had a distant memory of having done it\nbefore at one point ... :)\n\nHmm, maybe it was before commit 13cb20fc46 (\"meson: fix compilation with\nVisual Studio\", 2025-01-22). If I (effectively) revert that commit, then\n'meson configure' works fine for me (you don't even need the '.').\n\nTIL. Thanks!\n\nATB,\nRamsay Jones\n\n\n"},{"id":"518177","messageId":"44f2741b-a77d-4bac-b4ba-63e23cbc1901@gentoo.org","threadId":"63423","inReplyTo":"56706ad8-93c6-48cd-ad16-9d8b00a669c9@ramsayjones.plus.com","subject":"Re: [PATCH 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Eli Schwartz","fromEmail":"eschwartz@gentoo.org","sentAt":"2025-05-15T20:17:59Z","receivedAt":"2025-05-15T20:18:02Z","isPatch":true,"sender":{"key":"eschwartz@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/6551424?v=4"},"body":"On 5/8/25 7:01 PM, Ramsay Jones wrote:\n>> So you are indeed teaching autoconf to check for this function, but\n>> should we also ask whether it's worth continued maintenance of autoconf?\n>> It was/is not clear to me who the stakeholders are for the autoconf support.\n> \n> Hmm, someone posted a list of people using autoconf somewhat recently\n> to the mailing-list ... I don't have it to hand, but cygwin was one\n> of the projects using it.\n\n\nThanks for the correction. This solves my major concern...\n\n\n>> On the other hand, it sounds like this patch (and commit 50dec7c566\n>> \"config.mak.uname: add sysinfo() configuration for cygwin\") only modify\n>> autoconf out of a sense of duty, rather than finding autoconf useful.\n> \n> Hmm, I am not convinced (yet) that meson is all that useful either. ;)\n>  \n>> What does it say about the autoconf support if the people finding bugs\n>> in it don't even use it, but only discovered the bug while working on a\n>> different build system they do use and depend on (config.mak.uname, or\n>> meson.build, both count here).\n> \n> I am trying very hard not to express a view on this debate. :)\n> \n> [well, except that I find CMake to be absolutely awful!]\n\n\n\n... because to my way of thinking, the ultimate proof of usefulness is\nthat people, well, *use* it. Gentoo uses Meson, ipso facto it is useful. :)\n\nFrom my experience with the ./configure script it wasn't clear to *me*\nthat anyone did use it (and I did a non-exhaustive check of other\ndistributors). If cygwin uses it, it is useful and the question becomes\n*whether* to (properly) deprecate it after evaluating the existing\noptions and balancing use cases with maintenance burden, rather than\n\"just let it rot until we finish discussing its likely deletion\".\n\n\nI'm still not volunteering to do the actual fixing of ./configure :D but\ntesting is easy if someone else wrote the fix...\n\n\n-- \nEli Schwartz\n"},{"id":"518214","messageId":"aCbQ9OX2vqF82au8@pks.im","threadId":"63423","inReplyTo":"a163d515-2e71-4a42-b843-26d5d2ccdc59@ramsayjones.plus.com","subject":"Re: [PATCH v2 3/5] meson: correct path to system config/attribute files","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-05-16T05:45:24Z","receivedAt":"2025-05-16T05:45:28Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, May 15, 2025 at 05:42:00PM +0100, Ramsay Jones wrote:\n> On 14/05/2025 05:36, Patrick Steinhardt wrote:\n> > On Tue, May 13, 2025 at 08:17:24PM +0100, Ramsay Jones wrote:\n> >> diff --git a/meson.build b/meson.build\n> >> index 48f31157a0..7f811030bd 100644\n> >> --- a/meson.build\n> >> +++ b/meson.build\n> >>  editor_opt = get_option('default_editor')\n> >>  if editor_opt != '' and editor_opt != 'vi'\n> >>    libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\n> >> diff --git a/meson_options.txt b/meson_options.txt\n> >> index 8547c0eb47..ff877e67ce 100644\n> >> --- a/meson_options.txt\n> >> +++ b/meson_options.txt\n> >> @@ -3,9 +3,9 @@ option('default_pager', type: 'string', value: 'less',\n> >>    description: 'Fall-back pager.')\n> >>  option('default_editor', type: 'string', value: 'vi',\n> >>    description: 'Fall-back editor.')\n> >> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n> >> +option('gitconfig', type: 'string', # default 'etc/gitconfig'\n> >>    description: 'Path to the global git configuration file.')\n> >> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n> >> +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n> >>    description: 'Path to the global git attributes file.')\n> > \n> > I'd prefer if we documented the default value in the description.\n> > Otherwise it is impossible to discover it without having a look at the\n> > sources.\n> \n> Hmm, but how do you get the description! :)\n\n[snip]\n\n> The only way I have found to display the project options to the user (after\n> configuring the project) is using 'meson configure', thus:  \n>   \n\nYup, that's how I typically do it.\n\n[snip]\n> Also, looking through that list, other options which are similarly specified\n> to gitconfig/gitattributes don't have their 'default' noted in the description.\n> Why make an exception for these options?\n\nIt's not so much about one being exceptional, it's rather that I didn't\nthink about it for the other options. Ideally, we'd document the default\nfor all values where we don't have a hardcoded one.\n\n> Is this what you wanted to see? If so, then I can submit a v3 with the\n> above changes. Just let me know.\n\nYup, the diff you had looks exactly like what I expected. Thanks!\n\nPatrick\n"},{"id":"518293","messageId":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250513191739.1513460-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:38Z","receivedAt":"2025-05-16T18:49:04Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Changes in v3:\n\nPatch #3 changed as a result of Patrick's review [*]:\n\n - use the '/' magic string operator when setting the\n   ETC_GIT{CONFIG,ATTRIBUTES} build options.\n - add the default values to the 'description' fields\n   for the 'gitconfig' and 'gitattributes' option\n   definitions\n\nAlso, Junio, the range-diff below shows the typo fixup, but\nyou should find that it doesn't show for you this time. ;)\n\n[yes, I did fix it up locally, but then overwrote it from\nmy cygwin repo ... Ahem! ;) ]\n\nAgain, I did a test merge to master@1a8a4971cc without issue and \nto next@0be31eac6b and seen@d36a872499. The conflict which showed\nup in v1 against the 'seen' branch now appears in 'next' and has\nthe same resolution as v1.\n\nA range-diff against v2 is given below.\n\n[*] https://lore.kernel.org/git/aCbQ9OX2vqF82au8@pks.im/\n\n\nChanges in v2:\n\nPatch #3 is the only one changed (as a result of Patrick's review [0]):\n\n - add some blank lines to make the option handling blocks\n   easier to see.\n - add a comment to 'gitconfig' and 'gitattributes' options\n   to indicate the default values.\n\nNote: The indicated defaults for the 'gitconfig' and 'gitattributes'\nare only valid when the 'prefix' option is defaulted (or not /usr).\nIndicating the 'correct' value when -Dprefix=/usr in the comment\nwould consume too much space. Is this acceptable, or is it too\nconfusing/misleading?\n\nAlso, thanks to Eli for testing patch #5 on Solaris and confirming\nthat it fixes the regression [1].\n\nNote that I did a test merge to master@38af977b81 without issue and\nto next@889b7c5bd8 and seen@d8088176ab. The conflict which showed\nup in v1 against the 'seen' branch now appears in 'next' and has\nthe same resolution as v1.\n\nA range-diff against v1 is given below.\n\n[0] https://lore.kernel.org/git/aB3CDOljn9zJsVwt@pks.im/\n[1] https://lore.kernel.org/git/9baad29d-a5bf-443d-98a1-36d7020e5835@gentoo.org/\n\nv1 cover letter follows:\n\nThis series (part 2) continues the miscellaneous changes to the make,\nmeson and autoconf build systems. I am sending this part a little\nearlier than I expected, so there will now be a part 3!\n\nThe reason for the early posting is to try and avoid an regression in\nthe autoconf build system (see patch #5). Hopefully, we still have time\nin this cycle to get patch #5 included.\n\nThis series is based on commit 6f84262c44 (\"The eleventh batch\", 2025-05-05)\n\nI did a test merge to 'next'@629a3ecd64 without issue, but 'seen'@71cfd25022\nhad a small conflict with commit 1a2929c851 (\"meson: allow customize perl\ninstallation path\", 2025-04-24) on the 'dd/meson-perl-custom-path' branch.\n(I note that a new version of that patch was posted to the list today).\n\nThe fixup looks like:\n\n    diff --cc perl/Git/SVN/Memoize/meson.build\n    index 4c589b30c3,8c2e80d2d2..d6209dc3bf\n    --- a/perl/Git/SVN/Memoize/meson.build\n    +++ b/perl/Git/SVN/Memoize/meson.build\n    @@@ -3,6 -3,6 +3,6 @@@ test_dependencies += custom_target\n        output: 'YAML.pm',\n        command: generate_perl_command,\n        install: true,\n    -   install_dir: perllibdir / 'Git/SVN',\n     -  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n    ++  install_dir: perllibdir / 'Git/SVN/Memoize',\n        depends: [git_version_file],\n      )\n\nATB,\nRamsay Jones\n\nRamsay Jones (5):\n  meson.build: quote the GITWEBDIR build configuration\n  meson: correct install location of YAML.pm\n  meson: correct path to system config/attribute files\n  meson.build: correct setting of GIT_EXEC_PATH\n  configure.ac: upgrade to a compilation check for sysinfo\n\n configure.ac                     | 25 ++++++++++++++++++++++---\n meson.build                      | 30 +++++++++++++++++++++++++-----\n meson_options.txt                |  8 ++++----\n perl/Git/SVN/Memoize/meson.build |  2 +-\n 4 files changed, 52 insertions(+), 13 deletions(-)\n\nrange-diff against v2:\n\n1:  1f3d34eafd = 1:  ac97fdc76e meson.build: quote the GITWEBDIR build configuration\n2:  1b7751914a = 2:  181738d371 meson: correct install location of YAML.pm\n3:  a385bbed83 ! 3:  1f4c74973c meson: correct path to system config/attribute files\n    @@ meson.build: libgit_c_args = [\n     +if system_attributes != ''\n     +  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n     +else\n    -+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') + '/gitattributes\"'\n    ++  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') / 'gitattributes\"'\n     +endif\n     +\n     +system_config = get_option('gitconfig')\n     +if system_config != ''\n     +  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n     +else\n    -+  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') + '/gitconfig\"'\n    ++  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') / 'gitconfig\"'\n     +endif\n     +\n      editor_opt = get_option('default_editor')\n    @@ meson_options.txt: option('default_pager', type: 'string', value: 'less',\n      option('default_editor', type: 'string', value: 'vi',\n        description: 'Fall-back editor.')\n     -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n    -+option('gitconfig', type: 'string', # default 'etc/gitconfig'\n    -   description: 'Path to the global git configuration file.')\n    +-  description: 'Path to the global git configuration file.')\n     -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n    +-  description: 'Path to the global git attributes file.')\n    ++option('gitconfig', type: 'string', # default 'etc/gitconfig'\n    ++  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n     +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n    -   description: 'Path to the global git attributes file.')\n    ++  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n      option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n        description: 'Environment used when spawning the pager')\n    + option('perl_cpan_fallback', type: 'boolean', value: true,\n4:  0d00951475 = 4:  97ff1613f5 meson.build: correct setting of GIT_EXEC_PATH\n5:  150e4110d2 ! 5:  983488fe4e configure.ac: upgrade to a compilation check for sysinfo\n    @@ Commit message\n         Commit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\n         cygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\n         build. This check looked for the 'sysinfo()' function itself, rather\n    -    that just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n    +    than just the header, but it will fail (incorrectly set HAVE_SYSINFO)\n         for the same reason.\n     \n         In order to correctly identify the 'sysinfo()' function we require as\n-- \n2.49.0\n\n"},{"id":"518294","messageId":"20250516184843.1524925-2-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 1/5] meson.build: quote the GITWEBDIR build configuration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:39Z","receivedAt":"2025-05-16T18:49:09Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The build configuration options with (non-empty) values, for example\nfilesystem paths potentially containing spaces, have been set using\nthe '.set_quoted()' method. However, the GITWEBDIR value has been\nset using the '.set()' method instead. In order to correctly quote\nthe GITWEBDIR value, replace the '.set()' method with '.set_quoted()'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/meson.build b/meson.build\nindex 270ce933d0..48f31157a0 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -739,7 +739,7 @@ build_options_config.set('GIT_TEST_OPTS', '')\n build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')\n build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n-build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n+build_options_config.set_quoted('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n if get_option('sane_tool_path').length() != 0\n   sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))\n-- \n2.49.0\n\n"},{"id":"518295","messageId":"20250516184843.1524925-3-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 2/5] meson: correct install location of YAML.pm","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:40Z","receivedAt":"2025-05-16T18:49:15Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"When executing an 'meson install' the YAML.pm file is incorrectly\nplaced in the <prefix>/share/perl5/Git/SVN directory. The YAML.pm\nfile should be placed in a 'Memoize' subdirectory instead. In order\nto correct the location, update the 'install_dir' of the relevant\ntarget in the 'perl/Git/SVN/Memoize/meson.build' file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n perl/Git/SVN/Memoize/meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Memoize/meson.build b/perl/Git/SVN/Memoize/meson.build\nindex 233ec670d7..8c2e80d2d2 100644\n--- a/perl/Git/SVN/Memoize/meson.build\n+++ b/perl/Git/SVN/Memoize/meson.build\n@@ -3,6 +3,6 @@ test_dependencies += custom_target(\n   output: 'YAML.pm',\n   command: generate_perl_command,\n   install: true,\n-  install_dir: get_option('datadir') / 'perl5/Git/SVN',\n+  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n   depends: [git_version_file],\n )\n-- \n2.49.0\n\n"},{"id":"518296","messageId":"20250516184843.1524925-4-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:41Z","receivedAt":"2025-05-16T18:49:22Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The path to the system-wide config and attributes files are not being\nset correctly in the meson build. Unless explicitly overridden on the\ncommand line during setup, the 'gitconfig' and 'gitattributes' options\nare defaulting to absolute paths in the '/etc' system directory. This\nis only appropriate if the <prefix> is set specifically to '/usr'.\n\nThe directory in which these files are placed is generally referred to\nas the 'system configuration directory' or 'sysconfdir' for short. When\nthe prefix is '/usr' then the sysconfdir is usually set to '/etc', but\nany other value for prefix results in the relative directory value 'etc'\ninstead. (eg if prefix is '/usr/local', then the 'etc' relative value\nresults in a system configuration directory of '/usr/local/etc'). When\nsetting the 'sysconfdir' builtin option value, the meson system uses\nexactly this algorithm, so we can use get_option('sysconfdir') directly\nwhen setting the (non-overridden) build variables.\n\nIn order to allow for overriding from the command line, remove the\ndefault values specified for the 'gitconfig' and 'gitattributes' options\nin the 'meson_options.txt' file. This allows the user to specify any\npathname for those options, while being able to test for the unset\n(empty) value. An absolute pathname will be used unchanged and a relative\npathname will be appended to '<prefix>/'. These values are then used to\nset the 'ETC_GITCONFIG' and 'ETC_GITATTRIBUTES' build variables which are,\nin turn, passed to the compiler as '-D' arguments.\n\nWhen the 'gitconfig' or 'gitattributes' options are not used, then use\nthe built-in 'sysconfdir' and set the ETC_GITCONFIG build variable to\nthe string \"<sysconfdir>/gitconfig\". Similarly, set ETC_ATTRIBUTES to\n\"<sysconfdir>/gitattributes\".\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build       | 16 ++++++++++++++--\n meson_options.txt |  8 ++++----\n 2 files changed, 18 insertions(+), 6 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 48f31157a0..8e8f228a37 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -757,8 +757,6 @@ endif\n libgit_c_args = [\n   '-DBINDIR=\"' + get_option('bindir') + '\"',\n   '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n-  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n-  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n   '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n   '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n   '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n@@ -769,6 +767,20 @@ libgit_c_args = [\n   '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n ]\n \n+system_attributes = get_option('gitattributes')\n+if system_attributes != ''\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n+else\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') / 'gitattributes\"'\n+endif\n+\n+system_config = get_option('gitconfig')\n+if system_config != ''\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n+else\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') / 'gitconfig\"'\n+endif\n+\n editor_opt = get_option('default_editor')\n if editor_opt != '' and editor_opt != 'vi'\n   libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 8547c0eb47..7a4b896f7e 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -3,10 +3,10 @@ option('default_pager', type: 'string', value: 'less',\n   description: 'Fall-back pager.')\n option('default_editor', type: 'string', value: 'vi',\n   description: 'Fall-back editor.')\n-option('gitconfig', type: 'string', value: '/etc/gitconfig',\n-  description: 'Path to the global git configuration file.')\n-option('gitattributes', type: 'string', value: '/etc/gitattributes',\n-  description: 'Path to the global git attributes file.')\n+option('gitconfig', type: 'string', # default 'etc/gitconfig'\n+  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n+option('gitattributes', type: 'string', # default 'etc/gitattributes'\n+  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n   description: 'Environment used when spawning the pager')\n option('perl_cpan_fallback', type: 'boolean', value: true,\n-- \n2.49.0\n\n"},{"id":"518297","messageId":"20250516184843.1524925-5-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:42Z","receivedAt":"2025-05-16T18:49:30Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"For the non-'runtime prefix' case, the meson build sets the GIT_EXEC_PATH\nbuild variable to an absolute path equivalent to <prefix>/libexec/git-core.\nIn comparison, the default make build sets it to a relative path equivalent\nto 'libexec/git-core'. Indeed, the make build requires the use of some\nmeans outside of the Makefile (eg. config.mak[.*] or the command-line)\nto set GIT_EXEC_PATH to anything other than 'libexec/git-core'.\n\nFor example, the make invocation:\n\n  $ make gitexecdir=/some/other/bin all install\n\nwill build git with GIT_EXEC_PATH set to '/some/other/bin' and install\nthe 'library' executables to that location. However, without setting the\n'gitexecdir' make variable, irrespective of the 'runtime prefix' setting,\nthe GIT_EXEC_PATH is always set to 'libexec/git-core'.\n\nThe meson built-in 'libexecdir' option can be used to provide a similar\nconfigurability. The default value for the option is 'libexec'. Attempting\nto set the option to '' on the command-line, will reset it to the '.'\nstring, presumably to ensure a relative path value.\n\nThis commit allows the meson build, similar to the above, to configure the\nproject like:\n\n  $ meson setup --buildtype=debugoptimized -Dprefix=$HOME -Dpcre2=disabled \\\n      -Dlibexecdir=/some/other/bin build\n\nso that the GIT_EXEC_PATH is set to '/some/other/bin'. Absent the\n-Dlibexecdir argument, the GIT_EXEC_PATH is set to 'libexec/git-core'.\n\nIn order to correct the value of GIT_EXEC_PATH, default the value to the\nstatic string value 'libexec/git-core', and only override if the value\nof the 'libexecdir' option has a value different to 'libexec' or '.'.\nAlso, like the Makefile, add a check for an absolute path when the\nruntime prefix option is true (and if so, error out).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 8e8f228a37..bd14bc15a1 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1592,10 +1592,19 @@ else\n   error('Unsupported CSPRNG backend: ' + csprng_backend)\n endif\n \n+git_exec_path = 'libexec/git-core'\n+libexec = get_option('libexecdir')\n+if libexec != 'libexec' and libexec != '.'\n+  git_exec_path = libexec\n+endif\n+\n if get_option('runtime_prefix')\n   libgit_c_args += '-DRUNTIME_PREFIX'\n   build_options_config.set('RUNTIME_PREFIX', 'true')\n-  git_exec_path = get_option('libexecdir') / 'git-core'\n+\n+  if git_exec_path.startswith('/')\n+    error('runtime_prefix requires a relative libexecdir not:', libexec)\n+  endif\n \n   if compiler.has_header('mach-o/dyld.h')\n     libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'\n@@ -1632,7 +1641,6 @@ if get_option('runtime_prefix')\n   endif\n else\n   build_options_config.set('RUNTIME_PREFIX', 'false')\n-  git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core'\n endif\n libgit_c_args += '-DGIT_EXEC_PATH=\"' + git_exec_path + '\"'\n \n-- \n2.49.0\n\n"},{"id":"518298","messageId":"20250516184843.1524925-6-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v3 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-16T18:48:43Z","receivedAt":"2025-05-16T18:49:35Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Commit f5e3c6c57d (\"meson: do a full usage-based compile check for\nsysinfo\", 2025-04-25) updated the 'sysinfo()' check, as part of the\nmeson build, due to the failure of the check on Solaris. Prior to\nthat commit, the meson build only checked the availability of the\n'<sys/sysinfo.h>' header file. On Solaris, both the header and the\n'sysinfo()' function exist, but are completely unrelated to the same\nfunction on Linux (and cygwin).\n\nCommit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\ncygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\nbuild. This check looked for the 'sysinfo()' function itself, rather\nthan just the header, but it will fail (incorrectly set HAVE_SYSINFO)\nfor the same reason.\n\nIn order to correctly identify the 'sysinfo()' function we require as\npart of 'git-gc' (used in the 'total_ram() function), we also upgrade\nto a compilation check, in a similar way to the meson commit. Note that\nsince commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\nusing sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\nof the 'struct sysinfo' are used, so the new check includes both of\nthose fields in the compile check.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n configure.ac | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex d7e0503f1e..f6caab919a 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1069,9 +1069,28 @@ GIT_CONF_SUBST([CHARSET_LIB])\n \n #\n # Define HAVE_SYSINFO=YesPlease if sysinfo is available.\n-GIT_CHECK_FUNC(sysinfo,\n-\t[HAVE_SYSINFO=YesPlease],\n-\t[HAVE_SYSINFO=])\n+#\n+AC_DEFUN([HAVE_SYSINFO_SRC], [\n+AC_LANG_PROGRAM([[\n+#include <stdint.h>\n+#include <sys/sysinfo.h>\n+]], [[\n+struct sysinfo si;\n+uint64_t t = 0;\n+if (!sysinfo(&si)) {\n+\tt = si.totalram;\n+\tif (si.mem_unit > 1)\n+\t\tt *= (uint64_t)si.mem_unit;\n+}\n+return t;\n+]])])\n+\n+AC_MSG_CHECKING([for sysinfo])\n+AC_COMPILE_IFELSE([HAVE_SYSINFO_SRC],\n+\t[AC_MSG_RESULT([yes])\n+\tHAVE_SYSINFO=YesPlease],\n+\t[AC_MSG_RESULT([no])\n+\tHAVE_SYSINFO=])\n GIT_CONF_SUBST([HAVE_SYSINFO])\n \n #\n-- \n2.49.0\n\n"},{"id":"518391","messageId":"aCrekcz6onTFgEWw@pks.im","threadId":"63423","inReplyTo":"20250516184843.1524925-4-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH v3 3/5] meson: correct path to system config/attribute files","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-05-19T07:32:33Z","receivedAt":"2025-05-19T07:32:39Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, May 16, 2025 at 07:48:41PM +0100, Ramsay Jones wrote:\n> diff --git a/meson_options.txt b/meson_options.txt\n> index 8547c0eb47..7a4b896f7e 100644\n> --- a/meson_options.txt\n> +++ b/meson_options.txt\n> @@ -3,10 +3,10 @@ option('default_pager', type: 'string', value: 'less',\n>    description: 'Fall-back pager.')\n>  option('default_editor', type: 'string', value: 'vi',\n>    description: 'Fall-back editor.')\n> -option('gitconfig', type: 'string', value: '/etc/gitconfig',\n> -  description: 'Path to the global git configuration file.')\n> -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n> -  description: 'Path to the global git attributes file.')\n> +option('gitconfig', type: 'string', # default 'etc/gitconfig'\n> +  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n> +option('gitattributes', type: 'string', # default 'etc/gitattributes'\n> +  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n\nSorry to be nitpicky, but the default information is duplicated. We now\nhave it once as comment and once as description. Other than that this\nversion looks great to me, thanks!\n\nPatrick\n"},{"id":"518431","messageId":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250516184843.1524925-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:18Z","receivedAt":"2025-05-19T16:28:56Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Changes in v4:\n\nPatch #3 changed as a result of Patricks review [+]:\n\n - remove comment showing the default option values for\n   'gitattributes' and 'gitconfig', since this now appears\n   in the description field (ie remove duplicate info).\n\nAgain, I did a test merge to master@cb96e1697a, next@a128411c76\nand seen@df1b4f9cf9. The conflict which showed up in v1 against\nthe 'seen' branch now appears in the 'master' branch and has the\nsame resolution as v1.\n\nNote: the test-suite passes for both 'make test' and 'meson test'\non Linux and 'meson test' on cygwin. (I have already had to wait\n3.5 hours for 'meson test' to run on cygwin, so I will run the\n'make test' later [it takes 6+ hours] and let you know if it fails.\nGiven that the only change from last time is the removal of a comment\nin the 'meson_options.txt' file, the chances of 'make test' failing\nseem to be rather remote - famous last words! ;) ).\n\nA range-diff against v3 is given below.\n\n[+] https://lore.kernel.org/git/aCrekcz6onTFgEWw@pks.im/\n\nChanges in v3:\n\nPatch #3 changed as a result of Patrick's review [*]:\n\n - use the '/' magic string operator when setting the\n   ETC_GIT{CONFIG,ATTRIBUTES} build options.\n - add the default values to the 'description' fields\n   for the 'gitconfig' and 'gitattributes' option\n   definitions\n\nAlso, Junio, the range-diff below shows the typo fixup, but\nyou should find that it doesn't show for you this time. ;)\n\n[yes, I did fix it up locally, but then overwrote it from\nmy cygwin repo ... Ahem! ;) ]\n\nAgain, I did a test merge to master@1a8a4971cc without issue and \nto next@0be31eac6b and seen@d36a872499. The conflict which showed\nup in v1 against the 'seen' branch now appears in 'next' and has\nthe same resolution as v1.\n\nA range-diff against v2 is given below.\n\n[*] https://lore.kernel.org/git/aCbQ9OX2vqF82au8@pks.im/\n\n\nChanges in v2:\n\nPatch #3 is the only one changed (as a result of Patrick's review [0]):\n\n - add some blank lines to make the option handling blocks\n   easier to see.\n - add a comment to 'gitconfig' and 'gitattributes' options\n   to indicate the default values.\n\nNote: The indicated defaults for the 'gitconfig' and 'gitattributes'\nare only valid when the 'prefix' option is defaulted (or not /usr).\nIndicating the 'correct' value when -Dprefix=/usr in the comment\nwould consume too much space. Is this acceptable, or is it too\nconfusing/misleading?\n\nAlso, thanks to Eli for testing patch #5 on Solaris and confirming\nthat it fixes the regression [1].\n\nNote that I did a test merge to master@38af977b81 without issue and\nto next@889b7c5bd8 and seen@d8088176ab. The conflict which showed\nup in v1 against the 'seen' branch now appears in 'next' and has\nthe same resolution as v1.\n\nA range-diff against v1 is given below.\n\n[0] https://lore.kernel.org/git/aB3CDOljn9zJsVwt@pks.im/\n[1] https://lore.kernel.org/git/9baad29d-a5bf-443d-98a1-36d7020e5835@gentoo.org/\n\nv1 cover letter follows:\n\nThis series (part 2) continues the miscellaneous changes to the make,\nmeson and autoconf build systems. I am sending this part a little\nearlier than I expected, so there will now be a part 3!\n\nThe reason for the early posting is to try and avoid an regression in\nthe autoconf build system (see patch #5). Hopefully, we still have time\nin this cycle to get patch #5 included.\n\nThis series is based on commit 6f84262c44 (\"The eleventh batch\", 2025-05-05)\n\nI did a test merge to 'next'@629a3ecd64 without issue, but 'seen'@71cfd25022\nhad a small conflict with commit 1a2929c851 (\"meson: allow customize perl\ninstallation path\", 2025-04-24) on the 'dd/meson-perl-custom-path' branch.\n(I note that a new version of that patch was posted to the list today).\n\nThe fixup looks like:\n\n    diff --cc perl/Git/SVN/Memoize/meson.build\n    index 4c589b30c3,8c2e80d2d2..d6209dc3bf\n    --- a/perl/Git/SVN/Memoize/meson.build\n    +++ b/perl/Git/SVN/Memoize/meson.build\n    @@@ -3,6 -3,6 +3,6 @@@ test_dependencies += custom_target\n        output: 'YAML.pm',\n        command: generate_perl_command,\n        install: true,\n    -   install_dir: perllibdir / 'Git/SVN',\n     -  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n    ++  install_dir: perllibdir / 'Git/SVN/Memoize',\n        depends: [git_version_file],\n      )\n\nATB,\nRamsay Jones\n\nRamsay Jones (5):\n  meson.build: quote the GITWEBDIR build configuration\n  meson: correct install location of YAML.pm\n  meson: correct path to system config/attribute files\n  meson.build: correct setting of GIT_EXEC_PATH\n  configure.ac: upgrade to a compilation check for sysinfo\n\n configure.ac                     | 25 ++++++++++++++++++++++---\n meson.build                      | 30 +++++++++++++++++++++++++-----\n meson_options.txt                |  8 ++++----\n perl/Git/SVN/Memoize/meson.build |  2 +-\n 4 files changed, 52 insertions(+), 13 deletions(-)\n\nrange-diff against v3:\n\n1:  ac97fdc76e = 1:  247bc82c01 meson.build: quote the GITWEBDIR build configuration\n2:  181738d371 = 2:  a87f683a95 meson: correct install location of YAML.pm\n3:  1f4c74973c ! 3:  40ea59efca meson: correct path to system config/attribute files\n    @@ meson_options.txt: option('default_pager', type: 'string', value: 'less',\n     -  description: 'Path to the global git configuration file.')\n     -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n     -  description: 'Path to the global git attributes file.')\n    -+option('gitconfig', type: 'string', # default 'etc/gitconfig'\n    ++option('gitconfig', type: 'string',\n     +  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n    -+option('gitattributes', type: 'string', # default 'etc/gitattributes'\n    ++option('gitattributes', type: 'string',\n     +  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n      option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n        description: 'Environment used when spawning the pager')\n4:  97ff1613f5 = 4:  a7d2f1e132 meson.build: correct setting of GIT_EXEC_PATH\n5:  983488fe4e = 5:  a45b9dc650 configure.ac: upgrade to a compilation check for sysinfo\n\n-- \n2.49.0\n\n"},{"id":"518432","messageId":"20250519162523.1001478-2-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 1/5] meson.build: quote the GITWEBDIR build configuration","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:19Z","receivedAt":"2025-05-19T16:29:01Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The build configuration options with (non-empty) values, for example\nfilesystem paths potentially containing spaces, have been set using\nthe '.set_quoted()' method. However, the GITWEBDIR value has been\nset using the '.set()' method instead. In order to correctly quote\nthe GITWEBDIR value, replace the '.set()' method with '.set_quoted()'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/meson.build b/meson.build\nindex 270ce933d0..48f31157a0 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -739,7 +739,7 @@ build_options_config.set('GIT_TEST_OPTS', '')\n build_options_config.set('GIT_TEST_PERL_FATAL_WARNINGS', '')\n build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_locale'))\n build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))\n-build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n+build_options_config.set_quoted('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))\n \n if get_option('sane_tool_path').length() != 0\n   sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))\n-- \n2.49.0\n\n"},{"id":"518433","messageId":"20250519162523.1001478-3-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 2/5] meson: correct install location of YAML.pm","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:20Z","receivedAt":"2025-05-19T16:29:02Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"When executing an 'meson install' the YAML.pm file is incorrectly\nplaced in the <prefix>/share/perl5/Git/SVN directory. The YAML.pm\nfile should be placed in a 'Memoize' subdirectory instead. In order\nto correct the location, update the 'install_dir' of the relevant\ntarget in the 'perl/Git/SVN/Memoize/meson.build' file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n perl/Git/SVN/Memoize/meson.build | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Memoize/meson.build b/perl/Git/SVN/Memoize/meson.build\nindex 233ec670d7..8c2e80d2d2 100644\n--- a/perl/Git/SVN/Memoize/meson.build\n+++ b/perl/Git/SVN/Memoize/meson.build\n@@ -3,6 +3,6 @@ test_dependencies += custom_target(\n   output: 'YAML.pm',\n   command: generate_perl_command,\n   install: true,\n-  install_dir: get_option('datadir') / 'perl5/Git/SVN',\n+  install_dir: get_option('datadir') / 'perl5/Git/SVN/Memoize',\n   depends: [git_version_file],\n )\n-- \n2.49.0\n\n"},{"id":"518434","messageId":"20250519162523.1001478-4-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 3/5] meson: correct path to system config/attribute files","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:21Z","receivedAt":"2025-05-19T16:29:07Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"The path to the system-wide config and attributes files are not being\nset correctly in the meson build. Unless explicitly overridden on the\ncommand line during setup, the 'gitconfig' and 'gitattributes' options\nare defaulting to absolute paths in the '/etc' system directory. This\nis only appropriate if the <prefix> is set specifically to '/usr'.\n\nThe directory in which these files are placed is generally referred to\nas the 'system configuration directory' or 'sysconfdir' for short. When\nthe prefix is '/usr' then the sysconfdir is usually set to '/etc', but\nany other value for prefix results in the relative directory value 'etc'\ninstead. (eg if prefix is '/usr/local', then the 'etc' relative value\nresults in a system configuration directory of '/usr/local/etc'). When\nsetting the 'sysconfdir' builtin option value, the meson system uses\nexactly this algorithm, so we can use get_option('sysconfdir') directly\nwhen setting the (non-overridden) build variables.\n\nIn order to allow for overriding from the command line, remove the\ndefault values specified for the 'gitconfig' and 'gitattributes' options\nin the 'meson_options.txt' file. This allows the user to specify any\npathname for those options, while being able to test for the unset\n(empty) value. An absolute pathname will be used unchanged and a relative\npathname will be appended to '<prefix>/'. These values are then used to\nset the 'ETC_GITCONFIG' and 'ETC_GITATTRIBUTES' build variables which are,\nin turn, passed to the compiler as '-D' arguments.\n\nWhen the 'gitconfig' or 'gitattributes' options are not used, then use\nthe built-in 'sysconfdir' and set the ETC_GITCONFIG build variable to\nthe string \"<sysconfdir>/gitconfig\". Similarly, set ETC_ATTRIBUTES to\n\"<sysconfdir>/gitattributes\".\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build       | 16 ++++++++++++++--\n meson_options.txt |  8 ++++----\n 2 files changed, 18 insertions(+), 6 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 48f31157a0..8e8f228a37 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -757,8 +757,6 @@ endif\n libgit_c_args = [\n   '-DBINDIR=\"' + get_option('bindir') + '\"',\n   '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n-  '-DETC_GITATTRIBUTES=\"' + get_option('gitattributes') + '\"',\n-  '-DETC_GITCONFIG=\"' + get_option('gitconfig') + '\"',\n   '-DFALLBACK_RUNTIME_PREFIX=\"' + get_option('prefix') + '\"',\n   '-DGIT_HOST_CPU=\"' + host_machine.cpu_family() + '\"',\n   '-DGIT_HTML_PATH=\"' + get_option('datadir') / 'doc/git-doc\"',\n@@ -769,6 +767,20 @@ libgit_c_args = [\n   '-DSHELL_PATH=\"' + fs.as_posix(target_shell.full_path()) + '\"',\n ]\n \n+system_attributes = get_option('gitattributes')\n+if system_attributes != ''\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + system_attributes + '\"'\n+else\n+  libgit_c_args += '-DETC_GITATTRIBUTES=\"' + get_option('sysconfdir') / 'gitattributes\"'\n+endif\n+\n+system_config = get_option('gitconfig')\n+if system_config != ''\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + system_config + '\"'\n+else\n+  libgit_c_args += '-DETC_GITCONFIG=\"' + get_option('sysconfdir') / 'gitconfig\"'\n+endif\n+\n editor_opt = get_option('default_editor')\n if editor_opt != '' and editor_opt != 'vi'\n   libgit_c_args += '-DDEFAULT_EDITOR=\"' + editor_opt + '\"'\ndiff --git a/meson_options.txt b/meson_options.txt\nindex 8547c0eb47..5afbf8ec00 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -3,10 +3,10 @@ option('default_pager', type: 'string', value: 'less',\n   description: 'Fall-back pager.')\n option('default_editor', type: 'string', value: 'vi',\n   description: 'Fall-back editor.')\n-option('gitconfig', type: 'string', value: '/etc/gitconfig',\n-  description: 'Path to the global git configuration file.')\n-option('gitattributes', type: 'string', value: '/etc/gitattributes',\n-  description: 'Path to the global git attributes file.')\n+option('gitconfig', type: 'string',\n+  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n+option('gitattributes', type: 'string',\n+  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n   description: 'Environment used when spawning the pager')\n option('perl_cpan_fallback', type: 'boolean', value: true,\n-- \n2.49.0\n\n"},{"id":"518435","messageId":"20250519162523.1001478-5-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:22Z","receivedAt":"2025-05-19T16:29:12Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"For the non-'runtime prefix' case, the meson build sets the GIT_EXEC_PATH\nbuild variable to an absolute path equivalent to <prefix>/libexec/git-core.\nIn comparison, the default make build sets it to a relative path equivalent\nto 'libexec/git-core'. Indeed, the make build requires the use of some\nmeans outside of the Makefile (eg. config.mak[.*] or the command-line)\nto set GIT_EXEC_PATH to anything other than 'libexec/git-core'.\n\nFor example, the make invocation:\n\n  $ make gitexecdir=/some/other/bin all install\n\nwill build git with GIT_EXEC_PATH set to '/some/other/bin' and install\nthe 'library' executables to that location. However, without setting the\n'gitexecdir' make variable, irrespective of the 'runtime prefix' setting,\nthe GIT_EXEC_PATH is always set to 'libexec/git-core'.\n\nThe meson built-in 'libexecdir' option can be used to provide a similar\nconfigurability. The default value for the option is 'libexec'. Attempting\nto set the option to '' on the command-line, will reset it to the '.'\nstring, presumably to ensure a relative path value.\n\nThis commit allows the meson build, similar to the above, to configure the\nproject like:\n\n  $ meson setup --buildtype=debugoptimized -Dprefix=$HOME -Dpcre2=disabled \\\n      -Dlibexecdir=/some/other/bin build\n\nso that the GIT_EXEC_PATH is set to '/some/other/bin'. Absent the\n-Dlibexecdir argument, the GIT_EXEC_PATH is set to 'libexec/git-core'.\n\nIn order to correct the value of GIT_EXEC_PATH, default the value to the\nstatic string value 'libexec/git-core', and only override if the value\nof the 'libexecdir' option has a value different to 'libexec' or '.'.\nAlso, like the Makefile, add a check for an absolute path when the\nruntime prefix option is true (and if so, error out).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n meson.build | 12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex 8e8f228a37..bd14bc15a1 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -1592,10 +1592,19 @@ else\n   error('Unsupported CSPRNG backend: ' + csprng_backend)\n endif\n \n+git_exec_path = 'libexec/git-core'\n+libexec = get_option('libexecdir')\n+if libexec != 'libexec' and libexec != '.'\n+  git_exec_path = libexec\n+endif\n+\n if get_option('runtime_prefix')\n   libgit_c_args += '-DRUNTIME_PREFIX'\n   build_options_config.set('RUNTIME_PREFIX', 'true')\n-  git_exec_path = get_option('libexecdir') / 'git-core'\n+\n+  if git_exec_path.startswith('/')\n+    error('runtime_prefix requires a relative libexecdir not:', libexec)\n+  endif\n \n   if compiler.has_header('mach-o/dyld.h')\n     libgit_c_args += '-DHAVE_NS_GET_EXECUTABLE_PATH'\n@@ -1632,7 +1641,6 @@ if get_option('runtime_prefix')\n   endif\n else\n   build_options_config.set('RUNTIME_PREFIX', 'false')\n-  git_exec_path = get_option('prefix') / get_option('libexecdir') / 'git-core'\n endif\n libgit_c_args += '-DGIT_EXEC_PATH=\"' + git_exec_path + '\"'\n \n-- \n2.49.0\n\n"},{"id":"518436","messageId":"20250519162523.1001478-6-ramsay@ramsayjones.plus.com","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"[PATCH v4 5/5] configure.ac: upgrade to a compilation check for sysinfo","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T16:25:23Z","receivedAt":"2025-05-19T16:29:18Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Commit f5e3c6c57d (\"meson: do a full usage-based compile check for\nsysinfo\", 2025-04-25) updated the 'sysinfo()' check, as part of the\nmeson build, due to the failure of the check on Solaris. Prior to\nthat commit, the meson build only checked the availability of the\n'<sys/sysinfo.h>' header file. On Solaris, both the header and the\n'sysinfo()' function exist, but are completely unrelated to the same\nfunction on Linux (and cygwin).\n\nCommit 50dec7c566 (\"config.mak.uname: add sysinfo() configuration for\ncygwin\", 2025-04-17) added a similar 'sysinfo()' check to the autoconf\nbuild. This check looked for the 'sysinfo()' function itself, rather\nthan just the header, but it will fail (incorrectly set HAVE_SYSINFO)\nfor the same reason.\n\nIn order to correctly identify the 'sysinfo()' function we require as\npart of 'git-gc' (used in the 'total_ram() function), we also upgrade\nto a compilation check, in a similar way to the meson commit. Note that\nsince commit c9a51775a3 (\"builtin/gc.c: correct RAM calculation when\nusing sysinfo\", 2025-04-17) both the 'totalram' and 'mem_unit' fields\nof the 'struct sysinfo' are used, so the new check includes both of\nthose fields in the compile check.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n configure.ac | 25 ++++++++++++++++++++++---\n 1 file changed, 22 insertions(+), 3 deletions(-)\n\ndiff --git a/configure.ac b/configure.ac\nindex d7e0503f1e..f6caab919a 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -1069,9 +1069,28 @@ GIT_CONF_SUBST([CHARSET_LIB])\n \n #\n # Define HAVE_SYSINFO=YesPlease if sysinfo is available.\n-GIT_CHECK_FUNC(sysinfo,\n-\t[HAVE_SYSINFO=YesPlease],\n-\t[HAVE_SYSINFO=])\n+#\n+AC_DEFUN([HAVE_SYSINFO_SRC], [\n+AC_LANG_PROGRAM([[\n+#include <stdint.h>\n+#include <sys/sysinfo.h>\n+]], [[\n+struct sysinfo si;\n+uint64_t t = 0;\n+if (!sysinfo(&si)) {\n+\tt = si.totalram;\n+\tif (si.mem_unit > 1)\n+\t\tt *= (uint64_t)si.mem_unit;\n+}\n+return t;\n+]])])\n+\n+AC_MSG_CHECKING([for sysinfo])\n+AC_COMPILE_IFELSE([HAVE_SYSINFO_SRC],\n+\t[AC_MSG_RESULT([yes])\n+\tHAVE_SYSINFO=YesPlease],\n+\t[AC_MSG_RESULT([no])\n+\tHAVE_SYSINFO=])\n GIT_CONF_SUBST([HAVE_SYSINFO])\n \n #\n-- \n2.49.0\n\n"},{"id":"518446","messageId":"xmqqo6vomo7y.fsf@gitster.g","threadId":"63423","inReplyTo":"20250519162523.1001478-1-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH v4 0/5] miscellaneous build mods (part 2)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-19T18:48:01Z","receivedAt":"2025-05-19T18:48:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> Again, I did a test merge to master@cb96e1697a, next@a128411c76\n> and seen@df1b4f9cf9. The conflict which showed up in v1 against\n> the 'seen' branch now appears in the 'master' branch and has the\n> same resolution as v1.\n\nThanks.\n\n> A range-diff against v3 is given below.\n>\n> [+] https://lore.kernel.org/git/aCrekcz6onTFgEWw@pks.im/\n>\n> Changes in v3:\n>\n> Patch #3 changed as a result of Patrick's review [*]:\n>\n>  - use the '/' magic string operator when setting the\n>    ETC_GIT{CONFIG,ATTRIBUTES} build options.\n>  - add the default values to the 'description' fields\n>    for the 'gitconfig' and 'gitattributes' option\n>    definitions\n>\n> Also, Junio, the range-diff below shows the typo fixup, but\n> you should find that it doesn't show for you this time. ;)\n\nOK.  And changes in v4 are just that two redundant comments in the\noption definitions are removed, which makes sense looking at the\ndiscussion from the sidelines.\n\nWill queue.  Are we done with this series by now?\n\n> range-diff against v3:\n>\n> 1:  ac97fdc76e = 1:  247bc82c01 meson.build: quote the GITWEBDIR build configuration\n> 2:  181738d371 = 2:  a87f683a95 meson: correct install location of YAML.pm\n> 3:  1f4c74973c ! 3:  40ea59efca meson: correct path to system config/attribute files\n>     @@ meson_options.txt: option('default_pager', type: 'string', value: 'less',\n>      -  description: 'Path to the global git configuration file.')\n>      -option('gitattributes', type: 'string', value: '/etc/gitattributes',\n>      -  description: 'Path to the global git attributes file.')\n>     -+option('gitconfig', type: 'string', # default 'etc/gitconfig'\n>     ++option('gitconfig', type: 'string',\n>      +  description: 'Path to the global git configuration file. (default: etc/gitconfig)')\n>     -+option('gitattributes', type: 'string', # default 'etc/gitattributes'\n>     ++option('gitattributes', type: 'string',\n>      +  description: 'Path to the global git attributes file. (default: etc/gitattributes)')\n>       option('pager_environment', type: 'string', value: 'LESS=FRX LV=-c',\n>         description: 'Environment used when spawning the pager')\n> 4:  97ff1613f5 = 4:  a7d2f1e132 meson.build: correct setting of GIT_EXEC_PATH\n> 5:  983488fe4e = 5:  a45b9dc650 configure.ac: upgrade to a compilation check for sysinfo\n"},{"id":"518447","messageId":"aCuBtP8-NmB0lKo-@pks.im","threadId":"63423","inReplyTo":"xmqqo6vomo7y.fsf@gitster.g","subject":"Re: [PATCH v4 0/5] miscellaneous build mods (part 2)","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-05-19T19:08:36Z","receivedAt":"2025-05-19T19:08:43Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, May 19, 2025 at 11:48:01AM -0700, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n> > Again, I did a test merge to master@cb96e1697a, next@a128411c76\n> > and seen@df1b4f9cf9. The conflict which showed up in v1 against\n> > the 'seen' branch now appears in the 'master' branch and has the\n> > same resolution as v1.\n> \n> Thanks.\n> \n> > A range-diff against v3 is given below.\n> >\n> > [+] https://lore.kernel.org/git/aCrekcz6onTFgEWw@pks.im/\n> >\n> > Changes in v3:\n> >\n> > Patch #3 changed as a result of Patrick's review [*]:\n> >\n> >  - use the '/' magic string operator when setting the\n> >    ETC_GIT{CONFIG,ATTRIBUTES} build options.\n> >  - add the default values to the 'description' fields\n> >    for the 'gitconfig' and 'gitattributes' option\n> >    definitions\n> >\n> > Also, Junio, the range-diff below shows the typo fixup, but\n> > you should find that it doesn't show for you this time. ;)\n> \n> OK.  And changes in v4 are just that two redundant comments in the\n> option definitions are removed, which makes sense looking at the\n> discussion from the sidelines.\n> \n> Will queue.  Are we done with this series by now?\n\nYup, the range diff looks as expected, so this is ready to go from my\npoint of view. Thanks!\n\nPatrick\n"},{"id":"518454","messageId":"b5d5953a-1b1d-4e0d-a908-07c569fa59d2@ramsayjones.plus.com","threadId":"63423","inReplyTo":"aCuBtP8-NmB0lKo-@pks.im","subject":"Re: [PATCH v4 0/5] miscellaneous build mods (part 2)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-05-19T22:42:24Z","receivedAt":"2025-05-19T22:42:35Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 19/05/2025 20:08, Patrick Steinhardt wrote:\n> On Mon, May 19, 2025 at 11:48:01AM -0700, Junio C Hamano wrote:\n>> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n>>\n>>> Again, I did a test merge to master@cb96e1697a, next@a128411c76\n>>> and seen@df1b4f9cf9. The conflict which showed up in v1 against\n>>> the 'seen' branch now appears in the 'master' branch and has the\n>>> same resolution as v1.\n>>\n>> Thanks.\n>>\n>>> A range-diff against v3 is given below.\n>>>\n>>> [+] https://lore.kernel.org/git/aCrekcz6onTFgEWw@pks.im/\n>>>\n>>> Changes in v3:\n>>>\n>>> Patch #3 changed as a result of Patrick's review [*]:\n>>>\n>>>  - use the '/' magic string operator when setting the\n>>>    ETC_GIT{CONFIG,ATTRIBUTES} build options.\n>>>  - add the default values to the 'description' fields\n>>>    for the 'gitconfig' and 'gitattributes' option\n>>>    definitions\n>>>\n>>> Also, Junio, the range-diff below shows the typo fixup, but\n>>> you should find that it doesn't show for you this time. ;)\n>>\n>> OK.  And changes in v4 are just that two redundant comments in the\n>> option definitions are removed, which makes sense looking at the\n>> discussion from the sidelines.\n>>\n>> Will queue.  Are we done with this series by now?\n> \n> Yup, the range diff looks as expected, so this is ready to go from my\n> point of view. Thanks!\n\nYes, I think we're good to go.\n\nAlso, the 'make test' on cygwin just finished and passed without issue! :)\n\nThanks.\n\nATB,\nRamsay Jones\n\n\n"},{"id":"518455","messageId":"xmqqy0uskxwv.fsf@gitster.g","threadId":"63423","inReplyTo":"b5d5953a-1b1d-4e0d-a908-07c569fa59d2@ramsayjones.plus.com","subject":"Re: [PATCH v4 0/5] miscellaneous build mods (part 2)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-19T23:01:36Z","receivedAt":"2025-05-19T23:01:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n>>> Will queue.  Are we done with this series by now?\n>> \n>> Yup, the range diff looks as expected, so this is ready to go from my\n>> point of view. Thanks!\n>\n> Yes, I think we're good to go.\n>\n> Also, the 'make test' on cygwin just finished and passed without issue! :)\n>\n> Thanks.\n\nThank you, all!\n\n"},{"id":"520297","messageId":"66fd343a-1351-4350-83eb-c797e47b7693@gmail.com","threadId":"63423","inReplyTo":"20250513191739.1513460-5-ramsay@ramsayjones.plus.com","subject":"Re: [PATCH v2 4/5] meson.build: correct setting of GIT_EXEC_PATH","fromName":"","fromEmail":"irecca.kun@gmail.com","sentAt":"2025-06-16T22:08:32Z","receivedAt":"2025-06-16T22:08:35Z","isPatch":true,"sender":{"key":"irecca.kun@gmail.com","avatar":null},"body":"This completely breaks meson builds with 'libexecdir' set. Git can not find any helper tools because 'git_exec_path' is set incorrectly.\n\nIt supposed to be:\n\n--- meson.build\n+++ meson.build\n@@ -1597,7 +1597,7 @@\n  git_exec_path = 'libexec/git-core'\n  libexec = get_option('libexecdir')\n  if libexec != 'libexec' and libexec != '.'\n-  git_exec_path = libexec\n+  git_exec_path = libexec / 'git-core'\n  endif\n  \n  if get_option('runtime_prefix')\n\n"}]}