{"thread":{"id":"55839","subject":"[PATCH 1/3] cmake: add knob to disable vcpkg","startedAt":"2021-06-04T17:43:41Z","lastAt":"2021-06-22T22:32:43Z","messageCount":31,"participants":["Matthew Rogers via GitGitGadget","Eric Sunshine","Matt Rogers","Sibi Siddharthan","Bagas Sanjaya","Junio C Hamano","Johannes Schindelin","Philip Oakley"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"426423","messageId":"3170f78daa5fa89f04f61e24c9c64c93ea5b394f.1622828605.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.git.1622828605.gitgitgadget@gmail.com","subject":"[PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-04T17:43:23Z","receivedAt":"2021-06-04T17:43:41Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nWhen building on windows users have the option to use vcpkg to provide\nthe dependencies needed to compile.  Previously, this was used only when\nusing the Visual Studio generator which was not ideal because:\n\n  - Not all users who want to use vcpkg use the Visual Studio\n    generators.\n\n  - Some versions of Visual Studio 2019 moved away from using the\n    VS 2019 by default, making it impossible for Visual Studio to\n    configure the project in the likely event that it couldn't find the\n    dependencies.\n\n  - Inexperienced users of CMake are very likely to get tripped up by\n    the errors caused by a lack of vcpkg, making the above bullet point\n    both annoying and hard to debug.\n\nAs such, lets make using vcpkg the default on windows.  Users who want\nto avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++++++----\n 1 file changed, 16 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex a87841340e6a..41320150bf66 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -43,14 +43,24 @@ NOTE: By default CMake uses Makefile as the build tool on Linux and Visual Studi\n to use another tool say `ninja` add this to the command line when configuring.\n `-G Ninja`\n \n+NOTE: By default CMake will install vcpkg locally to your source tree on configuration,\n+to avoid this, add `-DNO_VCPKG=TRUE` to the command line when configuring.\n+\n ]]\n cmake_minimum_required(VERSION 3.14)\n \n #set the source directory to root of git\n set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)\n-if(WIN32)\n+\n+if (WIN32 AND NOT NO_VCPKG)\n+\tset(USING_VCPKG TRUE)\n+else()\n+\tset(USING_VCPKG FALSE)\n+endif()\n+\n+if(USING_VCPKG)\n \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n-\tif(MSVC AND NOT EXISTS ${VCPKG_DIR})\n+\tif(NOT EXISTS ${VCPKG_DIR})\n \t\tmessage(\"Initializing vcpkg and building the Git's dependencies (this will take a while...)\")\n \t\texecute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)\n \tendif()\n@@ -178,7 +188,9 @@ endif()\n \n find_program(MSGFMT_EXE msgfmt)\n if(NOT MSGFMT_EXE)\n-\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\tif (USING_VCPKG)\n+\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\tendif()\n \tif(NOT EXISTS ${MSGFMT_EXE})\n \t\tmessage(WARNING \"Text Translations won't be built\")\n \t\tunset(MSGFMT_EXE)\n@@ -982,7 +994,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\"\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"RUNTIME_PREFIX='${RUNTIME_PREFIX}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n-if(WIN32)\n+if(USING_VCPKG)\n \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n endif()\n \n-- \ngitgitgadget\n\n"},{"id":"426424","messageId":"pull.970.git.1622828605.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":null,"subject":"[PATCH 0/3] Make CMake work out of the box","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-04T17:43:22Z","receivedAt":"2021-06-04T17:44:29Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"This pull request comes from our discussion here[1], and I think these\npatches provide a good compromise around the concerns discussed there\n\n1:\nhttps://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n\nCCing the people involved in the original discussion.\n\nMatthew Rogers (3):\n  cmake: add knob to disable vcpkg\n  cmake: create compile_commands.json by default\n  cmake: add warning for ignored MSGFMT_EXE\n\n contrib/buildsystems/CMakeLists.txt | 38 ++++++++++++++++++++++-------\n 1 file changed, 29 insertions(+), 9 deletions(-)\n\n\nbase-commit: c09b6306c6ca275ed9d0348a8c8014b2ff723cfb\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-970%2FROGERSM94%2Ffix-cmake-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-970/ROGERSM94/fix-cmake-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/970\n-- \ngitgitgadget\n"},{"id":"426425","messageId":"07763a9de723af8674b707ba762845fd414bd0a6.1622828605.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.git.1622828605.gitgitgadget@gmail.com","subject":"[PATCH 3/3] cmake: add warning for ignored MSGFMT_EXE","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-04T17:43:25Z","receivedAt":"2021-06-04T17:44:30Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nIt does not make sense to attempt to set MSGFMT_EXE when NO_GETTEXT is\nconfigured, as such add a check for NO_GETTEXT before attempting to set\nit.\n\nsuggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 99150c8f5853..ea43a4f9cc9f 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -190,14 +190,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds\n \tendif()\n endif()\n \n-find_program(MSGFMT_EXE msgfmt)\n-if(NOT MSGFMT_EXE)\n-\tif (USING_VCPKG)\n-\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n-\tendif()\n-\tif(NOT EXISTS ${MSGFMT_EXE})\n-\t\tmessage(WARNING \"Text Translations won't be built\")\n-\t\tunset(MSGFMT_EXE)\n+if(NO_GETTEXT)\n+\tmessage(STATUS \"msgfmt not used under NO_GETTEXT\")\n+else()\n+\tfind_program(MSGFMT_EXE msgfmt)\n+\tif(NOT MSGFMT_EXE)\n+\t\tif (USING_VCPKG)\n+\t\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\t\tendif()\n+\t\tif(NOT EXISTS ${MSGFMT_EXE})\n+\t\t\tmessage(WARNING \"Text Translations won't be built\")\n+\t\t\tunset(MSGFMT_EXE)\n+\t\tendif()\n \tendif()\n endif()\n \n-- \ngitgitgadget\n"},{"id":"426426","messageId":"c3bf266cf03a9678933623b48927ee749956218d.1622828605.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.git.1622828605.gitgitgadget@gmail.com","subject":"[PATCH 2/3] cmake: create compile_commands.json by default","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-04T17:43:24Z","receivedAt":"2021-06-04T17:44:44Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nSome users have expressed interest in a more \"batteries included\" way of\nbuilding via CMake[1], and a big part of that is providing easier access\nto tooling external tools.\n\nA straightforward way to accomplish this is to make it as simple as\npossible is to enable the generation of the compile_commands.json file,\nwhich is supported by many tools such as: clang-tidy, clang-format,\nsourcetrail, etc.\n\nThis does come with a small run-time overhead during the configuration\nstep (~6 seconds on my machine):\n\n    Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE\n\n    real    1m9.840s\n    user    0m0.031s\n    sys     0m0.031s\n\n    Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE\n\n    real    1m3.195s\n    user    0m0.015s\n    sys     0m0.015s\n\nThis seems like a small enough price to pay to make the project more\naccessible to newer users.  Additionally there are other large projects\nlike llvm [2] which has had this enabled by default for >6 years at the\ntime of this writing, and no real negative consequences that I can find\nwith my search-skills.\n\nNOTE: That the comppile_commands.json is currenntly produced only when\nusing the Ninja and Makefile generators.  See The CMake documentation[3]\nfor more info.\n\n1: https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n2: https://github.com/llvm/llvm-project/commit/2c5712051b31b316a9fc972f692579bd8efa6e67\n3: https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html\n\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 41320150bf66..99150c8f5853 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -58,6 +58,10 @@ else()\n \tset(USING_VCPKG FALSE)\n endif()\n \n+if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n+\tSET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n+endif()\n+\n if(USING_VCPKG)\n \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n \tif(NOT EXISTS ${VCPKG_DIR})\n-- \ngitgitgadget\n\n"},{"id":"426427","messageId":"CAPig+cRBQYbhPbvGvEcmqUFmXM4yysRnWam=Sx_Lr8uWbEZVMg@mail.gmail.com","threadId":"55839","inReplyTo":"3170f78daa5fa89f04f61e24c9c64c93ea5b394f.1622828605.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-06-04T18:03:16Z","receivedAt":"2021-06-04T18:03:29Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 4, 2021 at 1:44 PM Matthew Rogers via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> When building on windows users have the option to use vcpkg to provide\n> the dependencies needed to compile.  Previously, this was used only when\n> using the Visual Studio generator which was not ideal because:\n>\n>   - Not all users who want to use vcpkg use the Visual Studio\n>     generators.\n>\n>   - Some versions of Visual Studio 2019 moved away from using the\n>     VS 2019 by default, making it impossible for Visual Studio to\n>     configure the project in the likely event that it couldn't find the\n>     dependencies.\n\nIs there something missing between \"using the\" and \"VS 2019\"? I'm\nhaving a hard time trying to understand what this bullet point is\nsaying due to this apparent gap.\n\n>   - Inexperienced users of CMake are very likely to get tripped up by\n>     the errors caused by a lack of vcpkg, making the above bullet point\n>     both annoying and hard to debug.\n>\n> As such, lets make using vcpkg the default on windows.  Users who want\n> to avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n\ns/lets/let's/\n\n> Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n"},{"id":"426428","messageId":"CAPig+cS3SQTP=49jHxEuMahwqdCstD7Qgck2Oxkc35ZJkj_eYA@mail.gmail.com","threadId":"55839","inReplyTo":"c3bf266cf03a9678933623b48927ee749956218d.1622828605.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/3] cmake: create compile_commands.json by default","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-06-04T18:05:44Z","receivedAt":"2021-06-04T18:05:59Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 4, 2021 at 1:44 PM Matthew Rogers via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> Some users have expressed interest in a more \"batteries included\" way of\n> building via CMake[1], and a big part of that is providing easier access\n> to tooling external tools.\n>\n> A straightforward way to accomplish this is to make it as simple as\n> possible is to enable the generation of the compile_commands.json file,\n> which is supported by many tools such as: clang-tidy, clang-format,\n> sourcetrail, etc.\n>\n> This does come with a small run-time overhead during the configuration\n> step (~6 seconds on my machine):\n>     [...]\n> This seems like a small enough price to pay to make the project more\n> accessible to newer users.  Additionally there are other large projects\n> like llvm [2] which has had this enabled by default for >6 years at the\n> time of this writing, and no real negative consequences that I can find\n> with my search-skills.\n>\n> NOTE: That the comppile_commands.json is currenntly produced only when\n> using the Ninja and Makefile generators.  See The CMake documentation[3]\n> for more info.\n\ns/comppile/compile/\ns/currenntly/currently/\n\n> Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n"},{"id":"426429","messageId":"CAPig+cQkR2LRmgHDz13-Cc0ohihJgsRAjGMnMagSbKh5QHLL5A@mail.gmail.com","threadId":"55839","inReplyTo":"07763a9de723af8674b707ba762845fd414bd0a6.1622828605.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 3/3] cmake: add warning for ignored MSGFMT_EXE","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-06-04T18:10:08Z","receivedAt":"2021-06-04T18:10:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 4, 2021 at 1:44 PM Matthew Rogers via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n> It does not make sense to attempt to set MSGFMT_EXE when NO_GETTEXT is\n> configured, as such add a check for NO_GETTEXT before attempting to set\n> it.\n\nThis would be easier to digest if \"as such\" is the start of a new\nsentence: \"As such...\". Or \"Therefore, add a check...\".\n\n> suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n\ns/suggested-by/Suggested-by:/\n\nTiny little nits, both. Don't know if it's worth a re-roll, but if you\nhappen to re-roll for some other reason, perhaps these could be\ntweaked.\n"},{"id":"426430","messageId":"CAOjrSZuO14F2ShmfYeTdf39YOhWDJWFm2PQtXR5abJh5FsigYw@mail.gmail.com","threadId":"55839","inReplyTo":"CAPig+cRBQYbhPbvGvEcmqUFmXM4yysRnWam=Sx_Lr8uWbEZVMg@mail.gmail.com","subject":"Re: [PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2021-06-04T18:34:08Z","receivedAt":"2021-06-04T18:34:40Z","isPatch":true,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jun 4, 2021 at 2:03 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n>\n> On Fri, Jun 4, 2021 at 1:44 PM Matthew Rogers via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n> > When building on windows users have the option to use vcpkg to provide\n> > the dependencies needed to compile.  Previously, this was used only when\n> > using the Visual Studio generator which was not ideal because:\n> >\n> >   - Not all users who want to use vcpkg use the Visual Studio\n> >     generators.\n> >\n> >   - Some versions of Visual Studio 2019 moved away from using the\n> >     VS 2019 by default, making it impossible for Visual Studio to\n> >     configure the project in the likely event that it couldn't find the\n> >     dependencies.\n>\n> Is there something missing between \"using the\" and \"VS 2019\"? I'm\n> having a hard time trying to understand what this bullet point is\n> saying due to this apparent gap.\n>\n\nYeah, this should really read\n- Some versions of Visual Studio 2019 moved away from using the\n     VS 2019 _Generator_ by default, making it impossible for Visual Studio to\n     configure the project in the likely event that it couldn't find the\n     dependencies.\n\n\n> >   - Inexperienced users of CMake are very likely to get tripped up by\n> >     the errors caused by a lack of vcpkg, making the above bullet point\n> >     both annoying and hard to debug.\n> >\n> > As such, lets make using vcpkg the default on windows.  Users who want\n> > to avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n>\n> s/lets/let's/\n>\n> > Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n\n\n\n-- \nMatthew Rogers\n"},{"id":"426440","messageId":"CAKiG+9UT+B-kFiY7sA8ZedB31xYARbFgSFwQRzktww_S2B_tfA@mail.gmail.com","threadId":"55839","inReplyTo":"3170f78daa5fa89f04f61e24c9c64c93ea5b394f.1622828605.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Sibi Siddharthan","fromEmail":"sibisiddharthan.github@gmail.com","sentAt":"2021-06-04T20:55:35Z","receivedAt":"2021-06-04T20:56:49Z","isPatch":true,"sender":{"key":"sibisiddharthan.github@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44207430?v=4"},"body":"On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n\n> -if(WIN32)\n> +\n> +if (WIN32 AND NOT NO_VCPKG)\n> +       set(USING_VCPKG TRUE)\n> +else()\n> +       set(USING_VCPKG FALSE)\n> +endif()\n\nI think it would be better if we could have an option for this knob.\nMaybe like this\n\noption(NO_VCPKG \"Don't use vcpkg for obtaining dependencies. Only\napplicable to Windows platforms\" OFF)\n\nI would prefer to use `USE_VCPKG`.\n\nThank You,\nSibi Siddharthan\n"},{"id":"426441","messageId":"CAKiG+9W8Da4bG87VjTKN6m=cX+v_x33YAw8p4MqCfmNinYt1XA@mail.gmail.com","threadId":"55839","inReplyTo":"c3bf266cf03a9678933623b48927ee749956218d.1622828605.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/3] cmake: create compile_commands.json by default","fromName":"Sibi Siddharthan","fromEmail":"sibisiddharthan.github@gmail.com","sentAt":"2021-06-04T21:09:07Z","receivedAt":"2021-06-04T21:09:25Z","isPatch":true,"sender":{"key":"sibisiddharthan.github@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44207430?v=4"},"body":"On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n>\n> A straightforward way to accomplish this is to make it as simple as\n> possible is to enable the generation of the compile_commands.json file,\n> which is supported by many tools such as: clang-tidy, clang-format,\n> sourcetrail, etc.\n>\n> This does come with a small run-time overhead during the configuration\n> step (~6 seconds on my machine):\n>\n>     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE\n>\n>     real    1m9.840s\n>     user    0m0.031s\n>     sys     0m0.031s\n>\n>     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE\n>\n>     real    1m3.195s\n>     user    0m0.015s\n>     sys     0m0.015s\n>\n> This seems like a small enough price to pay to make the project more\n> accessible to newer users.  Additionally there are other large projects\n> like llvm [2] which has had this enabled by default for >6 years at the\n> time of this writing, and no real negative consequences that I can find\n> with my search-skills.\n>\n\nThe overhead is actually much smaller than that. In my system it is\nless than 150ms.\nThe first configure takes this long because we generate command-list.h\nand config-list.h.\nThis process is really slow under Windows.\n\nThank You,\nSibi Siddharthan\n"},{"id":"426465","messageId":"6a9150ca-5c1a-1874-5f8b-35187f197d47@gmail.com","threadId":"55839","inReplyTo":"pull.970.git.1622828605.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-06-05T03:40:50Z","receivedAt":"2021-06-05T03:41:12Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Hi,\n\nOn 05/06/21 00.43, Matthew Rogers via GitGitGadget wrote:\n> This pull request comes from our discussion here[1], and I think these\n> patches provide a good compromise around the concerns discussed there\n> \n> 1:\n> https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n> \n> CCing the people involved in the original discussion.\n\nThis focused on improving CMake support, especially on Visual Studio, right?\n\nThen so we have three ways to build Git:\n1. plain Makefile\n2. ./configure (really just wrapper on top of Makefile)\n3. generate build file with CMake\n\nIf we want to support all of them, it may makes sense to have CI jobs \nthat perform build with each options above.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"426509","messageId":"CAOjrSZv9h09y-=KVz8UGZaB0r5MHRqFZJjp0VDFX6fnohoFx9Q@mail.gmail.com","threadId":"55839","inReplyTo":"CAKiG+9UT+B-kFiY7sA8ZedB31xYARbFgSFwQRzktww_S2B_tfA@mail.gmail.com","subject":"Re: [PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2021-06-05T22:30:53Z","receivedAt":"2021-06-05T22:32:05Z","isPatch":true,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jun 4, 2021 at 4:55 PM Sibi Siddharthan\n<sibisiddharthan.github@gmail.com> wrote:\n>\n> On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n>\n> > -if(WIN32)\n> > +\n> > +if (WIN32 AND NOT NO_VCPKG)\n> > +       set(USING_VCPKG TRUE)\n> > +else()\n> > +       set(USING_VCPKG FALSE)\n> > +endif()\n>\n> I think it would be better if we could have an option for this knob.\n> Maybe like this\n>\n> option(NO_VCPKG \"Don't use vcpkg for obtaining dependencies. Only\n> applicable to Windows platforms\" OFF)\n\nOption would definitely be the better tool to use here, I just didn't\nthink about\nit when originally writing it, so I'll send a reroll with that and the spelling\ncorrections suggested by Eric Sunshine.  I assume you'd prefer something\nwith a final form more like:\n\noption(USE_VCPKG \"Whether or not to use vcpkg for obtaining dependencies.\nOnly applicable to Windows platforms\" ON)\n\n\n>\n> I would prefer to use `USE_VCPKG`.\n>\n> Thank You,\n> Sibi Siddharthan\n\n\n\n-- \nMatthew Rogers\n"},{"id":"426511","messageId":"CAOjrSZsyUi+RAqxXyd6JqzWqO8hMdtwTuWpZy+cKbz654Xu45A@mail.gmail.com","threadId":"55839","inReplyTo":"CAKiG+9W8Da4bG87VjTKN6m=cX+v_x33YAw8p4MqCfmNinYt1XA@mail.gmail.com","subject":"Re: [PATCH 2/3] cmake: create compile_commands.json by default","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2021-06-05T22:36:05Z","receivedAt":"2021-06-05T22:36:17Z","isPatch":true,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jun 4, 2021 at 5:09 PM Sibi Siddharthan\n<sibisiddharthan.github@gmail.com> wrote:\n>\n> On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n> <gitgitgadget@gmail.com> wrote:\n> >\n> > A straightforward way to accomplish this is to make it as simple as\n> > possible is to enable the generation of the compile_commands.json file,\n> > which is supported by many tools such as: clang-tidy, clang-format,\n> > sourcetrail, etc.\n> >\n> > This does come with a small run-time overhead during the configuration\n> > step (~6 seconds on my machine):\n> >\n> >     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE\n> >\n> >     real    1m9.840s\n> >     user    0m0.031s\n> >     sys     0m0.031s\n> >\n> >     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE\n> >\n> >     real    1m3.195s\n> >     user    0m0.015s\n> >     sys     0m0.015s\n> >\n> > This seems like a small enough price to pay to make the project more\n> > accessible to newer users.  Additionally there are other large projects\n> > like llvm [2] which has had this enabled by default for >6 years at the\n> > time of this writing, and no real negative consequences that I can find\n> > with my search-skills.\n> >\n>\n> The overhead is actually much smaller than that. In my system it is\n> less than 150ms.\n\nIs that 150 ms for the whole process or just the difference between the two\noptions?  I'm running this on windows via the git bash provided by the\ngit sdk.\n\n> The first configure takes this long because we generate command-list.h\n> and config-list.h.\n> This process is really slow under Windows.\n>\n\nI used two different build directories for both my invocations specifically\nto avoid having to account for cache variables and other side effects\nfrom earlier configurations.  The variation could also be from network\nlatency since in this test I was downloading vcpkg, etc.\n\n> Thank You,\n> Sibi Siddharthan\n\n\n\n-- \nMatthew Rogers\n"},{"id":"426512","messageId":"CAOjrSZueB46DgwX7Aymdr=KgzG52kHiEQ52z2q5vczaF9jtedw@mail.gmail.com","threadId":"55839","inReplyTo":"6a9150ca-5c1a-1874-5f8b-35187f197d47@gmail.com","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2021-06-05T23:22:18Z","receivedAt":"2021-06-05T23:23:39Z","isPatch":true,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jun 4, 2021 at 11:40 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n>\n> Hi,\n>\n> On 05/06/21 00.43, Matthew Rogers via GitGitGadget wrote:\n> > This pull request comes from our discussion here[1], and I think these\n> > patches provide a good compromise around the concerns discussed there\n> >\n> > 1:\n> > https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n> >\n> > CCing the people involved in the original discussion.\n>\n> This focused on improving CMake support, especially on Visual Studio, right?\n>\n> Then so we have three ways to build Git:\n> 1. plain Makefile\n> 2. ./configure (really just wrapper on top of Makefile)\n> 3. generate build file with CMake\n>\n> If we want to support all of them, it may makes sense to have CI jobs\n> that perform build with each options above.\n>\n> --\n> An old man doll... just what I always wanted! - Clara\n\nHere's my understanding of the current pipeline situation:\n\nI know the Visual Studio CMake generator is currently used to build on\nWindows for gitgitgadget[1].\n\nI'm not sure how worth it it would be to add another pipeline just to test if\nwe correctly set EXPORT_COMPILE_COMMANDS=TRUE on by default\ncorrectly.\n\nI think adding support for running cmake builds on linux is a bit of a waste\nsince those platforms should have ready access to make, and that's the build\nmethod that gets the official support.\n\nI don't really have much more of a position on this other than \"Probably not\nworth it to add a cmake build on linux\"\n\n1: https://github.com/gitgitgadget/git/runs/2748313673\n\n--\nMatthew Rogers\n"},{"id":"426520","messageId":"CAKiG+9UPBDVVH+2TnfYU6VoTdB1UFoVP=M_D+9H1e=k5+s7vfA@mail.gmail.com","threadId":"55839","inReplyTo":"CAOjrSZv9h09y-=KVz8UGZaB0r5MHRqFZJjp0VDFX6fnohoFx9Q@mail.gmail.com","subject":"Re: [PATCH 1/3] cmake: add knob to disable vcpkg","fromName":"Sibi Siddharthan","fromEmail":"sibisiddharthan.github@gmail.com","sentAt":"2021-06-06T04:33:11Z","receivedAt":"2021-06-06T04:33:26Z","isPatch":true,"sender":{"key":"sibisiddharthan.github@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44207430?v=4"},"body":"On Sun, Jun 6, 2021 at 4:01 AM Matt Rogers <mattr94@gmail.com> wrote:\n>\n> On Fri, Jun 4, 2021 at 4:55 PM Sibi Siddharthan\n> <sibisiddharthan.github@gmail.com> wrote:\n> >\n> > On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n> > <gitgitgadget@gmail.com> wrote:\n> >\n> > > -if(WIN32)\n> > > +\n> > > +if (WIN32 AND NOT NO_VCPKG)\n> > > +       set(USING_VCPKG TRUE)\n> > > +else()\n> > > +       set(USING_VCPKG FALSE)\n> > > +endif()\n> >\n> > I think it would be better if we could have an option for this knob.\n> > Maybe like this\n> >\n> > option(NO_VCPKG \"Don't use vcpkg for obtaining dependencies. Only\n> > applicable to Windows platforms\" OFF)\n>\n> Option would definitely be the better tool to use here, I just didn't\n> think about\n> it when originally writing it, so I'll send a reroll with that and the spelling\n> corrections suggested by Eric Sunshine.  I assume you'd prefer something\n> with a final form more like:\n>\n> option(USE_VCPKG \"Whether or not to use vcpkg for obtaining dependencies.\n> Only applicable to Windows platforms\" ON)\n>\n\nYes, this would be better.\n\nThank You,\nSibi Siddharthan\n"},{"id":"426521","messageId":"CAKiG+9U2tXu+k+oEx-fx9tjTYEdrL_Nf3Cxk14=ik1Ji8ZUehg@mail.gmail.com","threadId":"55839","inReplyTo":"CAOjrSZsyUi+RAqxXyd6JqzWqO8hMdtwTuWpZy+cKbz654Xu45A@mail.gmail.com","subject":"Re: [PATCH 2/3] cmake: create compile_commands.json by default","fromName":"Sibi Siddharthan","fromEmail":"sibisiddharthan.github@gmail.com","sentAt":"2021-06-06T04:39:38Z","receivedAt":"2021-06-06T04:40:06Z","isPatch":true,"sender":{"key":"sibisiddharthan.github@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44207430?v=4"},"body":"On Sun, Jun 6, 2021 at 4:06 AM Matt Rogers <mattr94@gmail.com> wrote:\n>\n> On Fri, Jun 4, 2021 at 5:09 PM Sibi Siddharthan\n> <sibisiddharthan.github@gmail.com> wrote:\n> >\n> > On Fri, Jun 4, 2021 at 11:13 PM Matthew Rogers via GitGitGadget\n> > <gitgitgadget@gmail.com> wrote:\n> > >\n> > > A straightforward way to accomplish this is to make it as simple as\n> > > possible is to enable the generation of the compile_commands.json file,\n> > > which is supported by many tools such as: clang-tidy, clang-format,\n> > > sourcetrail, etc.\n> > >\n> > > This does come with a small run-time overhead during the configuration\n> > > step (~6 seconds on my machine):\n> > >\n> > >     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE\n> > >\n> > >     real    1m9.840s\n> > >     user    0m0.031s\n> > >     sys     0m0.031s\n> > >\n> > >     Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE\n> > >\n> > >     real    1m3.195s\n> > >     user    0m0.015s\n> > >     sys     0m0.015s\n> > >\n> > > This seems like a small enough price to pay to make the project more\n> > > accessible to newer users.  Additionally there are other large projects\n> > > like llvm [2] which has had this enabled by default for >6 years at the\n> > > time of this writing, and no real negative consequences that I can find\n> > > with my search-skills.\n> > >\n> >\n> > The overhead is actually much smaller than that. In my system it is\n> > less than 150ms.\n>\n> Is that 150 ms for the whole process or just the difference between the two\n> options?  I'm running this on windows via the git bash provided by the\n> git sdk.\n\nThe difference between the two. Without exporting compile_commands.json\nit takes around 650ms, with it around 750ms.\nNOTE: This is for subsequent CMake runs. (Excludes the initial run)\n\nThank You,\nSibi Siddharthan\n"},{"id":"426526","messageId":"485254b49de8923f2f47e595f6882d9935e38ee1.1622980974.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","subject":"[PATCH v2 1/3] cmake: add knob to disable vcpkg","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-06T12:02:52Z","receivedAt":"2021-06-06T12:03:02Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nWhen building on windows users have the option to use vcpkg to provide\nthe dependencies needed to compile.  Previously, this was used only when\nusing the Visual Studio generator which was not ideal because:\n\n  - Not all users who want to use vcpkg use the Visual Studio\n    generators.\n\n  - Some versions of Visual Studio 2019 moved away from using the\n    VS 2019  generator by default, making it impossible for Visual\n    Studio to configure the project in the likely event that it couldn't\n    find the dependencies.\n\n  - Inexperienced users of CMake are very likely to get tripped up by\n    the errors caused by a lack of vcpkg, making the above bullet point\n    both annoying and hard to debug.\n\nAs such, let's make using vcpkg the default on windows.  Users who want\nto avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 19 +++++++++++++++----\n 1 file changed, 15 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex a87841340e6a..be6d9659c387 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -43,14 +43,23 @@ NOTE: By default CMake uses Makefile as the build tool on Linux and Visual Studi\n to use another tool say `ninja` add this to the command line when configuring.\n `-G Ninja`\n \n+NOTE: By default CMake will install vcpkg locally to your source tree on configuration,\n+to avoid this, add `-DNO_VCPKG=TRUE` to the command line when configuring.\n+\n ]]\n cmake_minimum_required(VERSION 3.14)\n \n #set the source directory to root of git\n set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)\n-if(WIN32)\n+\n+option(USE_VCPKG \"Whether or not to use vcpkg for obtaining dependencies.  Only applicable to Windows platforms\" ON)\n+if(NOT WIN32)\n+\tset(USE_VCPKG OFF CACHE BOOL FORCE)\n+endif()\n+\n+if(USE_VCPKG)\n \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n-\tif(MSVC AND NOT EXISTS ${VCPKG_DIR})\n+\tif(NOT EXISTS ${VCPKG_DIR})\n \t\tmessage(\"Initializing vcpkg and building the Git's dependencies (this will take a while...)\")\n \t\texecute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)\n \tendif()\n@@ -178,7 +187,9 @@ endif()\n \n find_program(MSGFMT_EXE msgfmt)\n if(NOT MSGFMT_EXE)\n-\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\tif (USE_VCPKG)\n+\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\tendif()\n \tif(NOT EXISTS ${MSGFMT_EXE})\n \t\tmessage(WARNING \"Text Translations won't be built\")\n \t\tunset(MSGFMT_EXE)\n@@ -982,7 +993,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\"\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"RUNTIME_PREFIX='${RUNTIME_PREFIX}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n-if(WIN32)\n+if(USE_VCPKG)\n \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n endif()\n \n-- \ngitgitgadget\n\n"},{"id":"426527","messageId":"a3b5eef5418861ee5c008aef0cdab3448b8fc5d9.1622980974.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","subject":"[PATCH v2 2/3] cmake: create compile_commands.json by default","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-06T12:02:53Z","receivedAt":"2021-06-06T12:03:17Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nSome users have expressed interest in a more \"batteries included\" way of\nbuilding via CMake[1], and a big part of that is providing easier access\nto tooling external tools.\n\nA straightforward way to accomplish this is to make it as simple as\npossible is to enable the generation of the compile_commands.json file,\nwhich is supported by many tools such as: clang-tidy, clang-format,\nsourcetrail, etc.\n\nThis does come with a small run-time overhead during the configuration\nstep (~6 seconds on my machine):\n\n    Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=TRUE\n\n    real    1m9.840s\n    user    0m0.031s\n    sys     0m0.031s\n\n    Time to configure with CMAKE_EXPORT_COMPILE_COMMANDS=FALSE\n\n    real    1m3.195s\n    user    0m0.015s\n    sys     0m0.015s\n\nThis seems like a small enough price to pay to make the project more\naccessible to newer users.  Additionally there are other large projects\nlike llvm [2] which has had this enabled by default for >6 years at the\ntime of this writing, and no real negative consequences that I can find\nwith my search-skills.\n\nNOTE: That the compile_commands.json is currently produced only when\nusing the Ninja and Makefile generators.  See The CMake documentation[3]\nfor more info.\n\n1: https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n2: https://github.com/llvm/llvm-project/commit/2c5712051b31b316a9fc972f692579bd8efa6e67\n3: https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html\n\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex be6d9659c387..399a3cd6c071 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -57,6 +57,10 @@ if(NOT WIN32)\n \tset(USE_VCPKG OFF CACHE BOOL FORCE)\n endif()\n \n+if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n+\tset(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n+endif()\n+\n if(USE_VCPKG)\n \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n \tif(NOT EXISTS ${VCPKG_DIR})\n-- \ngitgitgadget\n\n"},{"id":"426528","messageId":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.git.1622828605.gitgitgadget@gmail.com","subject":"[PATCH v2 0/3] Make CMake work out of the box","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-06T12:02:51Z","receivedAt":"2021-06-06T12:04:13Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"This pull request comes from our discussion here[1], and I think these\npatches provide a good compromise around the concerns discussed there\n\n1:\nhttps://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n\nCCing the people involved in the original discussion. cc: Philip Oakley\nphilipoakley@iee.email cc: Sibi Siddharthan\nsibisiddharthan.github@gmail.com, cc: Johannes Schindelin\njohannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com\n\nMatthew Rogers (3):\n  cmake: add knob to disable vcpkg\n  cmake: create compile_commands.json by default\n  cmake: add warning for ignored MSGFMT_EXE\n\n contrib/buildsystems/CMakeLists.txt | 37 ++++++++++++++++++++++-------\n 1 file changed, 28 insertions(+), 9 deletions(-)\n\n\nbase-commit: c09b6306c6ca275ed9d0348a8c8014b2ff723cfb\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-970%2FROGERSM94%2Ffix-cmake-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-970/ROGERSM94/fix-cmake-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/970\n\nRange-diff vs v1:\n\n 1:  3170f78daa5f ! 1:  485254b49de8 cmake: add knob to disable vcpkg\n     @@ Commit message\n              generators.\n      \n            - Some versions of Visual Studio 2019 moved away from using the\n     -        VS 2019 by default, making it impossible for Visual Studio to\n     -        configure the project in the likely event that it couldn't find the\n     -        dependencies.\n     +        VS 2019  generator by default, making it impossible for Visual\n     +        Studio to configure the project in the likely event that it couldn't\n     +        find the dependencies.\n      \n            - Inexperienced users of CMake are very likely to get tripped up by\n              the errors caused by a lack of vcpkg, making the above bullet point\n              both annoying and hard to debug.\n      \n     -    As such, lets make using vcpkg the default on windows.  Users who want\n     +    As such, let's make using vcpkg the default on windows.  Users who want\n          to avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n      \n          Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n     @@ contrib/buildsystems/CMakeLists.txt: NOTE: By default CMake uses Makefile as the\n       set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)\n      -if(WIN32)\n      +\n     -+if (WIN32 AND NOT NO_VCPKG)\n     -+\tset(USING_VCPKG TRUE)\n     -+else()\n     -+\tset(USING_VCPKG FALSE)\n     ++option(USE_VCPKG \"Whether or not to use vcpkg for obtaining dependencies.  Only applicable to Windows platforms\" ON)\n     ++if(NOT WIN32)\n     ++\tset(USE_VCPKG OFF CACHE BOOL FORCE)\n      +endif()\n      +\n     -+if(USING_VCPKG)\n     ++if(USE_VCPKG)\n       \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n      -\tif(MSVC AND NOT EXISTS ${VCPKG_DIR})\n      +\tif(NOT EXISTS ${VCPKG_DIR})\n     @@ contrib/buildsystems/CMakeLists.txt: endif()\n       find_program(MSGFMT_EXE msgfmt)\n       if(NOT MSGFMT_EXE)\n      -\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n     -+\tif (USING_VCPKG)\n     ++\tif (USE_VCPKG)\n      +\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n      +\tendif()\n       \tif(NOT EXISTS ${MSGFMT_EXE})\n     @@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-O\n       file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n       file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n      -if(WIN32)\n     -+if(USING_VCPKG)\n     ++if(USE_VCPKG)\n       \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n       endif()\n       \n 2:  c3bf266cf03a ! 2:  a3b5eef54188 cmake: create compile_commands.json by default\n     @@ Commit message\n          time of this writing, and no real negative consequences that I can find\n          with my search-skills.\n      \n     -    NOTE: That the comppile_commands.json is currenntly produced only when\n     +    NOTE: That the compile_commands.json is currently produced only when\n          using the Ninja and Makefile generators.  See The CMake documentation[3]\n          for more info.\n      \n     @@ Commit message\n          Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n      \n       ## contrib/buildsystems/CMakeLists.txt ##\n     -@@ contrib/buildsystems/CMakeLists.txt: else()\n     - \tset(USING_VCPKG FALSE)\n     +@@ contrib/buildsystems/CMakeLists.txt: if(NOT WIN32)\n     + \tset(USE_VCPKG OFF CACHE BOOL FORCE)\n       endif()\n       \n     -+if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n     -+\tSET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n     ++if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n     ++\tset(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n      +endif()\n      +\n     - if(USING_VCPKG)\n     + if(USE_VCPKG)\n       \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n       \tif(NOT EXISTS ${VCPKG_DIR})\n 3:  07763a9de723 ! 3:  2110c8ffa423 cmake: add warning for ignored MSGFMT_EXE\n     @@ Commit message\n          configured, as such add a check for NO_GETTEXT before attempting to set\n          it.\n      \n     -    suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n     +    Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n          Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n      \n       ## contrib/buildsystems/CMakeLists.txt ##\n     @@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis\n       \n      -find_program(MSGFMT_EXE msgfmt)\n      -if(NOT MSGFMT_EXE)\n     --\tif (USING_VCPKG)\n     +-\tif (USE_VCPKG)\n      -\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n      -\tendif()\n      -\tif(NOT EXISTS ${MSGFMT_EXE})\n     @@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis\n      +else()\n      +\tfind_program(MSGFMT_EXE msgfmt)\n      +\tif(NOT MSGFMT_EXE)\n     -+\t\tif (USING_VCPKG)\n     ++\t\tif(USE_VCPKG)\n      +\t\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n      +\t\tendif()\n      +\t\tif(NOT EXISTS ${MSGFMT_EXE})\n\n-- \ngitgitgadget\n"},{"id":"426529","messageId":"2110c8ffa423e90224089d048291f4392aa50eab.1622980974.git.gitgitgadget@gmail.com","threadId":"55839","inReplyTo":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","subject":"[PATCH v2 3/3] cmake: add warning for ignored MSGFMT_EXE","fromName":"Matthew Rogers via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-06-06T12:02:54Z","receivedAt":"2021-06-06T12:04:14Z","isPatch":true,"sender":{"key":"name:Matthew Rogers","avatar":null},"body":"From: Matthew Rogers <mattr94@gmail.com>\n\nIt does not make sense to attempt to set MSGFMT_EXE when NO_GETTEXT is\nconfigured, as such add a check for NO_GETTEXT before attempting to set\nit.\n\nSuggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Matthew Rogers <mattr94@gmail.com>\n---\n contrib/buildsystems/CMakeLists.txt | 20 ++++++++++++--------\n 1 file changed, 12 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 399a3cd6c071..3dc7ffcd98bb 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -189,14 +189,18 @@ if(WIN32 AND NOT MSVC)#not required for visual studio builds\n \tendif()\n endif()\n \n-find_program(MSGFMT_EXE msgfmt)\n-if(NOT MSGFMT_EXE)\n-\tif (USE_VCPKG)\n-\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n-\tendif()\n-\tif(NOT EXISTS ${MSGFMT_EXE})\n-\t\tmessage(WARNING \"Text Translations won't be built\")\n-\t\tunset(MSGFMT_EXE)\n+if(NO_GETTEXT)\n+\tmessage(STATUS \"msgfmt not used under NO_GETTEXT\")\n+else()\n+\tfind_program(MSGFMT_EXE msgfmt)\n+\tif(NOT MSGFMT_EXE)\n+\t\tif(USE_VCPKG)\n+\t\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n+\t\tendif()\n+\t\tif(NOT EXISTS ${MSGFMT_EXE})\n+\t\t\tmessage(WARNING \"Text Translations won't be built\")\n+\t\t\tunset(MSGFMT_EXE)\n+\t\tendif()\n \tendif()\n endif()\n \n-- \ngitgitgadget\n"},{"id":"426551","messageId":"xmqqpmwywl2z.fsf@gitster.g","threadId":"55839","inReplyTo":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-07T00:54:28Z","receivedAt":"2021-06-07T00:54:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Matthew Rogers via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> This pull request comes from our discussion here[1], and I think these\n> patches provide a good compromise around the concerns discussed there\n>\n> 1:\n> https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n>\n> CCing the people involved in the original discussion. cc: Philip Oakley\n> philipoakley@iee.email cc: Sibi Siddharthan\n> sibisiddharthan.github@gmail.com, cc: Johannes Schindelin\n> johannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com\n>\n> Matthew Rogers (3):\n>   cmake: add knob to disable vcpkg\n>   cmake: create compile_commands.json by default\n>   cmake: add warning for ignored MSGFMT_EXE\n\nI am neither cmake nor windows person, so I'll queue this as-is and\nwait for the stakeholders to chime in.\n\nI did wonder if we want this to be applicable to the maintenance\ntrack for 2.31, though.  There is a textual conflict with the\naddition of SIMPLE_IPC that happened during 2.32 cycle, which is\neasily resolvable.\n\nI am tempted to queue a version of these three patches rebased on to\n'maint' after making sure that the result of merging that into\n'master' is byte-for-byte identical to applying these three patches\ndirectly on to 'master'.\n\nThe range-diff looks like the attached.  Thanks.\n\n1:  546c49cc88 ! 1:  585b7ca371 cmake: add knob to disable vcpkg\n    @@ contrib/buildsystems/CMakeLists.txt: endif()\n      \tif(NOT EXISTS ${MSGFMT_EXE})\n      \t\tmessage(WARNING \"Text Translations won't be built\")\n      \t\tunset(MSGFMT_EXE)\n    -@@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"X='${EXE_EXTENSION}'\\n\")\n    - file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\")\n    +@@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\"\n      file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"RUNTIME_PREFIX='${RUNTIME_PREFIX}'\\n\")\n      file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n    + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n     -if(WIN32)\n     +if(USE_VCPKG)\n      \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n2:  efa8681a22 = 2:  1cba2f9bd1 cmake: create compile_commands.json by default\n3:  ceeca2bc0d = 3:  7824e74976 cmake: add warning for ignored MSGFMT_EXE\n"},{"id":"426969","messageId":"nycvar.QRO.7.76.6.2106101140590.57@tvgsbejvaqbjf.bet","threadId":"55839","inReplyTo":"6a9150ca-5c1a-1874-5f8b-35187f197d47@gmail.com","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-06-10T09:43:40Z","receivedAt":"2021-06-10T09:43:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 5 Jun 2021, Bagas Sanjaya wrote:\n\n> On 05/06/21 00.43, Matthew Rogers via GitGitGadget wrote:\n> > This pull request comes from our discussion here[1], and I think these\n> > patches provide a good compromise around the concerns discussed there\n> >\n> > 1:\n> > https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n> >\n> > CCing the people involved in the original discussion.\n>\n> This focused on improving CMake support, especially on Visual Studio, right?\n>\n> Then so we have three ways to build Git:\n> 1. plain Makefile\n> 2. ./configure (really just wrapper on top of Makefile)\n> 3. generate build file with CMake\n>\n> If we want to support all of them, it may makes sense to have CI jobs that\n> perform build with each options above.\n\nWe already exercise the plain Makefile plenty, and the CMake-based build\nusing Windows (in the `vs-build` job in `.github/workflows/main.yml`).\n\nI do not see that it is worth spending many electrons exercising the\n`./configure` way, seeing as the preferred way to build Git is by using\nthe `Makefile` directly.\n\nAnd our CMake configuration only really works on Windows, the attempts to\nget it to work on Linux were met with less enthusiasm, seeing as the\n`Makefile` approach is the recommended (and supported) one.\n\ntl;dr I don't think we need to augment our CI jobs as suggested.\n\nCiao,\nDscho\n"},{"id":"426970","messageId":"nycvar.QRO.7.76.6.2106101144050.57@tvgsbejvaqbjf.bet","threadId":"55839","inReplyTo":"xmqqpmwywl2z.fsf@gitster.g","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-06-10T09:45:27Z","receivedAt":"2021-06-10T09:45:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 7 Jun 2021, Junio C Hamano wrote:\n\n> \"Matthew Rogers via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > This pull request comes from our discussion here[1], and I think these\n> > patches provide a good compromise around the concerns discussed there\n> >\n> > 1:\n> > https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n> >\n> > CCing the people involved in the original discussion. cc: Philip Oakley\n> > philipoakley@iee.email cc: Sibi Siddharthan\n> > sibisiddharthan.github@gmail.com, cc: Johannes Schindelin\n> > johannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com\n> >\n> > Matthew Rogers (3):\n> >   cmake: add knob to disable vcpkg\n> >   cmake: create compile_commands.json by default\n> >   cmake: add warning for ignored MSGFMT_EXE\n>\n> I am neither cmake nor windows person, so I'll queue this as-is and\n> wait for the stakeholders to chime in.\n\nAs long as the CI builds pass, I am in favor of integrating the patch\nseries.\n\n> I did wonder if we want this to be applicable to the maintenance\n> track for 2.31, though.  There is a textual conflict with the\n> addition of SIMPLE_IPC that happened during 2.32 cycle, which is\n> easily resolvable.\n\nIf it isn't much work, sure. But I would think that developers who want to\nbuild using Visual Studio really should stay on newer branches.\n\nThanks,\nDscho\n\n> I am tempted to queue a version of these three patches rebased on to\n> 'maint' after making sure that the result of merging that into\n> 'master' is byte-for-byte identical to applying these three patches\n> directly on to 'master'.\n>\n> The range-diff looks like the attached.  Thanks.\n>\n> 1:  546c49cc88 ! 1:  585b7ca371 cmake: add knob to disable vcpkg\n>     @@ contrib/buildsystems/CMakeLists.txt: endif()\n>       \tif(NOT EXISTS ${MSGFMT_EXE})\n>       \t\tmessage(WARNING \"Text Translations won't be built\")\n>       \t\tunset(MSGFMT_EXE)\n>     -@@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"X='${EXE_EXTENSION}'\\n\")\n>     - file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\")\n>     +@@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_GETTEXT='${NO_GETTEXT}'\\n\"\n>       file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"RUNTIME_PREFIX='${RUNTIME_PREFIX}'\\n\")\n>       file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n>     + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n>      -if(WIN32)\n>      +if(USE_VCPKG)\n>       \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n> 2:  efa8681a22 = 2:  1cba2f9bd1 cmake: create compile_commands.json by default\n> 3:  ceeca2bc0d = 3:  7824e74976 cmake: add warning for ignored MSGFMT_EXE\n>\n"},{"id":"426971","messageId":"nycvar.QRO.7.76.6.2106101146230.57@tvgsbejvaqbjf.bet","threadId":"55839","inReplyTo":"pull.970.v2.git.1622980974.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-06-10T09:47:30Z","receivedAt":"2021-06-10T09:47:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Matt,\n\nOn Sun, 6 Jun 2021, Matthew Rogers via GitGitGadget wrote:\n\n> This pull request comes from our discussion here[1], and I think these\n> patches provide a good compromise around the concerns discussed there\n>\n> 1:\n> https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n>\n> CCing the people involved in the original discussion. cc: Philip Oakley\n> philipoakley@iee.email cc: Sibi Siddharthan\n> sibisiddharthan.github@gmail.com, cc: Johannes Schindelin\n> johannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com\n\nJust in case that a v3 is needed, I fixed the PR description so that these\n\"Cc:\"s are interpreted correctly again by GitGitGadget.\n\nBut from a brief glance over v2, all patches look good to me.\n\nThanks,\nDscho\n\n>\n> Matthew Rogers (3):\n>   cmake: add knob to disable vcpkg\n>   cmake: create compile_commands.json by default\n>   cmake: add warning for ignored MSGFMT_EXE\n>\n>  contrib/buildsystems/CMakeLists.txt | 37 ++++++++++++++++++++++-------\n>  1 file changed, 28 insertions(+), 9 deletions(-)\n>\n>\n> base-commit: c09b6306c6ca275ed9d0348a8c8014b2ff723cfb\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-970%2FROGERSM94%2Ffix-cmake-v2\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-970/ROGERSM94/fix-cmake-v2\n> Pull-Request: https://github.com/gitgitgadget/git/pull/970\n>\n> Range-diff vs v1:\n>\n>  1:  3170f78daa5f ! 1:  485254b49de8 cmake: add knob to disable vcpkg\n>      @@ Commit message\n>               generators.\n>\n>             - Some versions of Visual Studio 2019 moved away from using the\n>      -        VS 2019 by default, making it impossible for Visual Studio to\n>      -        configure the project in the likely event that it couldn't find the\n>      -        dependencies.\n>      +        VS 2019  generator by default, making it impossible for Visual\n>      +        Studio to configure the project in the likely event that it couldn't\n>      +        find the dependencies.\n>\n>             - Inexperienced users of CMake are very likely to get tripped up by\n>               the errors caused by a lack of vcpkg, making the above bullet point\n>               both annoying and hard to debug.\n>\n>      -    As such, lets make using vcpkg the default on windows.  Users who want\n>      +    As such, let's make using vcpkg the default on windows.  Users who want\n>           to avoid using vcpkg can disable it by passing -DNO_VCPKG=TRUE.\n>\n>           Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n>      @@ contrib/buildsystems/CMakeLists.txt: NOTE: By default CMake uses Makefile as the\n>        set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)\n>       -if(WIN32)\n>       +\n>      -+if (WIN32 AND NOT NO_VCPKG)\n>      -+\tset(USING_VCPKG TRUE)\n>      -+else()\n>      -+\tset(USING_VCPKG FALSE)\n>      ++option(USE_VCPKG \"Whether or not to use vcpkg for obtaining dependencies.  Only applicable to Windows platforms\" ON)\n>      ++if(NOT WIN32)\n>      ++\tset(USE_VCPKG OFF CACHE BOOL FORCE)\n>       +endif()\n>       +\n>      -+if(USING_VCPKG)\n>      ++if(USE_VCPKG)\n>        \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n>       -\tif(MSVC AND NOT EXISTS ${VCPKG_DIR})\n>       +\tif(NOT EXISTS ${VCPKG_DIR})\n>      @@ contrib/buildsystems/CMakeLists.txt: endif()\n>        find_program(MSGFMT_EXE msgfmt)\n>        if(NOT MSGFMT_EXE)\n>       -\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n>      -+\tif (USING_VCPKG)\n>      ++\tif (USE_VCPKG)\n>       +\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n>       +\tendif()\n>        \tif(NOT EXISTS ${MSGFMT_EXE})\n>      @@ contrib/buildsystems/CMakeLists.txt: file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-O\n>        file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"NO_PYTHON='${NO_PYTHON}'\\n\")\n>        file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"SUPPORTS_SIMPLE_IPC='${SUPPORTS_SIMPLE_IPC}'\\n\")\n>       -if(WIN32)\n>      -+if(USING_VCPKG)\n>      ++if(USE_VCPKG)\n>        \tfile(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS \"PATH=\\\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\\\"\\n\")\n>        endif()\n>\n>  2:  c3bf266cf03a ! 2:  a3b5eef54188 cmake: create compile_commands.json by default\n>      @@ Commit message\n>           time of this writing, and no real negative consequences that I can find\n>           with my search-skills.\n>\n>      -    NOTE: That the comppile_commands.json is currenntly produced only when\n>      +    NOTE: That the compile_commands.json is currently produced only when\n>           using the Ninja and Makefile generators.  See The CMake documentation[3]\n>           for more info.\n>\n>      @@ Commit message\n>           Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n>\n>        ## contrib/buildsystems/CMakeLists.txt ##\n>      -@@ contrib/buildsystems/CMakeLists.txt: else()\n>      - \tset(USING_VCPKG FALSE)\n>      +@@ contrib/buildsystems/CMakeLists.txt: if(NOT WIN32)\n>      + \tset(USE_VCPKG OFF CACHE BOOL FORCE)\n>        endif()\n>\n>      -+if (NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n>      -+\tSET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n>      ++if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)\n>      ++\tset(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)\n>       +endif()\n>       +\n>      - if(USING_VCPKG)\n>      + if(USE_VCPKG)\n>        \tset(VCPKG_DIR \"${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg\")\n>        \tif(NOT EXISTS ${VCPKG_DIR})\n>  3:  07763a9de723 ! 3:  2110c8ffa423 cmake: add warning for ignored MSGFMT_EXE\n>      @@ Commit message\n>           configured, as such add a check for NO_GETTEXT before attempting to set\n>           it.\n>\n>      -    suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>      +    Suggested-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>           Signed-off-by: Matthew Rogers <mattr94@gmail.com>\n>\n>        ## contrib/buildsystems/CMakeLists.txt ##\n>      @@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis\n>\n>       -find_program(MSGFMT_EXE msgfmt)\n>       -if(NOT MSGFMT_EXE)\n>      --\tif (USING_VCPKG)\n>      +-\tif (USE_VCPKG)\n>       -\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n>       -\tendif()\n>       -\tif(NOT EXISTS ${MSGFMT_EXE})\n>      @@ contrib/buildsystems/CMakeLists.txt: if(WIN32 AND NOT MSVC)#not required for vis\n>       +else()\n>       +\tfind_program(MSGFMT_EXE msgfmt)\n>       +\tif(NOT MSGFMT_EXE)\n>      -+\t\tif (USING_VCPKG)\n>      ++\t\tif(USE_VCPKG)\n>       +\t\t\tset(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)\n>       +\t\tendif()\n>       +\t\tif(NOT EXISTS ${MSGFMT_EXE})\n>\n> --\n> gitgitgadget\n>\n"},{"id":"427083","messageId":"xmqqeed853ap.fsf@gitster.g","threadId":"55839","inReplyTo":"nycvar.QRO.7.76.6.2106101146230.57@tvgsbejvaqbjf.bet","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-11T06:22:06Z","receivedAt":"2021-06-11T06:22:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Just in case that a v3 is needed, I fixed the PR description so that these\n> \"Cc:\"s are interpreted correctly again by GitGitGadget.\n>\n> But from a brief glance over v2, all patches look good to me.\n\nLet me amend v2 with your Acked-by and merge it down to 'next',\nthen.\n\nThanks.\n"},{"id":"427820","messageId":"b52d7c45-06dd-a9eb-bc86-e04d2ee16c5e@iee.email","threadId":"55839","inReplyTo":"nycvar.QRO.7.76.6.2106101140590.57@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2021-06-18T13:05:39Z","receivedAt":"2021-06-18T13:05:43Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 10/06/2021 10:43, Johannes Schindelin wrote:\n> Hi,\n>\n> On Sat, 5 Jun 2021, Bagas Sanjaya wrote:\n>\n>> On 05/06/21 00.43, Matthew Rogers via GitGitGadget wrote:\n>>> This pull request comes from our discussion here[1], and I think these\n>>> patches provide a good compromise around the concerns discussed there\n>>>\n>>> 1:\n>>> https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n>>>\n>>> CCing the people involved in the original discussion.\nMatt,\nThanks for picking this up and the approach to working around the\nupdated build approach of recent Visual Studio versions.\n \nIt looks good to me, but the CI should also be tweaked (see below) so\nthat it is tested.\n>> This focused on improving CMake support, especially on Visual Studio, right?\n>>\n>> Then so we have three ways to build Git:\n>> 1. plain Makefile\n>> 2. ./configure (really just wrapper on top of Makefile)\n>> 3. generate build file with CMake\n>>\n>> If we want to support all of them, it may makes sense to have CI jobs that\n>> perform build with each options above.\n> We already exercise the plain Makefile plenty, and the CMake-based build\n> using Windows (in the `vs-build` job in `.github/workflows/main.yml`).\n\nThere is one 'gotcha' in the yml (probably historical) in that it\ndoesn't actually test the approach/changes that Matt addresses regarding\nmy [1].\n\nThat is, I'm looking at the 'out of the box' view, while the yml test\n_preloads_ the vcpkg artefacts.\n\nThere is also the (on Windows) issue that the ARM support has recently\nbeen developed which also fudges the CmakeLists.txt file but forgot\nabout the assumption in the vcpkg install batch file that the default is\nthe x86 setup.\n>\n> I do not see that it is worth spending many electrons exercising the\n> `./configure` way, seeing as the preferred way to build Git is by using\n> the `Makefile` directly.\n>\n> And our CMake configuration only really works on Windows, the attempts to\n> get it to work on Linux were met with less enthusiasm, seeing as the\n> `Makefile` approach is the recommended (and supported) one.\n>\n> tl;dr I don't think we need to augment our CI jobs as suggested.\nI'd agree that there's no need to augment the CI job to expressly check\nthe other flags, but the existing test should reflect the intent of the\npatches (i.e. no preloading of the vcpkg artefacts).\n\nI haven't had much time to catch up on Git, and I'm off-line again from\nSat night for another week.\n"},{"id":"427821","messageId":"232e8d37-dda9-d315-bfb9-4acd19ff1a41@iee.email","threadId":"55839","inReplyTo":"xmqqpmwywl2z.fsf@gitster.g","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2021-06-18T13:09:23Z","receivedAt":"2021-06-18T13:09:26Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 07/06/2021 01:54, Junio C Hamano wrote:\n> \"Matthew Rogers via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> This pull request comes from our discussion here[1], and I think these\n>> patches provide a good compromise around the concerns discussed there\n>>\n>> 1:\n>> https://lore.kernel.org/git/CAOjrSZusMSvs7AS-ZDsV8aQUgsF2ZA754vSDjgFKMRgi_oZAWw@mail.gmail.com/\n>>\n>> CCing the people involved in the original discussion. cc: Philip Oakley\n>> philipoakley@iee.email cc: Sibi Siddharthan\n>> sibisiddharthan.github@gmail.com, cc: Johannes Schindelin\n>> johannes.schindelin@gmx.de, cc: Danh Doan congdanhqx@gmail.com\n>>\n>> Matthew Rogers (3):\n>>   cmake: add knob to disable vcpkg\n>>   cmake: create compile_commands.json by default\n>>   cmake: add warning for ignored MSGFMT_EXE\n> I am neither cmake nor windows person, so I'll queue this as-is and\n> wait for the stakeholders to chime in.\n>\n> I did wonder if we want this to be applicable to the maintenance\n> track for 2.31, though.  There is a textual conflict with the\n> addition of SIMPLE_IPC that happened during 2.32 cycle, which is\n> easily resolvable.\n>\n> I am tempted to queue a version of these three patches rebased on to\n> 'maint' after making sure that the result of merging that into\n> 'master' is byte-for-byte identical to applying these three patches\n> directly on to 'master'.\n\nSorry for the delay - I've been off-line and I'm only now catching up.\n\nCould we confirm that the CI actually tests the update. IIRC the yml\nsetup preloaded the vcpkg artefacts that this change looks to make work\n'out of the box'.\n\nPhilip\n"},{"id":"427822","messageId":"eca54e2b-d79a-5d74-2bcb-71b1ebbedb15@iee.email","threadId":"55839","inReplyTo":"nycvar.QRO.7.76.6.2106101144050.57@tvgsbejvaqbjf.bet","subject":"Re: [PATCH v2 0/3] Make CMake work out of the box","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2021-06-18T13:11:12Z","receivedAt":"2021-06-18T13:11:15Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 10/06/2021 10:45, Johannes Schindelin wrote:\n> As long as the CI builds pass, I am in favor of integrating the patch\n> series.\n>\n>> I did wonder if we want this to be applicable to the maintenance\n>> track for 2.31, though.  There is a textual conflict with the\n>> addition of SIMPLE_IPC that happened during 2.32 cycle, which is\n>> easily resolvable.\n> If it isn't much work, sure. But I would think that developers who want to\n> build using Visual Studio really should stay on newer branches.\n\nAck. Philip\n"},{"id":"427826","messageId":"nycvar.QRO.7.76.6.2106181540340.57@tvgsbejvaqbjf.bet","threadId":"55839","inReplyTo":"b52d7c45-06dd-a9eb-bc86-e04d2ee16c5e@iee.email","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-06-18T13:42:51Z","receivedAt":"2021-06-18T13:42:56Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philip,\n\nOn Fri, 18 Jun 2021, Philip Oakley wrote:\n\n> On 10/06/2021 10:43, Johannes Schindelin wrote:\n> >\n> > On Sat, 5 Jun 2021, Bagas Sanjaya wrote:\n> >\n> >> This focused on improving CMake support, especially on Visual Studio, right?\n> >>\n> >> Then so we have three ways to build Git:\n> >> 1. plain Makefile\n> >> 2. ./configure (really just wrapper on top of Makefile)\n> >> 3. generate build file with CMake\n> >>\n> >> If we want to support all of them, it may makes sense to have CI jobs that\n> >> perform build with each options above.\n> >\n> > We already exercise the plain Makefile plenty, and the CMake-based build\n> > using Windows (in the `vs-build` job in `.github/workflows/main.yml`).\n>\n> There is one 'gotcha' in the yml (probably historical) in that it\n> doesn't actually test the approach/changes that Matt addresses regarding\n> my [1].\n>\n> That is, I'm looking at the 'out of the box' view, while the yml test\n> _preloads_ the vcpkg artefacts.\n\nWe need to \"pre-load\" them because building them would add another\nwhopping 20 minutes to each CI run. And I am not talking total time, but\nwall-clock time.\n\nAnd we're not in the business of testing vcpkg's build.\n\nSo I am really not in favor of even thinking about changing this\n\"pre-loading\" strategy.\n\nCiao,\nDscho\n"},{"id":"427829","messageId":"bdb8bd83-c3d9-b8bd-2bd5-8b7ee0cd346a@iee.email","threadId":"55839","inReplyTo":"nycvar.QRO.7.76.6.2106181540340.57@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.email","sentAt":"2021-06-18T14:03:12Z","receivedAt":"2021-06-18T14:03:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Dscho\n\nOn 18/06/2021 14:42, Johannes Schindelin wrote:\n>>> We already exercise the plain Makefile plenty, and the CMake-based build\n>>> using Windows (in the `vs-build` job in `.github/workflows/main.yml`).\n>> There is one 'gotcha' in the yml (probably historical) in that it\n>> doesn't actually test the approach/changes that Matt addresses regarding\n>> my [1].\n>>\n>> That is, I'm looking at the 'out of the box' view, while the yml test\n>> _preloads_ the vcpkg artefacts.\n> We need to \"pre-load\" them because building them would add another\n> whopping 20 minutes to each CI run. And I am not talking total time, but\n> wall-clock time.\n>\n> And we're not in the business of testing vcpkg's build.\n>\n> So I am really not in favor of even thinking about changing this\n> \"pre-loading\" strategy.\n>\n>\nI can see the common sense in that, however I was trying to highlight\nthat the approach in patch series could go stale, as did the previous\nmethod. Making the entry ramp to investigating the code for the wide\nvariety windows users should have _some_ testing..\n\nI don't have any good ideas about how to get out of that 20 minute\nCatch-22 issue at the moment. Maybe it needs an independent, on-demand\n(i.e. infrequent;-) test.\n\nMaybe there is a way of adding a `--CI-test` option that at least\nexercises the logic without needing the vcpkg to be built again (IIRC,\nand I may well be wrong, we build once, remember the artefacts, and then\nre-used them, but .. dunno).\n\nPhilip\n"},{"id":"428234","messageId":"nycvar.QRO.7.76.6.2106221636040.57@tvgsbejvaqbjf.bet","threadId":"55839","inReplyTo":"bdb8bd83-c3d9-b8bd-2bd5-8b7ee0cd346a@iee.email","subject":"Re: [PATCH 0/3] Make CMake work out of the box","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-06-22T22:32:38Z","receivedAt":"2021-06-22T22:32:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Philip,\n\nOn Fri, 18 Jun 2021, Philip Oakley wrote:\n\n> On 18/06/2021 14:42, Johannes Schindelin wrote:\n> >>> We already exercise the plain Makefile plenty, and the CMake-based build\n> >>> using Windows (in the `vs-build` job in `.github/workflows/main.yml`).\n> >> There is one 'gotcha' in the yml (probably historical) in that it\n> >> doesn't actually test the approach/changes that Matt addresses regarding\n> >> my [1].\n> >>\n> >> That is, I'm looking at the 'out of the box' view, while the yml test\n> >> _preloads_ the vcpkg artefacts.\n> > We need to \"pre-load\" them because building them would add another\n> > whopping 20 minutes to each CI run. And I am not talking total time, but\n> > wall-clock time.\n> >\n> > And we're not in the business of testing vcpkg's build.\n> >\n> > So I am really not in favor of even thinking about changing this\n> > \"pre-loading\" strategy.\n> >\n> >\n> I can see the common sense in that, however I was trying to highlight\n> that the approach in patch series could go stale, as did the previous\n> method. Making the entry ramp to investigating the code for the wide\n> variety windows users should have _some_ testing..\n>\n> I don't have any good ideas about how to get out of that 20 minute\n> Catch-22 issue at the moment. Maybe it needs an independent, on-demand\n> (i.e. infrequent;-) test.\n>\n> Maybe there is a way of adding a `--CI-test` option that at least\n> exercises the logic without needing the vcpkg to be built again (IIRC,\n> and I may well be wrong, we build once, remember the artefacts, and then\n> re-used them, but .. dunno).\n\nI would strongly discourage tacking this onto the current CI. It is way\ntoo rare a use case to merit adding the cost for all developers using the\nCI runs to verify their work.\n\nAll is not lost, though: interested parties (such as yourself!) can easily\nadd their own GitHub workflows in their own repositories and verify that\nthings work.\n\nYou could even put the workflow on a timer, and add a matrix job that\nbuilds `maint`, `master`, `next` and `seen`, to verify that things work.\n\nAnd for extra brownie points, you can monitor the runs and work on fixes\nwhenever you see breakages. That would definitely take a good chunk of the\nmaintenance burden off of the Git maintainers.\n\nCiao,\nDscho\n"}]}