Discussion:
Build-Depends vs Depends
(too old to reply)
Taylor Kline
2016-12-30 04:50:01 UTC
Permalink
What is the difference? How are they treated differently during the
apt installation process? Thanks :)
Harlan Lieberman-Berg
2016-12-30 05:50:02 UTC
Permalink
Post by Taylor Kline
What is the difference? How are they treated differently during the
apt installation process? Thanks :)
Build-Depends is used only during build-time. (Usually on the buildds,
though it can be on developer's computers as well.)

Depends, on the other hand, are packages that are required for the
package to /run/, and must be installed on the users' machines.

For certain packages that are interpreted, rather than compiled, these
are frequently the same list. (Think: python packages that don't have C
extensions).

Hope that makes sense!

Sincerely,
--
Harlan Lieberman-Berg
~hlieberman
Narcis Garcia
2016-12-30 10:20:01 UTC
Permalink
Build-Depends should not make any effect during package installation
process, because it's a dependency only for package-building process.



__________
I'm using this express-made address because personal addresses aren't
masked enough at lists.debian.org archives.
Post by Taylor Kline
What is the difference? How are they treated differently during the
apt installation process? Thanks :)
Ben Finney
2017-01-02 00:10:01 UTC
Permalink
What is the difference [between the “Build-Depends” field and the
“Depends” field]?
The difference is precisely that between building the package from
source, versus using the package installed.

The “Build-Depends” and “Build-Depends-Indep” fields appear only in the
source package stanza.

The “Depends” field appears only in a binary package stanza.

See Debian Polcy §5.2 for a summary, and §5 generally for a description
of what these fields mean.
How are they treated differently during the apt installation process?
The installation process (the ‘dpkg’ tool does the actual installation
of an individual package) cares only about “Depends”, the declaration of
what other packages must be installed for this one to work.

The package build servers care about “Build-Depends” and
“Build-Depends-Indep”, because the job they're doing is not to use the
package but to build it from source.
--
\ “Computers are useless. They can only give you answers.” —Pablo |
`\ Picasso |
_o__) |
Ben Finney
Octavio Alvarez
2017-01-02 08:20:01 UTC
Permalink
Post by Ben Finney
What is the difference [between the “Build-Depends” field and the
“Depends” field]?
The difference is precisely that between building the package from
source, versus using the package installed.
For example, a compiler is needed during build time, but it's not needed
to run the program so it would qualify for Build-Depends but not
for Depends.

Build-Depends is used during "apt build-dep" (used for compilation and
building the package) and Depends is used during "apt install".

Best regards.
--
Octavio.
Taylor Kline
2017-01-02 14:30:02 UTC
Permalink
Thank you, Octavio. Does this mean apt will temporarily install the
Build-Depends
packages and remove them after the installation completes?
Andrey Rahmatullin
2017-01-02 14:40:01 UTC
Permalink
Post by Taylor Kline
Thank you, Octavio. Does this mean apt will temporarily install the
Build-Depends
packages and remove them after the installation completes?
apt doesn't build the package during install. Packages that you install
are already built.
--
WBR, wRAR
Ben Finney
2017-01-02 21:10:02 UTC
Permalink
Post by Taylor Kline
Thank you, Octavio. Does this mean apt
You mean ‘dpkg’.

APT is a tool to fetch packages and to make requests to ‘dpkg’. It is
‘dpkg’'s job to do the actual install/remove of each individual package.
Post by Taylor Kline
will temporarily install the Build-Depends packages and remove them
after the installation completes?
No.

The purpose of the build process is to generate a product that is ready
to install. The build dependencies are not needed after the build is
complete.
--
\ “Pinky, are you pondering what I'm pondering?” “Well, I think |
`\ so, Brain, but pantyhose are so uncomfortable in the |
_o__) summertime.” —_Pinky and The Brain_ |
Ben Finney
Octavio Alvarez
2017-01-02 22:00:02 UTC
Permalink
Post by Taylor Kline
Thank you, Octavio. Does this mean apt will temporarily install
the Build-Depends packages and remove them after the installation
completes?
If you are using "apt install" then the packages under Build-Depends are
not installed at all, only those under Depends, and, because they are
needed for the program to work, those are not uninstalled after
installation.

If you are using "apt build-dep" then you are specifically requesting
APT to install packages lised under Build-Depends.

Hope this clarifies everything.

Best regards.
Taylor Kline
2017-01-03 18:10:02 UTC
Permalink
On Jan 2, 2017 4:56 PM, "Octavio Alvarez" <***@alvarezp.org> wrote:

If you are using "apt install" then the packages under Build-Depends are
not installed at all, only those under Depends, and, because they are
needed for the program to work, those are not uninstalled after
installation.

If you are using "apt build-dep" then you are specifically requesting
APT to install packages lised under Build-Depends.

Hope this clarifies everything.

Best regards.


Thanks, that does help a lot, and it helped me to realize that the packages
are built on the Debian machines and sent to users already built, so
there's no need for the users to install the Build-Depends, right?
Andrey Rahmatullin
2017-01-03 18:20:01 UTC
Permalink
Post by Taylor Kline
Thanks, that does help a lot, and it helped me to realize that the packages
are built on the Debian machines and sent to users already built, so
there's no need for the users to install the Build-Depends, right?
Right.
--
WBR, wRAR
Paul Wise
2017-01-04 02:40:02 UTC
Permalink
Post by Taylor Kline
Thanks, that does help a lot, and it helped me to realize that the packages
are built on the Debian machines and sent to users already built, so there's
no need for the users to install the Build-Depends, right?
Right, except users might want to build packages themselves, in that
case they would have to install the Build-Depends on the machine or
chroot where they are doing the building. There are several tools to
setup an isolated environment and install build-depends automatically.

https://wiki.debian.org/sbuild
https://wiki.debian.org/pbuilder
https://wiki.debian.org/cowbuilder
https://wiki.debian.org/qemubuilder
https://packages.debian.org/whalebuilder

There are a few reasons users might want to build packages:

Customising the packages for their needs.

Rebuilding packages against newer versions of dependencies.

Rebuilding packages for older Debian releases.

Verifying that the source corresponds to the binaries:

https://wiki.debian.org/ReproducibleBuilds
--
bye,
pabs

https://wiki.debian.org/PaulWise
Taylor Kline
2017-01-04 17:40:02 UTC
Permalink
Post by Taylor Kline
Thanks, that does help a lot, and it helped me to realize that the packages
are built on the Debian machines and sent to users already built, so there's
no need for the users to install the Build-Depends, right?
Right, except users might want to build packages themselves, in that
case they would have to install the Build-Depends on the machine or
chroot where they are doing the building. There are several tools to
setup an isolated environment and install build-depends automatically.

https://wiki.debian.org/sbuild
https://wiki.debian.org/pbuilder
https://wiki.debian.org/cowbuilder
https://wiki.debian.org/qemubuilder
https://packages.debian.org/whalebuilder

There are a few reasons users might want to build packages:

Customising the packages for their needs.

Rebuilding packages against newer versions of dependencies.

Rebuilding packages for older Debian releases.

Verifying that the source corresponds to the binaries:

https://wiki.debian.org/ReproducibleBuilds

--
bye,
pabs

https://wiki.debian.org/PaulWise


Extremely helpful, Paul, thanks so much for clearing that up 😊😊
Paul Wise
2017-01-03 03:10:01 UTC
Permalink
Post by Taylor Kline
What is the difference? How are they treated differently during the
apt installation process? Thanks :)
You might be interested in looking at some of these diagrams to
discover more about how Debian works:

https://wiki.debian.org/Diagrams

You can look up any confusing jargon you find in this glossary:

https://wiki.debian.org/Glossary
--
bye,
pabs

https://wiki.debian.org/PaulWise
Taylor Kline
2017-01-03 18:10:01 UTC
Permalink
On Jan 2, 2017 10:06 PM, "Paul Wise" <***@debian.org> wrote:

You might be interested in looking at some of these diagrams to
discover more about how Debian works:

https://wiki.debian.org/Diagrams

You can look up any confusing jargon you find in this glossary:

https://wiki.debian.org/Glossary

--
bye,
pabs

https://wiki.debian.org/PaulWise


Very cool, thanks!
Loading...