'; }
Bug 292501 - shells/bash-completion: Don't hard depend on bash
Summary: shells/bash-completion: Don't hard depend on bash
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Osipov
URL:
Keywords:
Depends on:
Blocks: 292138
  Show dependency treegraph
 
Reported: 2026-01-16 11:15 UTC by Michael Osipov
Modified: 2026-05-08 21:52 UTC (History)
2 users (show)

See Also:
sunpoet: maintainer-feedback+


Attachments
Git-formatted patch (2.49 KB, patch)
2026-02-04 15:36 UTC, Michael Osipov
no flags Details | Diff
Git-formatted patch (2.43 KB, patch)
2026-02-16 09:19 UTC, Michael Osipov
michaelo: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov freebsd_committerfreebsd_triage 2026-01-16 11:15:48 UTC
Coming from Bug 292138...

It turns out that bash-completion depends on bash, though technically not required since bash should always be installed as a direct package. The problem is that packages like graphics/colord need the pkg-config file to know where to install its completion file even if bash is never used by the user/client. The problem is that the use of the pc file pulls in quite some build dependencies for bash-completion and the bash itself.

Request is not to depend on bash anymore and let the user decide what bash (dynamic or static) he wants to install. See also comment https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292138#c7.
Comment 1 Michael Osipov freebsd_committerfreebsd_triage 2026-02-04 10:34:13 UTC
Maintainer, gentle ping...
Comment 2 Gleb Popov freebsd_committerfreebsd_triage 2026-02-04 10:35:45 UTC
You can create a patch and wait for a timeout.
Comment 3 Michael Osipov freebsd_committerfreebsd_triage 2026-02-04 11:25:56 UTC
(In reply to Gleb Popov from comment #2)

True, will do.
Comment 4 Michael Osipov freebsd_committerfreebsd_triage 2026-02-04 15:36:20 UTC
Created attachment 267777 [details]
Git-formatted patch

Patch removes hard dependency during build/run time.
Comment 5 Po-Chuan Hsieh freebsd_committerfreebsd_triage 2026-02-12 13:06:12 UTC
(In reply to Michael Osipov from comment #0)

I do not follow you.

You need the shell (bash) to run the completions. Therefore, it is reasonable to add bash as runtime dependency.

> let the user decide what bash (dynamic or static) he wants to install.

The BASH_SHARED and BASH_STATIC options allow the users to choose what they want.
Comment 6 Gleb Popov freebsd_committerfreebsd_triage 2026-02-12 13:20:12 UTC
(In reply to Po-Chuan Hsieh from comment #5)
Completions are static data files and can be interpreted in various ways. bash is just one of possible consumers, so it shouldn't be a dependency.
Comment 7 Michael Osipov freebsd_committerfreebsd_triage 2026-02-16 09:19:42 UTC
Created attachment 268090 [details]
Git-formatted patch

(In reply to Po-Chuan Hsieh from comment #5)

Sure, let me rephrase:

Gleb pointed out that this is a static resource it should not depend on an application, but rather the application on the resource. Consider that we have tens of ports installing shell completion. From your PoV they all should depend on bash-completion and bash since otherwise it does not make sense because those completion files are installed by default, but not everyone wants to use bash. If you want to use bash you have to install it directly otherwise it is bad dependency management. Also read the point your pkg-config, in those build cases they pull in something which isn't required at all.
Yet another issue is that if you have istalled shells/bash-static and want to install bash-completion from packages you can't because it requires a non-default option.

I believe that these need correction because of the above:
$ grep -r --include=*/Makefile shells/bash-completion . | grep RUN_DEPENDS
./databases/mdbtools/Makefile:RUN_DEPENDS=      bash-completion>=0:shells/bash-completion
./multimedia/x264/Makefile:BASH_RUN_DEPENDS=    bash-completion>0:shells/bash-completion
./net/onedrive/Makefile:COMPLETION_RUN_DEPENDS=         bash-completion>0:shells/bash-completion
./security/lastpass-cli/Makefile:BASH_RUN_DEPENDS=      bash-completion>=0:shells/bash-completion

Patch has been updated.

Another comparison: You won't install git if you need curl or both, you will install both because you will use both directly...
Comment 8 Michael Osipov freebsd_committerfreebsd_triage 2026-03-07 13:33:57 UTC
Any Feedback?
Comment 9 Michael Osipov freebsd_committerfreebsd_triage 2026-04-09 15:33:45 UTC
Maintainer timeout?
Comment 10 Michael Osipov freebsd_committerfreebsd_triage 2026-04-28 07:36:21 UTC
One more ping.
Comment 11 Po-Chuan Hsieh freebsd_committerfreebsd_triage 2026-05-07 08:41:10 UTC
OK. You could commit it.

But please do not add superfluous tab after OPTIONS_DEFAULT=.
And I feel that the UPDATING entry is not needed. It's up to you.

Thanks.
Comment 12 commit-hook freebsd_committerfreebsd_triage 2026-05-08 21:51:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e4be0dc2b3dd3c46612aee9ef4a7851b4e4647a

commit 7e4be0dc2b3dd3c46612aee9ef4a7851b4e4647a
Author:     Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-02-04 12:09:30 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-05-08 21:49:21 +0000

    shells/bash-completion: Don't depend on shells/bash{,-static}

    Depending on the shell itself during build time create a large dependency
    chain. E.g., using the pc file of this port requires bash being built although
    technically not required at all. Have the user install bash as a direct
    dependency.

    PR:             292501
    Tested by:      michaelo
    Approved by:    sunpoet (maintainer)

 UPDATING                        |  7 +++++++
 shells/bash-completion/Makefile | 10 ++--------
 2 files changed, 9 insertions(+), 8 deletions(-)
Comment 13 Michael Osipov freebsd_committerfreebsd_triage 2026-05-08 21:52:48 UTC
(In reply to Po-Chuan Hsieh from comment #11)

Done, thank you!