{"thread":{"id":"63230","subject":"meson: Installing completions","startedAt":"2025-04-01T06:46:19Z","lastAt":"2025-04-07T08:01:28Z","messageCount":7,"participants":["Akshay Hegde","Patrick Steinhardt","Todd Zullinger"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"515412","messageId":"Z-uLqQd7QHZq-tB7@akshay.is","threadId":"63230","inReplyTo":null,"subject":"meson: Installing completions","fromName":"Akshay Hegde","fromEmail":"lists+git@akshay.is","sentAt":"2025-04-01T06:46:01Z","receivedAt":"2025-04-01T06:46:19Z","isPatch":false,"sender":{"key":"lists+git@akshay.is","avatar":null},"body":"Hi there,\n\nI found some extra time today so I thought I'd try moving my git\ninstall over to using the new meson build system. Everything went\nsurprisingly smoothly, which I really appreciated, so thank you!\n\nHowever, one thing that confused me was that the completions were never\ninstalled automatically as part of `meson install`, even though\nI specified them under the '-Dcontrib' option.\n\nI just wanted to double check if I'm supposed to install them manually,\nor if I missed enabling some options (I looked through the top-level\nmeson_options.txt and meson.build files and I don't think I did.)\n\nI'm calling meson setup like so:\n\n    meson setup meson-git-build --prefix=/opt/personal/git/versions/2.49.0 \\\n        --libdir=/opt/personal/git/versions/2.49.0/lib --buildtype=release \\\n        --wrap-mode=nofallback --backend=ninja \\\n        -Dmacos_use_homebrew_gettext=false -Dcontrib=completion,subtree\n\nAnd I do see both subtree and completion modules being built in the\n'meson compile' logs and indeed, I see that git-subtree was\nautomatically installed, as expected:\n\n    Installing contrib/subtree/git-subtree to /opt/personal/git/versions/2.49.0/libexec/git-core\n\n...So I would have expected the completion module to be automatically\ninstalled as well, but this didn't happen. Rather, it merely got copied\nto the internal build folder:\n\n    [669/669] /opt/personal/meson/bin/meson --internal copy ../contrib/completion/git-completion.tcsh contrib/completion/git-completion.tcsh\n\nOf course, I can manually install these to the appropriate locations,\nbut just checking to make sure I didn't miss anything.\n\nCheers,\n-- \n\tAkshay\n\n"},{"id":"515420","messageId":"Z-u42Sm613hMj1Ft@pks.im","threadId":"63230","inReplyTo":"Z-uLqQd7QHZq-tB7@akshay.is","subject":"Re: meson: Installing completions","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-04-01T09:58:49Z","receivedAt":"2025-04-01T09:58:59Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"Hi,\n\nOn Mon, Mar 31, 2025 at 11:46:01PM -0700, Akshay Hegde wrote:\n> Hi there,\n> \n> I found some extra time today so I thought I'd try moving my git\n> install over to using the new meson build system. Everything went\n> surprisingly smoothly, which I really appreciated, so thank you!\n\ngreat, thanks for testing!\n\n> However, one thing that confused me was that the completions were never\n> installed automatically as part of `meson install`, even though\n> I specified them under the '-Dcontrib' option.\n> \n> I just wanted to double check if I'm supposed to install them manually,\n> or if I missed enabling some options (I looked through the top-level\n> meson_options.txt and meson.build files and I don't think I did.)\n\nFor now the status quo is that you have to install them manually, which\nindeed isn't optimal. It matches our Makefile, which never installed\nthose completions, either. But that by itself isn't a good enough\nargument from my perspective that it needs to be the same with Meson.\n\nThe biggest question though is whether distros are aligned enough for us\nto provide standard installation paths. That is, do all distros end up\ninstalling bash completion into \"/usr/share/bash-completion\"? What are\nthe desired directories for tcsh and zsh completion?\n\nIf there is enough standardization then yes, I totally think we should\nstart installing completion scripts automatically.\n\nPatrick\n"},{"id":"515457","messageId":"Z-wltqWraESmb-Lm@akshay.is","threadId":"63230","inReplyTo":"Z-u42Sm613hMj1Ft@pks.im","subject":"Re: meson: Installing completions","fromName":"Akshay Hegde","fromEmail":"lists+git@akshay.is","sentAt":"2025-04-01T17:43:18Z","receivedAt":"2025-04-01T17:43:35Z","isPatch":false,"sender":{"key":"lists+git@akshay.is","avatar":null},"body":"On 2025-04-01 11:58 +0200, Patrick Steinhardt wrote:\n>> I just wanted to double check if I'm supposed to install them manually,\n>> or if I missed enabling some options (I looked through the top-level\n>> meson_options.txt and meson.build files and I don't think I did.)\n>\n>For now the status quo is that you have to install them manually, which\n>indeed isn't optimal. It matches our Makefile, which never installed\n>those completions, either. But that by itself isn't a good enough\n>argument from my perspective that it needs to be the same with Meson.\n\nYup that seems entirely reasonable to me, and this was my initial\nthought. I don't have much of an issue installing them manually.\n\n>\n>The biggest question though is whether distros are aligned enough for us\n>to provide standard installation paths. That is, do all distros end up\n>installing bash completion into \"/usr/share/bash-completion\"? What are\n>the desired directories for tcsh and zsh completion?\n>\n>If there is enough standardization then yes, I totally think we should\n>start installing completion scripts automatically.\n\nWell I can't speak from any sort of authoritativeness here, but for zsh,\nthey are usually installed underneath the datadir (usually /usr/share),\nthen under zsh/site-functions. Of course, I don't know if that's true\nfor all distros.\n\nCould we extend meson_options to allow specification of bash/tcsh/zsh\ncompletion directories? If they are not empty, I think it would be\nreasonable to have meson install it automatically.\n\nEither way, I personally don't think it's too big a deal but would be\na good 'quality-of-life' improvement.\n\nCheers,\n-- \n\tAkshay\n\n"},{"id":"515474","messageId":"Z-yLvgkJnGm0CkG3@teonanacatl.net","threadId":"63230","inReplyTo":"Z-wltqWraESmb-Lm@akshay.is","subject":"Re: meson: Installing completions","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2025-04-02T00:58:38Z","receivedAt":"2025-04-02T00:58:41Z","isPatch":false,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Akshay Hegde wrote:\n> On 2025-04-01 11:58 +0200, Patrick Steinhardt wrote:\n>>The biggest question though is whether distros are aligned enough for us\n>>to provide standard installation paths. That is, do all distros end up\n>>installing bash completion into \"/usr/share/bash-completion\"? What are\n>>the desired directories for tcsh and zsh completion?\n>>\n>>If there is enough standardization then yes, I totally think we should\n>>start installing completion scripts automatically.\n> \n> Well I can't speak from any sort of authoritativeness here, but for zsh,\n> they are usually installed underneath the datadir (usually /usr/share),\n> then under zsh/site-functions. Of course, I don't know if that's true\n> for all distros.\n> \n> Could we extend meson_options to allow specification of bash/tcsh/zsh\n> completion directories? If they are not empty, I think it would be\n> reasonable to have meson install it automatically.\n\nHaving the ability to specify the install path seems like\nthe way to go, even if the default is used by most systems.\nFor Fedora, only the bash and tcsh completions are\ninstalled.  The latter is simply placed in:\n\n    /usr/share/git-core/contrib/completion/git-completion.tcsh\n\nand users need to make some adjustments to their startup\nscripts to use it, as documented in the file.  This was\nadded to the Fedora packages in:\n\n    commit dae8588\n    Author: Todd Zullinger <tmz@pobox.com>\n    Date:   Thu Jan 3 14:59:27 2013 -0500\n\n        For now, this just gets the file from contrib installed.  If there are\n        enough tcsh users that want it to be more automated, that can come\n        later.  For now, the directions in the file must be followed to enable\n        tcsh completion.\n\nIn the years I maintained git in Fedora, no one asked for\nany changes for tcsh.  Apparently, either no one uses that\nor they don't mind the manual work to configure it. :)\n\nIIRC, there are git completions installed by upstream zsh\nand installing git-completion.zsh site-wide is not generally\nagreed that everyone wants?  I'm not a zsh user, but I think\nthat's why I never installed it in the Fedora git packaging.\n(It does seem like an oversight that they aren't at least\ninstalled similarly to the tcsh completion.)\n\nFor reference, here are the locations for bash, fish, and\nzsh which Fedora uses.  This might be helpful in determining\nreasonable defaults (after comparing to other distributions,\nof course):\n\n    bash /usr/share/bash-completion/completions\n    fish /usr/share/fish/vendor_completions.d\n    zsh  /usr/share/zsh/site-functions\n\n-- \nTodd\n"},{"id":"515516","messageId":"Z-0gpxXBmt8G72Z9@pks.im","threadId":"63230","inReplyTo":"Z-yLvgkJnGm0CkG3@teonanacatl.net","subject":"Re: meson: Installing completions","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-04-02T11:33:59Z","receivedAt":"2025-04-02T11:34:08Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Apr 01, 2025 at 08:58:38PM -0400, Todd Zullinger wrote:\n> Akshay Hegde wrote:\n> > On 2025-04-01 11:58 +0200, Patrick Steinhardt wrote:\n> >>The biggest question though is whether distros are aligned enough for us\n> >>to provide standard installation paths. That is, do all distros end up\n> >>installing bash completion into \"/usr/share/bash-completion\"? What are\n> >>the desired directories for tcsh and zsh completion?\n> >>\n> >>If there is enough standardization then yes, I totally think we should\n> >>start installing completion scripts automatically.\n> > \n> > Well I can't speak from any sort of authoritativeness here, but for zsh,\n> > they are usually installed underneath the datadir (usually /usr/share),\n> > then under zsh/site-functions. Of course, I don't know if that's true\n> > for all distros.\n> > \n> > Could we extend meson_options to allow specification of bash/tcsh/zsh\n> > completion directories? If they are not empty, I think it would be\n> > reasonable to have meson install it automatically.\n> \n> Having the ability to specify the install path seems like\n> the way to go, even if the default is used by most systems.\n> For Fedora, only the bash and tcsh completions are\n> installed.  The latter is simply placed in:\n> \n>     /usr/share/git-core/contrib/completion/git-completion.tcsh\n> \n> and users need to make some adjustments to their startup\n> scripts to use it, as documented in the file.  This was\n> added to the Fedora packages in:\n> \n>     commit dae8588\n>     Author: Todd Zullinger <tmz@pobox.com>\n>     Date:   Thu Jan 3 14:59:27 2013 -0500\n> \n>         For now, this just gets the file from contrib installed.  If there are\n>         enough tcsh users that want it to be more automated, that can come\n>         later.  For now, the directions in the file must be followed to enable\n>         tcsh completion.\n> \n> In the years I maintained git in Fedora, no one asked for\n> any changes for tcsh.  Apparently, either no one uses that\n> or they don't mind the manual work to configure it. :)\n\nOne of the questions is whether we gain a lot by making this an option.\nIf packagers have to manually adapt the location they could just as well\ncopy the file by hand as there is no build step involved in the first\nplace. I also think that for Bash and zsh the locations are somewhat\nstable across distros these days, so ideally we could just build on that\nand not even provide an option in the first place?\n\nI'm mostly trying to avoid to eventually end up with tons of build\noptions. Ideally, we should just do the right thing and install the\ncompletion scripts into the correct location in the specified prefix.\n\nAt least if we can get away with it. It seems like the default location\nwould work alright for you on Fedora, and I assume that it would work\nalright for most of the other distros. So I'd refrain from introducing\nan option now, but if we eventually figure out that this is problematic\non some distro then we can still introduce the option at a later point\nin time.\n\n> IIRC, there are git completions installed by upstream zsh\n> and installing git-completion.zsh site-wide is not generally\n> agreed that everyone wants?  I'm not a zsh user, but I think\n> that's why I never installed it in the Fedora git packaging.\n> (It does seem like an oversight that they aren't at least\n> installed similarly to the tcsh completion.)\n> \n> For reference, here are the locations for bash, fish, and\n> zsh which Fedora uses.  This might be helpful in determining\n> reasonable defaults (after comparing to other distributions,\n> of course):\n> \n>     bash /usr/share/bash-completion/completions\n>     fish /usr/share/fish/vendor_completions.d\n>     zsh  /usr/share/zsh/site-functions\n\nWe don't have completions for the Fish shell, right? Just making sure\nthat I don't miss the obvious.\n\nPatrick\n"},{"id":"515520","messageId":"Z-1EJo8xHpA9qM0-@teonanacatl.net","threadId":"63230","inReplyTo":"Z-0gpxXBmt8G72Z9@pks.im","subject":"Re: meson: Installing completions","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2025-04-02T14:05:26Z","receivedAt":"2025-04-02T14:05:28Z","isPatch":false,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Patrick Steinhardt wrote:\n> On Tue, Apr 01, 2025 at 08:58:38PM -0400, Todd Zullinger wrote:\n[...]\n> One of the questions is whether we gain a lot by making this an option.\n> If packagers have to manually adapt the location they could just as well\n> copy the file by hand as there is no build step involved in the first\n> place. I also think that for Bash and zsh the locations are somewhat\n> stable across distros these days, so ideally we could just build on that\n> and not even provide an option in the first place?\n> \n> I'm mostly trying to avoid to eventually end up with tons of build\n> options. Ideally, we should just do the right thing and install the\n> completion scripts into the correct location in the specified prefix.\n> \n> At least if we can get away with it. It seems like the default location\n> would work alright for you on Fedora, and I assume that it would work\n> alright for most of the other distros. So I'd refrain from introducing\n> an option now, but if we eventually figure out that this is problematic\n> on some distro then we can still introduce the option at a later point\n> in time.\n\nYeah, if the locations are the same across all of the\nsystems we aim to support are consistent, then I agree\nthere's not a lot of point making it configurable.\n\nWhether that turns out to be the case or not will be\ninteresting.  It seems like there are almost always a few\nsystems that do things differently for one reason or\nanother.  With luck, this is an exception.\n\n>> For reference, here are the locations for bash, fish, and\n>> zsh which Fedora uses.  This might be helpful in determining\n>> reasonable defaults (after comparing to other distributions,\n>> of course):\n>> \n>>     bash /usr/share/bash-completion/completions\n>>     fish /usr/share/fish/vendor_completions.d\n>>     zsh  /usr/share/zsh/site-functions\n> \n> We don't have completions for the Fish shell, right? Just making sure\n> that I don't miss the obvious.\n\nHeh, we don't -- as far as I know either. :)\n\nThose three just happen to be the shells which have a\npackaging macro for the path in Fedora.\n\nCheers,\n\n-- \nTodd\n"},{"id":"515745","messageId":"Z_OGVDZ9cMwavfR8@pks.im","threadId":"63230","inReplyTo":"Z-1EJo8xHpA9qM0-@teonanacatl.net","subject":"Re: meson: Installing completions","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-04-07T08:01:24Z","receivedAt":"2025-04-07T08:01:28Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Apr 02, 2025 at 10:05:26AM -0400, Todd Zullinger wrote:\n> Patrick Steinhardt wrote:\n> > On Tue, Apr 01, 2025 at 08:58:38PM -0400, Todd Zullinger wrote:\n> [...]\n> > One of the questions is whether we gain a lot by making this an option.\n> > If packagers have to manually adapt the location they could just as well\n> > copy the file by hand as there is no build step involved in the first\n> > place. I also think that for Bash and zsh the locations are somewhat\n> > stable across distros these days, so ideally we could just build on that\n> > and not even provide an option in the first place?\n> > \n> > I'm mostly trying to avoid to eventually end up with tons of build\n> > options. Ideally, we should just do the right thing and install the\n> > completion scripts into the correct location in the specified prefix.\n> > \n> > At least if we can get away with it. It seems like the default location\n> > would work alright for you on Fedora, and I assume that it would work\n> > alright for most of the other distros. So I'd refrain from introducing\n> > an option now, but if we eventually figure out that this is problematic\n> > on some distro then we can still introduce the option at a later point\n> > in time.\n> \n> Yeah, if the locations are the same across all of the\n> systems we aim to support are consistent, then I agree\n> there's not a lot of point making it configurable.\n> \n> Whether that turns out to be the case or not will be\n> interesting.  It seems like there are almost always a few\n> systems that do things differently for one reason or\n> another.  With luck, this is an exception.\n> \n> >> For reference, here are the locations for bash, fish, and\n> >> zsh which Fedora uses.  This might be helpful in determining\n> >> reasonable defaults (after comparing to other distributions,\n> >> of course):\n> >> \n> >>     bash /usr/share/bash-completion/completions\n> >>     fish /usr/share/fish/vendor_completions.d\n> >>     zsh  /usr/share/zsh/site-functions\n> > \n> > We don't have completions for the Fish shell, right? Just making sure\n> > that I don't miss the obvious.\n> \n> Heh, we don't -- as far as I know either. :)\n> \n> Those three just happen to be the shells which have a\n> packaging macro for the path in Fedora.\n> \n> Cheers,\n\nI've sent a patch via [1] now. Thanks!\n\nPatrick\n\n[1]: <20250407-b4-pks-meson-install-completions-v1-1-8a7eb8b9284b@pks.im>\n"}]}