Guido van Rossum: People want CPAN (discussion on Python packages)
thread.gmane.org
thread.gmane.org
It almost seems like Ruby/Python have been consciously reluctant to do so.
(If you have ever read the CPAN source code, you would be surprised it works at all. Don't get me started on the various incompatible build systems, and what happens when your module's build system depends on a newer version of the build system.)
Haskell's Cabal is the technical model to steal. Don't let modules execute their own code unless they actually need to. 99.9999% of modules do fine with some sort of declarative interface, rather than actual code to do those things.
Something CPAN couldn't easily do a few years ago was install to arbitrary directories. If you set the right environment variables, EUMM would sort of do the right thing. If you set different environment variables, sometimes MB would do the right thing. Eventually EUMM and MB were patched so that it almost always worked, and then local::lib was written to paper over the differences.
And of course, nothing requires the use of EUMM or MB, so if a package doesn't use it, you can't install it to your home directory.
Anyway, the EUMM is what you get when you write code to fix problems that people complain about. MB is what you get when you write specs to "fix" problems people complain about. Maybe someday we will have a build system that has a sane design and actually works.
I can't upvote this enough. CABAL is extremely well done.
I have started playing with a cabal-like project.
http://github.com/cournape/toydist
It does not do much ATM, except for the conversion step: it can generates a static description of the package from existing setup.py. It reuses distutils to build package, but it does so from the declarative file, meaning that the whole thing is not tied to distutils anymore: distutils becomes an implementation detail.
So far as I can tell there is no way for easy_install to do anything but install packages. I see an "upgrade" command but it seems to only work if I specify the package name, and I don't see any way to list what version of what is installed. I also don't see any way to remove packages.
In short, this means easy_install turns my system into a mystery grab bag of packages that I can't remove without fishing around in site-packages.
Unless of course I'm missing something, but if I'm missing something it certainly isn't obvious.
Or maybe that's just my own experience using Common Lisp on Ubuntu.
It's not the Python side of things that's the problem. Numpy and Scipy (which nearly all Python scientific software depend on) is based on both bindings to C and to Fortran, and getting those library ducks in a row - especially on Windows or MacOS X, on Linux your package manager does it for you - is a pain for someone who knows what they're doing and almost impossible for someone who doesn't.
Plus, well, most scientists outside physics use Windows. If you need a command-line tool you've already lost in that respect. What you're competing against is often Excel.
The battle over Numpy being in core Python has been fought and lost, but short of that level of integration, I don't see that there's going to be much effective to do about this.
It's even already packaged for many OSes. For example, it comes with OSX(and ubuntu, red hat, etc). There's a 3 click installer for windows.
There are also distributions of python that have numpy(and many other sci modules) by default.
And I'm not sure that's possible short of bundling everything with Python, and of course that's a bad idea.
The whole distutils infrastructure is messy and badly designed. It takes care of everything from build up to installation and packaging, and all those parts are tighly coupled. It is also incredibly inflexible, and the way to extend it through subclassing leads to incompatible code (if package A subclass distutils, and package B subclass the same thing, how can you use A and B ?). Almost every design decision of distutils is wrong, and badly implemented.
Numpy and scipy binaries are built for every release: actually, that's the platform we support the best in some sense since we can reliably build binaries, and that saddens me quite a bit.
Plus, you'd have to worry about minor-yet-annoying namespace issues (e.g., a Python package and a non-Python package sharing a name).
Am I the only one not offended by the idea of package managers for each programming language? They always work better when they're tailored to the language.
I'm not sure what you mean by the namespace issues. Everything that's installed as a python package in debian is prefixed with "python-"...
I think it would be less work to clone/port the needed logic bits to Windows/whatever, and share most of the metadata defined for Debian/Ubuntu/etc, instead of redoing (and debugging) everything from scratch.
Learning multiple tools to do a similar job is a bit of a nuisance. If you know one tool, you can learn its details over time. That's much harder with multiple tools. Does tool X remove configuration files when uninstalling? Can it even uninstall? Do I need to update some configuration files manually?
There's also the part where you sometimes need integration with packages from other package manager systems. System libraries (libcurl, etc.), header files if it gets compiled at install time, make, a compiler, etc.
But since the problem is getting solved by multiple tools already (cpan, pear, apt, yum, just plain ./configure+make, etc.), maybe we should work more on integrating those package managers and less on replacing the others. It seems unlikely to happen with so many incompatible personal preferences around...
Apt itself is barely good enough to handle libraries written in C, much less a dynamic language with multiple potentially-incompatible runtimes, and Debian's policies are dead set against making anything remotely wholesome:
* As an author, affected middlemen have a stranglehold on easy distribution
* License wankery (fuck debian-legal)
* Teenagers randomly patching upstream software without review
* Shipping non-standard configurations, often with features randomly disabled
* Rearranging everything to fit their naive 'filesystem hierarchy'
(this completely fucks up a decent packager like Ruby Gems)
* Breaking off features into separate packages whenever possible
* Shipping ancient versions of software with a selection of patches picked
specifically to introduce no features, just cherry-pick 'bug-fixes'
* Shipping multiple versions of a runtime with mutually-exclusive depgraphs
* FUCKING RELEASE FREEZES
There's no goddamn reason for any non-system software to be frozen ever
Ubuntu is making a decent stab at unfucking all this (at least on their turf) with PPAs: https://help.launchpad.net/Packaging/PPA There's no goddamn reason for any non-system software to be frozen ever
What about, I don't know, developers who release early and often without good test coverage? If you're putting your seal of approval on a bunch of software, you probably want to make sure that it works. This cannot be done instantaneously.In a rolling release system you don't have to have a single imprimatur of package approval. At minimum everyone implements it with at least 'stable', 'new', and 'fucked' markers for packages, and you can go way further with multiple repos and overlay semantics.
At least volatile has been around for a few years, so people aren't fucked on tzdata and such because of bullshit policy, though I think it's still off by default.
Unfortunately, the underlying apt system has plenty of shitty behaviors that aren't even related to Debian's shitty packaging policies or the hostile original implementation:
* Only one process can even read the db at a time!
* It's extraordinarily fragile
* Loves to crap out at the slightest network failure
* Will corrupt its database on SIGINT
* Hamhandedly muddles up installation and configuration
* Does not handle optional dependencies well
* Poorly handles only part of the 'alternatives' problem
A lot of its failings are rooted in the assumption that installation will be fast enough to be interactive, so why bother?The FHS is a known standard which works with every language. What specifically about Ruby makes it unique amongst all other software?
The FHS inspires maintainers to large amounts of useless and regressive tedium in re-separating the peas and the carrots into global piles. It's not so bad with traditional C libraries, but the brokenness is immediately obvious when dealing with the libraries of a language that has anything resembling a module system.
What's specific to Ruby is that their community somehow managed to not fuck up their packaging medium.
'What's specific to Ruby is that their community somehow managed to not fuck up their packaging medium.'
Overwriting global binaries in /usr/bin is pretty fucked to me, and I don't think I'm alone in that. Say I'm using puppet or OVirt or other Ruby based system apps - I wouldn't want Gems breaking them. If Python did this (being the basis for most Linux distros) or Perl did this on older Unix there would be hell to pay.
You may want to re-think this, from a perspective other than the single-user system.
Consider an organization that uses its own software, which may not be very good but does the job productively. Imagine that one piece produces output that a browser must present. The tested and supposedly stable system is updated. With a major new version of the browser. Which now renders the output as a blank page.
Hilarity ensues. Or perhaps not.
* Rearranging everything to fit their naive 'filesystem hierarchy'
(this completely fucks up a decent packager like Ruby Gems)
Well who made ruby gems install to /usr/bin by default and potentially interfere/overwrite system-installed software in the first place? Sorry, but I think "Linux Standard Base" is a good thing.The LSB is trivial spec-wank. A whole bunch of effort that doesn't address any of the actual real-world portability issues.
The Ruby folks have done a few iterations of packaging systems and have pretty much nailed it.
Might be worth studying the whole 'gem' system (discovery, distributed publishing, versioning, dependencies, uninstall, etc).