{"thread":{"id":"63051","subject":"meson build: datadir missing?","startedAt":"2025-03-03T20:43:14Z","lastAt":"2025-03-05T07:19:33Z","messageCount":4,"participants":["Steffen Nurpmeso","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"513434","messageId":"20250303203320.lP10PHC5@steffen%sdaoden.eu","threadId":"63051","inReplyTo":null,"subject":"meson build: datadir missing?","fromName":"Steffen Nurpmeso","fromEmail":"steffen@sdaoden.eu","sentAt":"2025-03-03T20:33:20Z","receivedAt":"2025-03-03T20:43:14Z","isPatch":false,"sender":{"key":"steffen@sdaoden.eu","avatar":"https://gravatar.com/avatar/d49e696effa4b8f04abdee3c3567a1638260b8fa05df4f389a373db04fc8a1b3?d=mp&s=160"},"body":"Hello again after a long time.\n\nI opened\n\n  https://git.crux.nu/ports/opt/issues/18\n\nat my linux distro ([ports/opt] git: creates incomplete repos),\nbecause hook etc directories were missing:\n\n  warning: templates not found in /share/git-core/templates\n\nHe then said\n\n  Try setting\n\n    [init]\n      templatedir = /usr/share/git-core/templates\n\n  in your gitconfig.\n\nwhich made me wonder since that is the default, so i looked and\nsaw his change to switch to meson back in January.  (What a pity,\ni liked the make system; only that it requires GNU make, but\nwell..).  I then said (it is a web ui, sorry):\n\n  hi. thanks, i see now (after looking around). it is a fallout of switching to meson, that build system seems incomplete\n\n  master:meson.build: '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n\n  but that \"datadir\" does not happen to be set at all it seems; is this known upstream? (Hamano does not like me either, so i will not do that..)\n\n  Only wondering why this happens at all, and is not covered by its tests, really.\n\n  Ok i overwrite the default with the real default in my config, thanks again.\n\n\nWhile here, since a couple of months maybe i get a problem on my\nspare notebook when i sync the filesystem (btrfs).\nTo reproduce:\n\n  #?0|kent:~# mount /media/btrfs-master/\n  #?0|kent:/media/btrfs-master# cd crux/kent/root\n  #?0|kent:/media/btrfs-master/crux/kent/root# chroot .\n\n^(we are now chroot(1)ed to the same what is /, actually.)\n\n  #?0|kent:/# cd root/\n  #?0|kent:~# git co kent\n  git: ../git-2.48.1/exec-cmd.c:50: system_prefix: Assertion `executable_dirname' failed.\n  Aborted\n\nIt will work if i do /usr/bin/git, effectively the same binary.\nHowever, this does not apply \"normally\":\n\n  #?0|kent:~# cd /\n  #?0|kent:/# chroot .\n  #?0|kent:/# cd root\n  #?0|kent:~# git co kent\n  M       hosts/iwd.network/.known_network.freq\n  Switched to branch 'kent'\n  #?0|kent:~# git co master\n  M       hosts/iwd.network/.known_network.freq\n  Switched to branch 'master'\n\nWhatever the actual logic is, it seems a bit odd, and furthermore,\nand most of all, the above assertion is not a real help to solve\nthe problem at hand, some kind of hint to a solution would be\ntremendous!\n\nThanks for git, and ciao!\n\n--steffen\n|\n|Der Kragenbaer,                The moon bear,\n|der holt sich munter           he cheerfully and one by one\n|einen nach dem anderen runter  wa.ks himself off\n|(By Robert Gernhardt)\n"},{"id":"513496","messageId":"Z8am0ZmkJ7QD13_g@pks.im","threadId":"63051","inReplyTo":"20250303203320.lP10PHC5@steffen%sdaoden.eu","subject":"Re: meson build: datadir missing?","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-04T07:08:01Z","receivedAt":"2025-03-04T07:08:09Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Mar 03, 2025 at 09:33:20PM +0100, Steffen Nurpmeso wrote:\n> Hello again after a long time.\n> \n> I opened\n> \n>   https://git.crux.nu/ports/opt/issues/18\n> \n> at my linux distro ([ports/opt] git: creates incomplete repos),\n> because hook etc directories were missing:\n> \n>   warning: templates not found in /share/git-core/templates\n\nOkay.\n\n>   hi. thanks, i see now (after looking around). it is a fallout of switching to meson, that build system seems incomplete\n> \n>   master:meson.build: '-DDEFAULT_GIT_TEMPLATE_DIR=\"' + get_option('datadir') / 'git-core/templates' + '\"',\n> \n>   but that \"datadir\" does not happen to be set at all it seems; is this known upstream? (Hamano does not like me either, so i will not do that..)\n\n\"datadir\" is set, as it is a default option provided by Meson itself,\nand can be configured with `meson setup --datadir`. I've also\ndouble-checked the logic how we set the template directory path, but it\ndoes seem to be correct: our Makefile sets up a path relative to the\nprefix, and we do the exact same here. Double-checking on my machine\nalso confirmed that this works as expected:\n\n    $ meson setup /tmp/build --prefix=/tmp/prefix\n    $ meson install -C /tmp/build\n    $ touch /tmp/prefix/share/git-core/templates/foobar\n    $ /tmp/prefix/bin/git git init /tmp/repo\n    $ ls /tmp/repo/.git\n    config  description  foobar  HEAD  hooks  info  objects  refs  reftable\n\nSo I had a closer look at the recipe that Crux uses for building Git\n[1]. As it turns out, the issue isn't the prefix or datadir, but that\nCrux enables `-Druntime_prefix=true`:\n\n    $ meson setup /tmp/build --prefix=/tmp/prefix -Druntime_prefix=true\n    $ meson install -C /tmp/build\n    $ /tmp/prefix/bin/git git init /tmp/repo\n    warning: templates not found in /share/git-core/templates\n\nThis is a bug that has already been fixed via bd262d07b65 (meson: fix\nexec path with enabled runtime prefix, 2025-02-26). I'd recommend to\nbackport this fix or disable the runtime prefix.\n\n>   Only wondering why this happens at all, and is not covered by its tests, really.\n\nThings like this are somewhat hard to test for as they require a proper\ninstallation.\n\n[1]: https://git.crux.nu/ports/opt/src/branch/3.7/git/Pkgfile\n\nPatrick\n"},{"id":"513559","messageId":"20250304181636.CEUTB9ed@steffen%sdaoden.eu","threadId":"63051","inReplyTo":"Z8am0ZmkJ7QD13_g@pks.im","subject":"Re: meson build: datadir missing?","fromName":"Steffen Nurpmeso","fromEmail":"steffen@sdaoden.eu","sentAt":"2025-03-04T18:16:36Z","receivedAt":"2025-03-04T18:16:40Z","isPatch":false,"sender":{"key":"steffen@sdaoden.eu","avatar":"https://gravatar.com/avatar/d49e696effa4b8f04abdee3c3567a1638260b8fa05df4f389a373db04fc8a1b3?d=mp&s=160"},"body":"Hello Patrick Steinhardt,\n\nPatrick Steinhardt wrote in\n <Z8am0ZmkJ7QD13_g@pks.im>:\n |On Mon, Mar 03, 2025 at 09:33:20PM +0100, Steffen Nurpmeso wrote:\n |> I opened\n |> \n |>   https://git.crux.nu/ports/opt/issues/18\n |> \n |> at my linux distro ([ports/opt] git: creates incomplete repos),\n |> because hook etc directories were missing:\n |> \n |>   warning: templates not found in /share/git-core/templates\n |\n |Okay.\n |\n |>   hi. thanks, i see now (after looking around). it is a fallout of \\\n |>   switching to meson, that build system seems incomplete\n ...\n |>   but that \"datadir\" does not happen to be set at all it seems; is \\\n ...\n |\"datadir\" is set, as it is a default option provided by Meson itself,\n |and can be configured with `meson setup --datadir`. I've also\n |double-checked the logic how we set the template directory path, but it\n |does seem to be correct: our Makefile sets up a path relative to the\n |prefix, and we do the exact same here. Double-checking on my machine\n |also confirmed that this works as expected:\n |\n |    $ meson setup /tmp/build --prefix=/tmp/prefix\n |    $ meson install -C /tmp/build\n |    $ touch /tmp/prefix/share/git-core/templates/foobar\n |    $ /tmp/prefix/bin/git git init /tmp/repo\n |    $ ls /tmp/repo/.git\n |    config  description  foobar  HEAD  hooks  info  objects  refs  reftable\n\nThanks for all the effort!\n\n |So I had a closer look at the recipe that Crux uses for building Git\n |[1]. As it turns out, the issue isn't the prefix or datadir, but that\n |Crux enables `-Druntime_prefix=true`:\n |\n |    $ meson setup /tmp/build --prefix=/tmp/prefix -Druntime_prefix=true\n |    $ meson install -C /tmp/build\n |    $ /tmp/prefix/bin/git git init /tmp/repo\n |    warning: templates not found in /share/git-core/templates\n |\n |This is a bug that has already been fixed via bd262d07b65 (meson: fix\n |exec path with enabled runtime prefix, 2025-02-26). I'd recommend to\n |backport this fix or disable the runtime prefix.\n\nI will pass this information through, thank you.\n\n |>   Only wondering why this happens at all, and is not covered by its \\\n |>   tests, really.\n |\n |Things like this are somewhat hard to test for as they require a proper\n |installation.\n\nSure.  I just did not know about the meson stuff until this issue\narose, lots of things seem to happen this year regarding it, there\nis a massive flux etc etc.  I did not want to piss somewhere,\nsorry.\n\n |[1]: https://git.crux.nu/ports/opt/src/branch/3.7/git/Pkgfile\n |\n |Patrick\n --End of <Z8am0ZmkJ7QD13_g@pks.im>\n\nThanks for git!\n\nCiao, and greetings,\n\n--steffen\n|\n|Der Kragenbaer,                The moon bear,\n|der holt sich munter           he cheerfully and one by one\n|einen nach dem anderen runter  wa.ks himself off\n|(By Robert Gernhardt)\n"},{"id":"513596","messageId":"Z8f6_3nJ9ld4kC6p@pks.im","threadId":"63051","inReplyTo":"20250304181636.CEUTB9ed@steffen%sdaoden.eu","subject":"Re: meson build: datadir missing?","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-05T07:19:27Z","receivedAt":"2025-03-05T07:19:33Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Mar 04, 2025 at 07:16:36PM +0100, Steffen Nurpmeso wrote:\n> Patrick Steinhardt wrote in\n>  |>   Only wondering why this happens at all, and is not covered by its \\\n>  |>   tests, really.\n>  |\n>  |Things like this are somewhat hard to test for as they require a proper\n>  |installation.\n> \n> Sure.  I just did not know about the meson stuff until this issue\n> arose, lots of things seem to happen this year regarding it, there\n> is a massive flux etc etc.  I did not want to piss somewhere,\n> sorry.\n\nNo need to be sorry, I wasn't offended by anything.\n\nPatrick\n"}]}