{"thread":{"id":"61772","subject":"[PATCH] cmake: fix build of `t-oidtree`","startedAt":"2024-07-12T20:34:13Z","lastAt":"2024-07-24T10:20:04Z","messageCount":6,"participants":["Johannes Schindelin via GitGitGadget","Johannes Schindelin","Junio C Hamano","Ghanshyam Thakkar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"498596","messageId":"pull.1761.git.1720816450344.gitgitgadget@gmail.com","threadId":"61772","inReplyTo":null,"subject":"[PATCH] cmake: fix build of `t-oidtree`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-12T20:34:10Z","receivedAt":"2024-07-12T20:34:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen the `oidtree` test helper was turned into a unit test, a new\n`lib-oid` source file was added as dependency. This was only done in the\nMakefile so far, but also needs to be done in the CMake definition.\n\nThis is a companion of ed548408723d (t/: migrate helper/test-oidtree.c\nto unit-tests/t-oidtree.c, 2024-06-08).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    cmake: fix build of t-oidtree\n    \n    This is based on the gt/unit-test-oidtree branch.\n    \n    /cc \"Ghanshyam Thakkar\" shyamthakkar001@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1761%2Fdscho%2Fcmake-vs-t-oidtree-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1761/dscho/cmake-vs-t-oidtree-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1761\n\n contrib/buildsystems/CMakeLists.txt | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 2f9c33585c6..832f46b316b 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -976,11 +976,12 @@ list(TRANSFORM test-reftable_SOURCES PREPEND \"${CMAKE_SOURCE_DIR}/\")\n \n #unit-tests\n add_library(unit-test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)\n+add_library(unit-test-lib-oid OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/lib-oid.c)\n \n parse_makefile_for_scripts(unit_test_PROGRAMS \"UNIT_TEST_PROGRAMS\" \"\")\n foreach(unit_test ${unit_test_PROGRAMS})\n \tadd_executable(\"${unit_test}\" \"${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c\")\n-\ttarget_link_libraries(\"${unit_test}\" unit-test-lib common-main)\n+\ttarget_link_libraries(\"${unit_test}\" unit-test-lib unit-test-lib-oid common-main)\n \tset_target_properties(\"${unit_test}\"\n \t\tPROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)\n \tif(MSVC)\n\nbase-commit: ed548408723d6e969160279398cc47f88f5700bc\n-- \ngitgitgadget\n"},{"id":"498597","messageId":"d6bb6432-b10b-a665-1dc0-1a4df4a6495c@gmx.de","threadId":"61772","inReplyTo":"pull.1761.git.1720816450344.gitgitgadget@gmail.com","subject":"Re: [PATCH] cmake: fix build of `t-oidtree`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-07-12T20:46:38Z","receivedAt":"2024-07-12T20:46:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nnow Cc:ing Ghanshyam correctly. Sorry for that.\n\nOn Fri, 12 Jul 2024, Johannes Schindelin via GitGitGadget wrote:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When the `oidtree` test helper was turned into a unit test, a new\n> `lib-oid` source file was added as dependency. This was only done in the\n> Makefile so far, but also needs to be done in the CMake definition.\n>\n> This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c\n> to unit-tests/t-oidtree.c, 2024-06-08).\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     cmake: fix build of t-oidtree\n>\n>     This is based on the gt/unit-test-oidtree branch.\n>\n>     /cc \"Ghanshyam Thakkar\" shyamthakkar001@gmail.com\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1761%2Fdscho%2Fcmake-vs-t-oidtree-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1761/dscho/cmake-vs-t-oidtree-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/1761\n>\n>  contrib/buildsystems/CMakeLists.txt | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\n> index 2f9c33585c6..832f46b316b 100644\n> --- a/contrib/buildsystems/CMakeLists.txt\n> +++ b/contrib/buildsystems/CMakeLists.txt\n> @@ -976,11 +976,12 @@ list(TRANSFORM test-reftable_SOURCES PREPEND \"${CMAKE_SOURCE_DIR}/\")\n>\n>  #unit-tests\n>  add_library(unit-test-lib OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/test-lib.c)\n> +add_library(unit-test-lib-oid OBJECT ${CMAKE_SOURCE_DIR}/t/unit-tests/lib-oid.c)\n>\n>  parse_makefile_for_scripts(unit_test_PROGRAMS \"UNIT_TEST_PROGRAMS\" \"\")\n>  foreach(unit_test ${unit_test_PROGRAMS})\n>  \tadd_executable(\"${unit_test}\" \"${CMAKE_SOURCE_DIR}/t/unit-tests/${unit_test}.c\")\n> -\ttarget_link_libraries(\"${unit_test}\" unit-test-lib common-main)\n> +\ttarget_link_libraries(\"${unit_test}\" unit-test-lib unit-test-lib-oid common-main)\n>  \tset_target_properties(\"${unit_test}\"\n>  \t\tPROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/t/unit-tests/bin)\n>  \tif(MSVC)\n>\n> base-commit: ed548408723d6e969160279398cc47f88f5700bc\n> --\n> gitgitgadget\n>\n"},{"id":"498598","messageId":"xmqqa5iml28j.fsf@gitster.g","threadId":"61772","inReplyTo":"pull.1761.git.1720816450344.gitgitgadget@gmail.com","subject":"Re: [PATCH] cmake: fix build of `t-oidtree`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-12T21:38:52Z","receivedAt":"2024-07-12T21:38:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When the `oidtree` test helper was turned into a unit test, a new\n> `lib-oid` source file was added as dependency. This was only done in the\n> Makefile so far, but also needs to be done in the CMake definition.\n>\n> This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c\n> to unit-tests/t-oidtree.c, 2024-06-08).\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     cmake: fix build of t-oidtree\n>     \n>     This is based on the gt/unit-test-oidtree branch.\n>     \n>     /cc \"Ghanshyam Thakkar\" shyamthakkar001@gmail.com\n\nThe base topic has been merged last month during this cycle, so the\nfix must be merged down to the 'master' before the release.  Will\nqueue.\n\nThanks.\n"},{"id":"498601","messageId":"D2NXQ2WZFF24.1GVN7WUJ5PCHZ@gmail.com","threadId":"61772","inReplyTo":"xmqqa5iml28j.fsf@gitster.g","subject":"Re: [PATCH] cmake: fix build of `t-oidtree`","fromName":"Ghanshyam Thakkar","fromEmail":"shyamthakkar001@gmail.com","sentAt":"2024-07-12T23:04:46Z","receivedAt":"2024-07-12T23:04:51Z","isPatch":true,"sender":{"key":"shyamthakkar001@gmail.com","avatar":"https://avatars.githubusercontent.com/u/72698233?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > When the `oidtree` test helper was turned into a unit test, a new\n> > `lib-oid` source file was added as dependency. This was only done in the\n> > Makefile so far, but also needs to be done in the CMake definition.\n> >\n> > This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c\n> > to unit-tests/t-oidtree.c, 2024-06-08).\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >     cmake: fix build of t-oidtree\n> >     \n> >     This is based on the gt/unit-test-oidtree branch.\n> >     \n> >     /cc \"Ghanshyam Thakkar\" shyamthakkar001@gmail.com\n>\n> The base topic has been merged last month during this cycle, so the\n> fix must be merged down to the 'master' before the release. Will\n> queue.\n\nChanges look correct to me. I was not aware of the existance of\nCMakeLists in the tree cause there was no mention of CMake support\nin the docs about building git from source, but it was my mistake\nfor grepping for 'test-lib' in just the Makefile instead of project\nwide. Apologies for the negligance and thanks for the patch.\n\n"},{"id":"498603","messageId":"xmqq1q3yjdp3.fsf@gitster.g","threadId":"61772","inReplyTo":"D2NXQ2WZFF24.1GVN7WUJ5PCHZ@gmail.com","subject":"Re: [PATCH] cmake: fix build of `t-oidtree`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-13T01:14:16Z","receivedAt":"2024-07-13T01:14:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ghanshyam Thakkar\" <shyamthakkar001@gmail.com> writes:\n\n> Changes look correct to me. I was not aware of the existance of\n> CMakeLists in the tree cause there was no mention of CMake support\n> in the docs about building git from source, but it was my mistake\n> for grepping for 'test-lib' in just the Makefile instead of project\n> wide. Apologies for the negligance and thanks for the patch.\n\nNo need to apologize.  Nobody caught during the review, so it is not\neven your fault ;-) \n\nAnd the CMakeLists is not even meant to work with anything but for\nWindows, IIRC (even though it might work by accident).\n"},{"id":"499242","messageId":"c109d620-0258-cc1a-e847-6c6c841a2232@gmx.de","threadId":"61772","inReplyTo":"D2NXQ2WZFF24.1GVN7WUJ5PCHZ@gmail.com","subject":"Re: [PATCH] cmake: fix build of `t-oidtree`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-07-24T10:19:56Z","receivedAt":"2024-07-24T10:20:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ghanshyam,\n\nOn Sat, 13 Jul 2024, Ghanshyam Thakkar wrote:\n\n> Junio C Hamano <gitster@pobox.com> wrote:\n> > \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> > writes:\n> >\n> > > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > >\n> > > When the `oidtree` test helper was turned into a unit test, a new\n> > > `lib-oid` source file was added as dependency. This was only done in the\n> > > Makefile so far, but also needs to be done in the CMake definition.\n> > >\n> > > This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c\n> > > to unit-tests/t-oidtree.c, 2024-06-08).\n> > >\n> > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > > ---\n> > >     cmake: fix build of t-oidtree\n> > >\n> > >     This is based on the gt/unit-test-oidtree branch.\n> > >\n> > >     /cc \"Ghanshyam Thakkar\" shyamthakkar001@gmail.com\n> >\n> > The base topic has been merged last month during this cycle, so the\n> > fix must be merged down to the 'master' before the release. Will\n> > queue.\n>\n> Changes look correct to me.\n\nThank you for confirming.\n\nFor what it's worth, it was this confirmation by the domain expert (i.e.\nyou) that I was looking for when I Cc:ed you, not to spread blame.\n\nThe CMakeLists.txt file exists primarily to support building Git in Visual\nStudio, and I removed that part from CI builds specifically so that\ncontributors on the Git mailing list need not worry about that support.\n\nCiao,\nJohannes\n"}]}