Dependencies.

Once upon a time, I was doing a server setup at work, installing all the various prerequisites and utilities to support the things we use. One part of that involves installing Jing, which we use for XML validation; Jing is written in Java, and so we use gcj (the GNU Java compiler) to compile it for use, ending up with a nice little binary we can call from anywhere.

Now, we’ve standardized on Ubuntu for our servers, so installing gcj should be as simple as apt-get install gcj (or, more often, aptitude install gcj, since aptitude is a bit nicer). But when I did that I was greeted with a dizzying array of required dependencies, including an X11 window server and a whole raft of graphical toolkit libraries; all told, gcj had, at that time, 44 required dependencies, and around 60 when “recommended” packages were included.

Yes, you read that right: 44 required packages, including a full graphical user environment, just to get a compiler.

Recently I’ve been doing a bit of fiddling with LaTeX; I used to be semi-proficient with it, but a few years of not using it have left me rather rusty. I’ve got a Thinkpad running Linux which, naturally, has an insanely high-powered TeX-based text-processing system ready to go out of the box, but since the Apple laptop is my primary machine these days I wanted to have an environment set up there as well. I didn’t have MacPorts installed (I used to, but nuked it a while back when I realized I wasn’t really using anything from it), but I’d had good experiences with it in the past and figured that’d be an easy way to get everything set up.

Once I had MacPorts installed, I went looking through the “tex” category in its package listing to figure out what I’d need; the XeTeX package looked like the right one, so I popped open a new window in screen and dutifully typed sudo port install XeTeX. I was rewarded with:

$ sudo port install XeTeX
--->  Fetching XFree86
--->  Attempting to fetch XFree86-4.7.0-src-1.tgz from http://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.xfree86.org/XFree86/4.7.0/source/

That was a bit unexpected. It turns out that MacPorts’ TeX packages have a hard-wired dependency on XFree86.

Yes, you read that right: TeX, which can be and often is used exclusively from console-based environments, has a hard dependency on an X11 window server. There is a nox11 variant of the base teTeX package (which, amazingly, is not in the “tex” category), but after some time looking at the package lists I’m a bit wary; far too many things in MacPorts seem to have lurking XFree86 dependencies, and I’m honestly not sure I could get a productive environment without finally giving in to it.

Maybe I’m just getting old and crotchety, but lately I seem to be running into these sorts of things with increasing frequency: tools that I know and love, and can use fluently from a command line, aren’t installable without boatloads of unnecessary GUI crap that a package maintainer has decided to force down my throat. I’ve got better uses for that disk space, thank you very much.

So if you happen to be someone who makes software packages, and you happen to have some influence over the dependency chain of those packages, I’d like to send out an earnest plea for mercy: if the software doesn’t really, truly, absolutely depend on a GUI for its basic functionality, leave the GUI out of the dependencies. If I decide I want the graphical bells and whistles, I’ll hunt them up myself.

Comments

Brad
March 3, 2008
#

This is exactly the reason why I run Gentoo. There is a learning curve and a price to pay, but once you pay it you get complete control over all of your dependencies. Most of those packages don’t need X11 to function per se—it’s just that the package maintainers for the distros build the packages with everything anyone could ever want, which is not always what everybody actually needs. I guess I’m just a super power user, but the complete control I get with Gentoo is a lot of fun and definitely more satisfying than installing a ton-o-junk that I never use or want.

Joey Coleman
March 3, 2008
#

This isn’t related to the main point of your article, but the best approach to installing TeX on a mac that I’ve found is the MacTeX distribution at http://www.tug.org/mactex/ — it includes XeTeX along with the usual tools.

bernad eskimo
March 3, 2008
#

hi

i know this is very nonetopic, but can you or somebody recommend me an editor and some other tools for webdeveleopment (most with python) on mac osx?

Al
March 3, 2008
#

While I completely appreciate the sentiment that you shouldn’t need to install packages that you don’t honestly require; you have to admit the statement about having better use for the disk space is a little weak - in a modern computer, disk space is the least of anyones concerns.

Pete
March 3, 2008
#

I can’t install anything Python related from MacPorts — it always wants to install Python 2.4 (already have 2.5 installed). I’m sure there’s a way around it, but I usually don’t bother as it’s often easier to just go elsewhere to find a package.

Requiring XFree86 for the TeX package when you’re on a Mac is insane. There’s just no reason for it. Luckily Joey already mentioned MacTex, which is a big download but very good.

Noah Slater
March 3, 2008
#

As a Debian contributer I’ve often had my packages rejected for exactly these reasons, which is a great that they are so scrict. Every package in Debian with X as an optional feature comes with an X package and a no-X package.

Perhaps you should consider the swicth? :)

Noah
March 3, 2008
#

I agree, MacPorts is especially bad for dependencies that shouldn’t be there and the inability for it to work with version ranges (or so it would seem). I put up with it on my Mac because it’s so frustrating to try and compile everything from source on it because it seldom works out nicely.

On my Linux machines I compile everything from source myself and manage my own damn dependencies, forget apt or emerge I’ll do it myself thanks, as a result my Debian setup is a svelte ~260MB

Daniel
March 3, 2008
#

Yeah, like Brad, dependencies like that are part of the reason I use Gentoo. Although, if you are looking for a binary distribution for a server, I don’t see why you guys would prefer Ubuntu over Debian, especially if it turns out that Ubuntu isn’t following the Debian tradition of “no-X” package versions that Noah Slater is describing.

Then again, it could be possible that Ubuntu does the same thing, but that you need to request a slightly different package name, or a config change (bear with me, it’s been a long time since I’ve used apt-get or aptitude.

schmichael
March 3, 2008
#

First off: Gentoo melts ice caps. Use a system with binary packages. ;-)

Secondly: Are you sure it wanted to install a full X environment or just some x-libs? I often end up with some x-libs installed on servers, but no running X.

Third: Debian Sid (I use Debian Stable on all my servers) has split libgjc-awt (which depends on a number of gtk and therefore X libs) out into its own package which you can optionally install.

Bottom Line: Don’t fear the dependencies. They’re really not that bad. Even if you end up installing hundreds of MB of X packages, just never start it (with gdm, kdm, or the like), and it will never negatively impact server performance.

Now if you’re concerned about the extra 200 MB of space those packages are using… you need more storage, not better dependency handling.

Kevin Francis
March 3, 2008
#

You might also want to try using apt-get instead of aptitude for this — aptitude seems to install extra stuff (from the recommends list?). My gcj on Ubuntu has minimal dependencies…

Ian Bicking
March 3, 2008
#

I install things from source, then create acceptance tests for my system. For instance, run a particular application, compile my documents. Then I run those acceptance tests over and over while removing every file in the system, finding the absolute minimum set of files I can get by with without any cruft that I don’t need; I only have the files and libraries I need to do what I need to do.

I do this to save the environment, as I am afraid that we are reaching Peak Magnets.

Griffith Rees
March 4, 2008
#

sudo port search texlive texlive tex/texlive 2007 TeX Live is a TeX distribution texlive_base tex/texlive_base 2007 TeX Live Binaries. texlive_texmf-docs tex/texlive_texmf-docs 2007 Docs for texlive texlive_texmf-full tex/texlive_texmf-full 2007 full texmf tree for texlive texlive_texmf-minimal tex/texlive_texmf-minimal 2007 texmf tree for texlive

Texlive is the new standard for tex, I don’t think it has xorg dependencies.

Griffith Rees
March 4, 2008
#

I’m wrong, it does require xfree86. Strange and unfortunate.

However, texlive_texmf-minimal has no dependencies. You could see if that does what you need.

Paul D. Waite
March 6, 2008
#

in a modern computer, disk space is the least of anyones concerns

Not on a modern laptop, when I’ve got all my music, photos, and some videos on it too.

Paul Bx
March 8, 2008
#

FWIW, I’ve found the MacPorts folks fairly approachable on IRC and via the ticket tracker. In fact when I’ve bumped into something weird there has often been illuminating detail in a ticket in their Trac. Not saying that this will solve your problem, but it’s something to keep in mind.

Re the Python 2.4 dependencies Pete mentioned, the workaround is often just editing the portfile to require 2.5, though of course that’s not ideal.

Chris Hoeppner
March 11, 2008
#

Not on a modern laptop, when I’ve got all my music, photos, and some videos on it too.

Perhaps need an external harddrive? They’re not that expensive, really. But it’s up to you and yourself what you want or do not want to do with the space you get. But, as IT support guy, I can safely say that a 40-gig lappy is no longer… “standard”.

To further support my point, I use an external box with firewire, and it works fast enough to have a virtual dev server’s harddrive boot from it.

As for the dependencies, it’s the usual backdraw of binary systems. If you’re going to use a precompiled package that somewhere in it’s depths has some sort of mystical gtk callings, you’re going to need the package for that, and the dependency trace usually goes up to X11 and it’s friends.

Add a comment

You may use Markdown syntax in your comment, but raw HTML will be removed. By posting a comment here, you are agreeing to the terms of my comment policy.