{"thread":{"id":"59211","subject":"CMakeLists.txt from contrib/buildsystems fails to build on Mac","startedAt":"2023-02-08T11:45:28Z","lastAt":"2023-02-08T16:53:35Z","messageCount":5,"participants":["Ilya Kantor","Ævar Arnfjörð Bjarmason","Phillip Wood","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471757","messageId":"BFC8139A-0A9A-4E84-BC0B-D6EE5F469F82@gmail.com","threadId":"59211","inReplyTo":null,"subject":"CMakeLists.txt from contrib/buildsystems fails to build on Mac","fromName":"Ilya Kantor","fromEmail":"iliakan@gmail.com","sentAt":"2023-02-08T11:45:06Z","receivedAt":"2023-02-08T11:45:28Z","isPatch":false,"sender":{"key":"iliakan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349336?v=4"},"body":"Hello,\n\nI've just tried to build git as described in contrib/buildsystems/CMakeLists.txt, and it doesn't work.\n\nIs this route supposed to work at all?\n\nI'm on MacOS Ventura,\nfirst running this:\n```\nmkdir -p contrib/buildsystems/out\ncd contrib/buildsystems/out\ncmake ../ -DCMAKE_BUILD_TYPE=Release\n```\n\nThis works fine (the full output is here: https://gist.github.com/11f6786eb195a4bc939e010d4f759a22).\n\nAnd then I run `make`:\n\n```\nmake\n```\n\nAlthough it dies with an error.\n\nThe full output is here: https://gist.github.com/24e2eb21613668c44d81f6f0cc78e1a1\n\nHere's the ending error:\n\n```\n/opt/tmp/git/read-cache.c:170:22: error: no member named 'st_ctim' in 'struct stat'\n        sd->sd_ctime.nsec = ST_CTIME_NSEC(*st);\n                            ^~~~~~~~~~~~~~~~~~\n/opt/tmp/git/contrib/buildsystems/../../git-compat-util.h:1380:48: note: expanded from macro 'ST_CTIME_NSEC'\n#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec))\n                                          ~~~~ ^\n/opt/tmp/git/read-cache.c:171:22: error: no member named 'st_mtim' in 'struct stat'\n        sd->sd_mtime.nsec = ST_MTIME_NSEC(*st);\n                            ^~~~~~~~~~~~~~~~~~\n/opt/tmp/git/contrib/buildsystems/../../git-compat-util.h:1381:48: note: expanded from macro 'ST_MTIME_NSEC'\n#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))\n                                          ~~~~ ^\n/opt/tmp/git/read-cache.c:2410:27: error: no member named 'st_mtim' in 'struct stat'\n        istate->timestamp.nsec = ST_MTIME_NSEC(st);\n                                 ^~~~~~~~~~~~~~~~~\n/opt/tmp/git/contrib/buildsystems/../../git-compat-util.h:1381:48: note: expanded from macro 'ST_MTIME_NSEC'\n#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))\n                                          ~~~~ ^\n/opt/tmp/git/read-cache.c:3177:27: error: no member named 'st_mtim' in 'struct stat'\n        istate->timestamp.nsec = ST_MTIME_NSEC(st);\n                                 ^~~~~~~~~~~~~~~~~\n/opt/tmp/git/contrib/buildsystems/../../git-compat-util.h:1381:48: note: expanded from macro 'ST_MTIME_NSEC'\n#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))\n                                          ~~~~ ^\n4 errors generated.\nmake[2]: *** [CMakeFiles/libgit.dir/opt/tmp/git/read-cache.c.o] Error 1\nmake[1]: *** [CMakeFiles/libgit.dir/all] Error 2\n```\n\nMay that be because of some changes in MacOs Ventura? \nOr is the CMakeLists.txt \"dead and forgotten\"? ;)\n\nP.S. The regular \"make\" route works.\n\nKind regards,\nIlya Kantor"},{"id":"471759","messageId":"230208.86sffgz7i1.gmgdl@evledraar.gmail.com","threadId":"59211","inReplyTo":"BFC8139A-0A9A-4E84-BC0B-D6EE5F469F82@gmail.com","subject":"Re: CMakeLists.txt from contrib/buildsystems fails to build on Mac","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2023-02-08T11:57:35Z","receivedAt":"2023-02-08T12:06:37Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Feb 08 2023, Ilya Kantor wrote:\n\n> May that be because of some changes in MacOs Ventura? \n> Or is the CMakeLists.txt \"dead and forgotten\"? ;)\n>\n> P.S. The regular \"make\" route works.\n\nYou should just use \"make\", the \"cmake\" build method is currently in\nsome limbo. See my\nhttps://lore.kernel.org/git/221227.86pmc4vrk3.gmgdl@evledraar.gmail.com/\nfor a recent overview/questions about it.\n\nSince I wrote that 0949eba7fd0 (diagnose: another dup2() leak,\n2022-12-06) landed on git.git's master, so we don't run it ourselves in\nCI, even for Windows (which it was intended for).\n\nAs noted in previous exchanges I wouldn't mind fixing it up to work on\nmore platforms, but Junio wasn't enthusiastic about those patches &\ndropped them.\n\nAlternatively I think the best thing to do is to \"git rm\" it from\ngit.git, and leave it to git-for-windows. From what I understood from\nJohannes he preferred that plan.\n\nOr rather, that GFW would be fixing it up, but then I don't see why it\nshould be in git.git, which as your message shows just leads to\nconfusion about why this component is in git.git's tree.\n"},{"id":"471765","messageId":"a120ea47-722d-2bb0-9c49-294a850af6af@dunelm.org.uk","threadId":"59211","inReplyTo":"230208.86sffgz7i1.gmgdl@evledraar.gmail.com","subject":"Re: CMakeLists.txt from contrib/buildsystems fails to build on Mac","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2023-02-08T14:31:58Z","receivedAt":"2023-02-08T14:32:09Z","isPatch":false,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Ævar\n\nOn 08/02/2023 11:57, Ævar Arnfjörð Bjarmason wrote:\n> Or rather, that GFW would be fixing it up, but then I don't see why it\n> should be in git.git, which as your message shows just leads to\n> confusion about why this component is in git.git's tree.\n\nI think Ilya's message shows we need to update the instructions in \nCMakeLists.txt to make it clear it is Windows only.\n\nBest Wishes\n\nPhillip\n"},{"id":"471766","messageId":"68C6062A-7833-48F2-8F44-3BB129E5E9E5@gmail.com","threadId":"59211","inReplyTo":"a120ea47-722d-2bb0-9c49-294a850af6af@dunelm.org.uk","subject":"Re: CMakeLists.txt from contrib/buildsystems fails to build on Mac","fromName":"Ilya Kantor","fromEmail":"iliakan@gmail.com","sentAt":"2023-02-08T14:34:18Z","receivedAt":"2023-02-08T14:34:36Z","isPatch":false,"sender":{"key":"iliakan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349336?v=4"},"body":"Hi,\n\nThank you for the responses.\n\nYes, I saw the discussion, but couldn't figure out the final outcome.\n\nIndeed, I'd suggest to remove the mention of any other platforms if it's windows-only.\n\nAnd if it's windows-only, then it makes sense to move it to git-for-windows, at least for a bird's-eye view.\n\nKind regards,\nIlya Kantor\n\n> On 8 Feb 2023, at 15:31, Phillip Wood <phillip.wood123@gmail.com> wrote:\n> \n> Hi Ævar\n> \n> On 08/02/2023 11:57, Ævar Arnfjörð Bjarmason wrote:\n>> Or rather, that GFW would be fixing it up, but then I don't see why it\n>> should be in git.git, which as your message shows just leads to\n>> confusion about why this component is in git.git's tree.\n> \n> I think Ilya's message shows we need to update the instructions in CMakeLists.txt to make it clear it is Windows only.\n> \n> Best Wishes\n> \n> Phillip\n\n"},{"id":"471778","messageId":"xmqqlel8t7xw.fsf@gitster.g","threadId":"59211","inReplyTo":"a120ea47-722d-2bb0-9c49-294a850af6af@dunelm.org.uk","subject":"Re: CMakeLists.txt from contrib/buildsystems fails to build on Mac","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-02-08T16:53:31Z","receivedAt":"2023-02-08T16:53:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> On 08/02/2023 11:57, Ævar Arnfjörð Bjarmason wrote:\n>> Or rather, that GFW would be fixing it up, but then I don't see why it\n>> should be in git.git, which as your message shows just leads to\n>> confusion about why this component is in git.git's tree.\n>\n> I think Ilya's message shows we need to update the instructions in\n> CMakeLists.txt to make it clear it is Windows only.\n\nThat matches the conclusion in the thread\n\n  https://lore.kernel.org/git/1e701a54-0356-9f55-ab53-9d8bfdd93e55@dunelm.org.uk/\n\nwhich was a subthread of the primary discussion we had on this\ntopic, which starts here:\n\n  https://lore.kernel.org/git/544fff8a-7d56-57a1-00a3-d1a9302e227c@dunelm.org.uk/\n\nI am fine with either marking CMakeLists as windows-only, or\nremoving it from my tree and have GfW folks add it back to their\ntree.\n\nOr keep it in my tree, make CI failures around it \"soft\" failures,\nand mark it prominently as \"work in progress\" on platforms other\nthan Windows.  But this choice is only valid if we as the project\nwant to expend more effort on enhancing and extending cmake support.\nI personally do not believe in having to maintain two parallel build\nsystems for non Windows and keep them in sync.\n"}]}