View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Thu Jun 06, 2024 8:36 am Post subject: Build-time and runtime dependencies |
|
|
Hi folks
When I look at the dependency tree for, say, 'vim', I see dependencies on git, python, perl, ruby, and autoconf. So far as I know, vim does not require any of these things at runtime. I'm guessing that some of these are build-time dependencies, needed to build that package from source.
Would these things still get installed if I installed the binary release, rather than building from source?
I note that, right now, 'git' is not on my system, despite being a dependency of 'vim', which is. Is this because it got removed in a clean-up operation? If there is a difference between build-time and runtime dependences, does that difference affect cleanup?
If 'git' was installed when I installed 'vim', can I prevent it being cleaned up, if I actually want to use it?
Sorry if this is inarticulate -- I'm just trying to understand how things work.
BR, Lars |
|
Back to top |
|
|
xgivolari Tux's lil' helper
Joined: 26 Jul 2021 Posts: 102
|
Posted: Thu Jun 06, 2024 8:54 am Post subject: |
|
|
Ebuilds can declare different kinds of dependencies:
DEPEND: these need to be found at build time (e.g. libraries)
BDEPEND: programs that need to be executed at build time (e.g. pkgconf)
RDEPEND: required at runtime
PDEPEND: required at runtime, may be merged after the the package requiring it.
For binary packages, only RDEPEND and PDEPEND are satisfied. If you want to merge build time dependencies for a binary package as well, you can do so with the emerge argument "--with-bdeps=y"
For more information, check out the Dependencies article of the Gentoo development guide.
To find out what kind of dependency an ebuild declares, you can use "qdepends -v" (part of app-portage/portage-utils). E.g. for vim:
Code: | app-editors/vim-9.1.0366:
DEPEND="
>=app-eselect/eselect-vi-1.1
>=sys-libs/ncurses-5.2-r2:0/6=
virtual/libintl
sys-apps/acl
dev-libs/libsodium:0/26=
>=sys-libs/gpm-1.19.3
~app-editors/vim-core-9.1.0366
media-libs/libcanberra
x11-libs/libXt
x11-base/xorg-proto
"
RDEPEND="
>=app-eselect/eselect-vi-1.1
>=sys-libs/ncurses-5.2-r2:0/6=
virtual/libintl
sys-apps/acl
dev-libs/libsodium:0/26=
>=sys-libs/gpm-1.19.3
~app-editors/vim-core-9.1.0366
media-libs/libcanberra
x11-libs/libXt
>=sys-libs/glibc-2.39-r5
"
PDEPEND="
app-vim/gentoo-syntax
"
BDEPEND="
dev-build/autoconf
sys-devel/gettext
"
|
|
|
Back to top |
|
|
xgivolari Tux's lil' helper
Joined: 26 Jul 2021 Posts: 102
|
Posted: Thu Jun 06, 2024 9:07 am Post subject: |
|
|
If you query dependencies with equery g, it lists all possible dependencies. However, vim for example only depends on ruby if you enable its ruby USE-flag. Because this flag is not enabled by default, a binary package of vim will not pull in ruby. AFAICT, the only case where vim depends on git is if you build it from a live ebuild (i.e. vim-9999). In that case it is a dependency of git-r3.eclass, which is the eclass that handles building packages from git branches or commits. |
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Thu Jun 06, 2024 10:22 am Post subject: |
|
|
Thanks.
This is much more complicated than I expected it to be, and I expected it to be complicated
BR, Lars |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22685
|
Posted: Thu Jun 06, 2024 3:02 pm Post subject: |
|
|
How exactly are you looking at the dependency tree? As described above, there are many subtleties, and different tools may provide different levels of explanation. |
|
Back to top |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 522
|
Posted: Thu Jun 06, 2024 6:26 pm Post subject: |
|
|
Hu wrote: | How exactly are you looking at the dependency tree? As described above, there are many subtleties, and different tools may provide different levels of explanation. |
I've just been doing `equery g` but, from previous comments, it looks as if `qdepends -v` gives more detailed information. I was prepared for their to b different build-time and runtime dependencies; I was surprised, however, to see how many different kinds there are.
BR, Lars. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|