You are not logged in.

#1 2014-06-26 18:02:06

bitsdd
Member
Registered: 2014-06-26
Posts: 34

How package dependency works??

First of all hello all smile

As we know that there are packages that depend on certain other packages, but i wonder how??

my case:

i installed firefox via

$ pacman -S firefox

and it installed perfectly but when i started firefox obviously

$ firefox

then it actually didn't worked, for which the reason was i didn't installed xserver.

??should not xserver be also in the dependency of firefox.


Is there any cookies because i'm all about arch arch arch....

Offline

#2 2014-06-26 18:23:24

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: How package dependency works??

You could in theory use an xserver on a different computer, and display the program there.  That would make an xserver unnecessary on your computer.  Really, you are expected to know that graphical programs require an xserver, at least until wayland becomes more usable.  If it were less obvious, it might be listed as an optdepend, meaning pacman would not install it automatically, but would display a notice about it.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#3 2014-06-26 18:30:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: How package dependency works??

Try pacman -Syu firefox


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2014-06-26 18:40:31

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

Thanks for replying smile
and yeah i know that xserver is the initial requirement to run any gui program but then xserver is not even in the optional dependency and what i'm actually interested in the logic behind package dependency and why xserver is missing from the list. ??Isn't there a some kinda dynamic approach to create a package dependency list to feed to pacman, in that way we don't need to worry about such things.


Is there any cookies because i'm all about arch arch arch....

Offline

#5 2014-06-26 18:40:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: How package dependency works??

If you installed firefox properly, it would have installed the X-related dependencies.  Firefox depends on gtk2, gtk2 depends on cairo, cairo depends on pixman, and pixman depends on xorg-server.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2014-06-26 18:51:50

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: How package dependency works??

Trilby wrote:

If you installed firefox properly, it would have installed the X-related dependencies.  Firefox depends on gtk2, gtk2 depends on cairo, cairo depends on pixman, and pixman depends on xorg-server.

Are you sure about pixman?

>pacman -Qi pixman
Name           : pixman
Version        : 0.32.4-1
Description    : The pixel-manipulation library for X and cairo
Architecture   : x86_64
URL            : http://xorg.freedesktop.org
Licenses       : custom
Groups         : None
Provides       : None
Depends On     : glibc
Optional Deps  : None
Required By    : cairo  enlightenment  qemu  spice  texlive-bin  weston-git  xf86-video-intel  xorg-server
                 xorg-server-xephyr  xorg-server-xvfb  xwayland-git
[...]

It looks like it's the other way around: xorg-server depends on pixman.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#7 2014-06-26 18:51:59

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

Trilby wrote:

If you installed firefox properly, it would have installed the X-related dependencies.

Sorry?? i did,

$ pacman -S firefox

what should i do more.

ewaller wrote:

Try pacman -Syu firefox

I already installed xserver so i guess i need to uninstall it and then check if it works.


Is there any cookies because i'm all about arch arch arch....

Offline

#8 2014-06-26 18:55:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: How package dependency works??

As Trilby points out, it takes care of it for you.  I am suggesting that your system is not up to date.
The other possibility is that it is there, but won't run because of a configuration problem with your machine.
You did not even tell us what window manager you plan to use.  For all we know, you tried that firefox command from the console.  Sadly, all you have told us is "It actually didn't [sic]worked".  What (specifically) was the output when you did that?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2014-06-26 19:02:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: How package dependency works??

ids1024 wrote:

It looks like it's the other way around: xorg-server depends on pixman.

Oops - you're quite right.  I went through them a little too fast.  Nonetheless I'm pretty sure it's in the dependency chain somewhere.

EDIT: xorg-server is not actually in the dep tree anywhere - but all the x-related libs are.  I gather this is because as implied above, anything that can take the place of the xserver (i.e. drop-in replacement or xserver on another machine) would be sufficient.

Last edited by Trilby (2014-06-26 19:06:31)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2014-06-26 19:05:12

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

ewaller wrote:

You did not even tell us what window manager you plan to use

Sorry, to all for that.
But it's a new arch installation for which i'm using dwm.

I was kinda experimenting to see if pacman -S firefox will install xserver too, but it didn't and that's when i wonder "how package dependency works"


Is there any cookies because i'm all about arch arch arch....

Offline

#11 2014-06-26 19:05:52

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: How package dependency works??

Trilby wrote:
ids1024 wrote:

It looks like it's the other way around: xorg-server depends on pixman.

Oops - you're quite right.  I went through them a little too fast.  Nonetheless I'm pretty sure it's in the dependency chain somewhere ... let me see ...

Only the client libraries like libx11 are in the dependency tree (use pactree). Maybe some package lists the server as an optional dependency, but it is not a hard one.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#12 2014-06-26 19:08:33

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: How package dependency works??

Trilby wrote:

EDIT: xorg-server is not actually in the dep tree anywhere - but all the x-related libs are.  I gather this is because as implied above, anything that can take the place of the xserver (i.e. drop-in replacement or xserver on another machine) would be sufficient.

pactree -r xorg-server doesn't show firefox...


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#13 2014-06-26 19:10:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: How package dependency works??

clfarron4 wrote:

pactree -r xorg-server doesn't show firefox... anything

Get rid of that bloatware! wink


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#14 2014-06-26 19:39:49

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How package dependency works??

ewaller wrote:

As Trilby points out, it takes care of it for you.  I am suggesting that your system is not up to date.
The other possibility is that it is there, but won't run because of a configuration problem with your machine.
You did not even tell us what window manager you plan to use.  For all we know, you tried that firefox command from the console.  Sadly, all you have told us is "It actually didn't [sic]worked".  What (specifically) was the output when you did that?

bitsdd was asking a conceptual / educational question, not a technical one. It's a question that I often have too: What defines something as a dependency? For example, is an X server a dependency for an X application? Is gtk2 a dependency for installing a GTK2 theme? A line has to be drawn somewhere.

Offline

#15 2014-06-26 20:47:46

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: How package dependency works??

drcouzelis wrote:

A line has to be drawn somewhere.

In the context of this question, this is the crux of the problem.

I was going to say that a hard dependency for a program is the bare minimum necessary to get the damn thing to run. In the case of a kernel package (like the ones I manage), it's quite easy (well, we can argue about that).

In the case of Firefox, I realised my answer was a load of b******s, because you have the X server, drivers (going one way), desktop environments/WMs (going the other). Thing with Firefox is I'd assume you'd know you'd need to setup the X server and drivers before going and running Firefox (and that's a big assumption in itself).

So, can we make an improvement on what I initially said? I'm not so sure


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#16 2014-06-26 21:10:06

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How package dependency works??

Common sense is a hard dependency in Arch; that and remaining awake at the keyboard...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#17 2014-06-26 21:14:27

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: How package dependency works??

clfarron4 wrote:

I was going to say that a hard dependency for a program is the bare minimum necessary to get the damn thing to run. In the case of a kernel package (like the ones I manage), it's quite easy (well, we can argue about that).

I use something like this rule: Hard dependencies should be everything you need to run the main application without segfaults. A missing x server does not result in a segfault I think. Secondary applications which are part of the package are allowed to segfault when only hard dependencies are available, but the necessary packages have to be listed as optdepends.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#18 2014-06-26 22:06:06

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: How package dependency works??

progandy wrote:
clfarron4 wrote:

I was going to say that a hard dependency for a program is the bare minimum necessary to get the damn thing to run. In the case of a kernel package (like the ones I manage), it's quite easy (well, we can argue about that).

I use something like this rule: Hard dependencies should be everything you need to run the main application without segfaults. A missing x server does not result in a segfault I think. Secondary applications which are part of the package are allowed to segfault when only hard dependencies are available, but the necessary packages have to be listed as optdepends.

Yeah, I can accept that.

Just tried running firefox in TTY1 and it kicked out a glib error and no display specified. The journal didn't seem to log any segfaults about firefox either.

jasonwryan wrote:

Common sense is a hard dependency in Arch; that and remaining awake at the keyboard...

Well... I haven't much common sense (I really mean it). Remaining awake at the keyboard I can do, unless I'm epically drunk (however, I typically am hugging someone when I'm drunk so this claim is yet to be tested).

Last edited by clfarron4 (2014-06-26 22:08:22)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#19 2014-06-27 06:34:10

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

clfarron4 wrote:

Thing with Firefox is I'd assume you'd know you'd need to setup the X server and drivers before going and running Firefox (and that's a big assumption in itself).

If that's it i think pacman lacks a dynamic approach.
i'm not saying pacman is bad(how can i say that "i love pacman") but it is just irritating to know the fact that one package is clearly dependent on other

clfarron4 wrote:

(and that's a big assumption in itself

but still it is not in the dependency list.

jasonwryan wrote:

Common sense is a hard dependency in Arch; that and remaining awake at the keyboard...

<--------------------------------------------------------------------------------------------------------------------------------------------------------->
I'm little confused about, where is this thread going as my "main question" is "How package dependency works " and not about firefox/xsever  i used it as an example to clearly state my question, like how pacman checks for the packages that need to be installed before that main package itself and who creates that list of packages(did pacman itself do that) or some dev put it there.

Last edited by bitsdd (2014-06-27 06:35:50)


Is there any cookies because i'm all about arch arch arch....

Offline

#20 2014-06-27 06:52:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How package dependency works??

It's easy enough to look at the PKGBUILD's depends array to see what the developer has included:
https://projects.archlinux.org/svntogit … es/firefox


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#21 2014-06-27 07:14:59

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

jsonwryan wrote:

It's easy enough to look at the PKGBUILD's depends array to see what the developer has included

Thanks!! I think that's what i looking for. but still thinks pacman needs a dynamic boost for such cases.


Is there any cookies because i'm all about arch arch arch....

Offline

#22 2014-06-27 07:19:53

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: How package dependency works??

What's a dynamic boost?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#23 2014-06-27 07:24:25

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: How package dependency works??

bitsdd wrote:
jsonwryan wrote:

It's easy enough to look at the PKGBUILD's depends array to see what the developer has included

Thanks!! I think that's what i looking for. but still thinks pacman needs a dynamic boost for such cases.

Package maintainers can run the package through namcap and check for missing and superfluous dependencies. Just remember not to take the output at face value and use common sense when modifying the arrays.
Most dependencies should be easy even without namcap. All the hard stuff should be included in the build instructions provided by the hard working upstream developers. package maintainers "only" take that and convert it into a valid arch package.

Last edited by progandy (2014-06-27 07:28:49)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#24 2014-06-27 08:55:17

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: How package dependency works??

progandy wrote:

Package maintainers can run the package through namcap and check for missing and superfluous dependencies. Just remember not to take the output at face value and use common sense when modifying the arrays.
Most dependencies should be easy even without namcap. All the hard stuff should be included in the build instructions provided by the hard working upstream developers. package maintainers "only" take that and convert it into a valid arch package.

Are you saying that upstream dev (firefox developers or arch developer ??who) create dependency tree in context of firefox and package maintainers just copy that tree and create packages.

And they should not to that and instead they should create the dep tree in context of arch(OS) and not that particular package. right??

jasonwryan wrote:

What's a dynamic boost?

Sorry that's my kinda noobish slang, as i previously thought that pacman dynamically checks for dependencies like:
what i thought what happens??

->$pacman -S firefox (install firefox)
->installation process gives error of some missing packages that must be installed before ff
->those error was parsed and packages were fed to pacman
->pacman installs those packages and recursively checks for the error in installation process to install other packages like xserver.

It may be vague but that's what i thought.
But i now i think it's the PKGBUILD who does all the work.


Is there any cookies because i'm all about arch arch arch....

Offline

#25 2014-06-27 09:09:39

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: How package dependency works??

Have you taken a look at any PKGBUILD? There are "depends", "makedepends" and "optdepends" lines in PKGBUILD. First lists packages that are needed to run the application, second lists packages needed to build the application, and third lists packages that provide additional functionallity but are not needed for the application to work.

Example of not listing all the (opt)dependancies is the maintainers assume users have installed the whole base-devel group. Also it is common sense (as told by jasonwrian) to have X installed if you want to run firefox, so making X a dependancy of firefox is not really necessary. You are also supposed to have bash installed so that may not be a dependacy even if an application needs itto work. Again it is common sense.

As for your suggestion of pacman dynamically resolving dependacies (in my opininon) goes agains the arch way. It simplifies things for the user by hiding what is going on "under the hood" and make developers job more difficult.

Offline

Board footer

Powered by FluxBB