- Debugger: Getting mixed signals
- 'Packaging Infrastructure' Contract Weekly Report #4
- Haiku monthly activity report - 06/2015
- 'Packaging Infrastructure' Contract Weekly Report #3
- 'Packaging Infrastructure' Contract Weekly Report #2
- GCI 2014 winners trip report (mentor side)
- TeX Live and LyX; Changes to the boot code
- 'Packaging Infrastructure' Contract Weekly Report #1
- Beginning of 'Packaging Infrastructure' Contract
- Haiku monthly activity report - 05/2015
Package Management: Queries, Solutions, and the Status Quo
Alas the time of my contract with Haiku, Inc. is up. So besides giving some details about the query support and libsolv port which I've been working on since my last post, I'll also summarize where Haiku's package management stands now and what still needs to be done.
Implementing the query support in packagefs turned out to be a bit more work than anticipated, since the ramfs code I recycled wasn't quite in as a good shape as I hoped, respectively needed more adjusting to fit in packagefs than expected. Now packagefs has the three standard built-in indices for file name, size, and last modification time. Furthermore indexing arbitrary other attributes is implemented. It is currently only used for a fourth index for the "BEOS:APP_SIG" attribute. That's the one needed to find applications by their MIME signature. I couldn't come up with any other attributes that would make sense to be indexed in packagefs.
While query support in itself is nice to have -- e.g. when searching files with Tracker's "Find" dialog -- my hope that certain applications that use queries internally would now work nicely again was only partially fulfilled. "lpe", the command line tool synchronously invoking the Pe editor for a file to edit (commonly used by developers e.g. for svn/git commit messages), works fine now (it queries for Pe by application signature). Deskbar replicants still don't show up, though. Apparently the mechanism it uses to track the replicants is to tag their program/add-on files with a special attribute. A live query for files with that attribute provides an up-to-date state of activated replicants. The query part would work now (if we'd index the attribute in question), but since packagefs is read-only, adding that attribute to files doesn't work. Since the current method isn't going to fly with multi-user anyway, it needs to be replaced by a different one, e.g. a simple settings file in the user's settings directory.
I also worked on porting libsolv -- until recently known as libsatsolver -- to Haiku. It will be the engine of our package manager's dependency solver. Often the question comes up what's so complicated about whole the dependency solving. After all it's only about also (recursively) installing the packages a package depends on, right? Well, there are a few additional conditions: Packages can also conflict with other packages. Different packages might require different versions of another package (e.g. a library). There can be abstract dependencies (e.g. something like "web browser") which can be satisfied by several packages. Multiple repositories need to be supported, as well as package and whole system updates. And worst of all, given all the repository and package information, there must be some useful result in case of problems, i.e. user comprehensible sets of options for how to proceed instead of just a "sorry, there's some conflict" message. That's the service libsolv provides.
The current state of the port can be found in my Gitorious repository. The libsolv library, which contains the data structure management for package and repository data and the solver, didn't need much porting. It's companion library libsolvext, which loads platform specific package and repository formats (RPM, DEB, and others), however, needed support for Haiku's formats. That's basically finished. Repositories, information about installed packages, and individual package files can be imported to libsolv's internal format. There's a test program, "solv", which is a simple but, save for repository management, complete command line package manager. It needed a bit of porting as well, which is mostly done. The package installation and deinstallation part is still missing. And lacking a set of properly built packages I haven't done much testing yet, so there's likely still some bug fixing to be done.
So, what's the current state of package management? Haiku is "package aware", being able to boot off of a volume that contains the core system as well as all software in "/boot/common" in packages. The basic tools for building packages ("package") and repositories ("package_repo") are working. There's the beginnings of a command line package manager ("pkgman") which is able to manage repositories.
Missing on the system side of things are the dependency solver (to be based on libsolv) and the whole package installation/activation process, including a package management daemon which deals with package changes done by the user via the file system (i.e. packages manually added to/removed from one of the "packages" directory). After that is done "pkgman" can be completed.
Missing on the package building side are the higher level tools for package building, most notably one that takes some kind of build recipe, prepare a clean room (chroot) environment with only the dependencies of the software installed, and build the package from its sources. A tool on top of that would build a set of packages or even all packages of a repository in an order implied by the dependencies. To solve the chicken and egg problem that certain packages are always required for building (like the compiler and other basic tools), there must also be a tool to cross-build certain packages on another OS (respectively another Haiku version). And, of course, the tools alone don't suffice. We'll also have to create and verify the build recipes for the dozens of packages we rely on.
On the repository side there's a bit of work left, too. We'll have to think about how we want to organize repositories for different Haiku versions and the Haiku trunk. We'll also need a strategy for how repositories are updated and maybe a bit of tool support to make that more convenient.
Finally, there're plenty of odds and ends. Like a GUI companion for "pkgman", fixes for various problems (like the Deskbar replicants), support for application bundles, performance optimizations, if necessary, etc.
So there's still lots left to do for Haiku's package management solution to be ready for prime time. The next big milestone will be reached when the package installation/activation and package building are working. At that point the core package management system will be what one could call self-hosting. I'll try to continue working towards that goal in my spare time.
- bonefish's blog
- Login or register to post comments

Comments
Re: Package Management: Queries, Solutions, and the Status Quo
Very nice to see that package management is proceeding at such a rate! Would there be any possibility of you doing another contract to complete package management, seeing as it's a R1 requirement?
Re: Package Management: Queries, Solutions, and the Status Quo
Re: Package Management: Queries, Solutions, and the Status Quo
Sounds positive.
It'd be nice to see package management in R1A4 :)
Re: Package Management: Queries, Solutions, and the Status Quo
It'd be nice to see package management in R1A4 :)
No, it would be nice to not see R1A4 at all.
Re: Package Management: Queries, Solutions, and the Status Quo
Sadly, since Beta's are feature freeze releases, it'd be impossible to have package management in R1B1, So i'm looking forward to R1A4 ;)
Re: Package Management: Queries, Solutions, and the Status Quo
The Package Management is like Mac OS X budle or Linux terminal?
I think budle is better for desktop user.
My english is very limited.
Re: Package Management: Queries, Solutions, and the Status Quo
Re: Package Management: Queries, Solutions, and the Status Quo
thats sounds great and it sounds like a lot of work! thanks!
What do you think? In how far it makes sense to merge your changes already back into trunk to give it more exposure? e.g. the part that puts the base system into a package.
When working on system files like mail_daemon, is that still easily possible from within haiku? i.e. installing into a running system?
Re: Package Management: Queries, Solutions, and the Status Quo
What do you think? In how far it makes sense to merge your changes already back into trunk to give it more exposure? e.g. the part that puts the base system into a package.
We certainly could merge back before everything is fully completed. That might even motivate other developers to help fixing things like the Deskbar replicants issue. ATM, however, everything is pure gcc 2 (no gcc 4, no hybrid) which would make a lot of people unhappy I suppose. It's probably also better to at least wait until more things fall into place, so we're less likely to still have to make changes that break things fundamentally (package format, directory structure,...).
When working on system files like mail_daemon, is that still easily possible from within haiku? i.e. installing into a running system?
There are at least two methods how that could be done. Generally, the most simple one would probably be to install your stuff in the /boot/common/non-packaged hierarchy. It has a higher precedence than /boot/common and /boot/system, so that should normally do what one would expect. I don't know, whether the mail daemon has hard-coded dependencies to /boot/system (e.g. data or add-on search paths?). If it does, this method obviously won't work.
The other method is to build an update package (containing only the mail related stuff) and activate that package. That would indeed replace the system files.
Re: Package Management: Queries, Solutions, and the Status Quo
Thanks for all your hard work, Ingo!
Out of interest, would there be much benefit in integrating something like bsdiff or xdelta into the packaging system in order to make system updates smaller?
Re: Package Management: Queries, Solutions, and the Status Quo
Re: Package Management: Queries, Solutions, and the Status Quo
Would this be a binary repository or a source code repository? If it is a source code repository, in Release 2 these packages can be compiled and installed on as many architectures as Haiku may support. If it will be a binary only repository, you will need as many repositories as there are architectures and that would be a waste of disk space and bandwidth! Yes, Haiku only supports 32 bit X86 processors officially in Release 1, but that will likely change for Release 2.
In my humble opinion, Haiku needs a source code only repository. Besides, text files compress more tightly than do binary packages thus reducing both disk space and bandwidth on both the server and the client. The compiler could be optimized to reduce system load by running the compiler processes on the GPU using something like Open-CL.
If Haiku uses a source code only repository, it would save the project much effort. Perhaps the package manager could scan the subversion source repository and download any new versions and then pass a compile command to gcc! At the very least have an option to do this in package manager.
In my opinion, an open source Operating System should have a source code repository.
Re: Package Management: Queries, Solutions, and the Status Quo
Would this be a binary repository or a source code repository? If it is a source code repository, in Release 2 these packages can be compiled and installed on as many architectures as Haiku may support. If it will be a binary only repository, you will need as many repositories as there are architectures and that would be a waste of disk space and bandwidth! Yes, Haiku only supports 32 bit X86 processors officially in Release 1, but that will likely change for Release 2.
In my humble opinion, Haiku needs a source code only repository. Besides, text files compress more tightly than do binary packages thus reducing both disk space and bandwidth on both the server and the client. The compiler could be optimized to reduce system load by running the compiler processes on the GPU using something like Open-CL.
After browsing a bit through OpenSuse's (11.4) binary and source repository my impression is that the source packages are in almost all cases larger than the binary packages. For small software components the build system alone weighs a lot (1 MB configure scripts and such), but also for large components (KDE, KOffice,...) the binary packages seem to be significantly smaller.
Also a major disadvantage of installation from sources is that the process takes a lot longer. Furthermore, obviously one would need a base system for being able to build anything in the first place including a whole bunch of development tools and packages. So users who aren't interested in software development would download a lot of stuff they don't even want.
If Haiku uses a source code only repository, it would save the project much effort.
I only see the additional effort for maintaining a system that does the user-side building while still providing a base system in binary form.
Perhaps the package manager could scan the subversion source repository and download any new versions and then pass a compile command to gcc! At the very least have an option to do this in package manager.
Automatically installing arbitrary repository versions is really the last thing one wants to do, if one is interested in a stable system.
In my opinion, an open source Operating System should have a source code repository.
Having the sources available is one thing, but I really don't see any advantage in making building a part of the installation process.
Anyone who is interested in building from the sources can use the tools provided by HaikuPorts.
Re: Package Management: Queries, Solutions, and the Status Quo
Haiku should have been a Desktop OS... yet the package manager is a BIG pass to the Linux mess... then user must compile all software? Brrr...
Re: Package Management: Queries, Solutions, and the Status Quo
Haiku should have been a Desktop OS...
It is. And unlike BeOS (or Haiku R1 alpha 3) it will be a desktop OS with a sane method of installing and updating software.
yet the package manager is a BIG pass to the Linux mess...
Remind me, which mess was that again?
then user must compile all software? Brrr...
Not sure where you got that idea from. Most Linux distributions don't install from the sources either, BTW.
Re: Package Management: Queries, Solutions, and the Status Quo
Haiku should have been a Desktop OS...
It is. And unlike BeOS (or Haiku R1 alpha 3) it will be a desktop OS with a sane method of installing and updating software.
Maybe it is my problem but I continue to not understand the advantage of a package manager respect of "click here to install" (pkg - Software Valet) or "please decompress where you like to install"... and it works! Yes the centralized updater thing can be interesting, but an entire package manager system is necessary? The other Desktop OSes do not have(and not need?)this...
yet the package manager is a BIG pass to the Linux mess...
Remind me, which mess was that again?
I'm sure that you will do in the right way.. but on the Linux system (Cent Os 5.4 in particular)
these are my impression about package management:
For not talk of the "depency hell" and worst of "the circular dependency" problem... one time I tried to remove "Network Printing" and the system said it have to remove all network (!) as "Network Printing" depends by network, but network depends by "Network Printing" :-(
So it failed and I have an unuseful package in a production machine that I can't remove as Package Manager not want...
then user must compile all software? Brrr...
Not sure where you got that idea from. Most Linux distributions don't install from the sources either, BTW.
It was in response to ddavid123... yes it is a too Linuxuish idea... never Linux has thanked this... obliviously I know it was not Haiku way to package management...
Re: Package Management: Queries, Solutions, and the Status Quo
Haiku should have been a Desktop OS...
It is. And unlike BeOS (or Haiku R1 alpha 3) it will be a desktop OS with a sane method of installing and updating software.
Maybe it is my problem but I continue to not understand the advantage of a package manager respect of "click here to install" (pkg - Software Valet) or "please decompress where you like to install"... and it works! Yes the centralized updater thing can be interesting, but an entire package manager system is necessary? The other Desktop OSes do not have(and not need?)this...
By other desktop operating systems, do you mean Windows that uses Windows Update to manage the installation of operating-system specific upgrades? Not to mention all of the individual and varying implementations for updating 3rd-party applications -- such as Adobe's Acrobat, Sun's JVM, Mozilla Firefox, etc. For those 3rd-party applications, there's usually one of two ways that upgrades are managed:
1. By installing a unique program to continuously run and monitor the internet for available updates
2. By checking the internet for available updates each (and every?) time the program starts.
Personally, neither of those 3rd-party solutions is appealing to me. Why should there be multiple background applications to watch for it's own update? Why should software need to be started in order to tell you to install an update, which requires restarting the application?
As for comparing Haiku to BeOS, you need to consider that Haiku's ability to utilize source code from other operating system far exceeds BeOS's ability. This allows much more software to be compiled and run on Haiku with much less effort and without the "dirty hacks", which were required on BeOS.
Some of that software plays a supportive role to other software -- OpenSSL, cURL, gettext, python, perl, sqlite, etc. Those programs exist purely to add functionality to other software. More often than not, each of those supportive libraries is used by several applications. For instance, OpenSSL is used by WebPositive, mail_server, OpenSSH, Git, Subversion, cURL, and so on.
People claim that "fat binaries" (programs that contain all of the dependencies pre-packaged) is superior to package management.
For Haiku, that is not the case. Haiku aims at being a lean, mean, fighting machine of an operating system -- minimal disk usage, minimal memory usage, minimum (useless) redundancy.
Fat binaries promote increased disk space by having necessitating each program to have a complete and full set of its dependencies (and all of the dependencies of its dependencies. and all of those dependencies too!)
Fat binaries will cause increased memory usage, as each program will load it's individual collection of dependencies into memory.
For instance, individual copies of OpenSSL will would be loaded 5, 10, or more times (even if it's the same exact version!).
Fat binaries will force users to update each and every individual program, every time one of their dependencies are updated. Because of that, users will be downloading more bytes than necessary.
All of those side effects are in direct opposition to Haiku's goals.
Developing software that uses only the API provided by Haiku is a noble goal to work towards. However for some software, the time involved to re-implement that functionality and then continually improve it does not make sense. We are a project aimed at creating an operating system -- not one aimed at re-implementing every piece of functionality used in it.
Package management allows Haiku to remain a lean, mean, fighting machine and allows the end user to be concerned only with using the software, as opposed to installing and maintaining it.
Re: Package Management: Queries, Solutions, and the Status Quo
Fat binaries promote increased disk space by having necessitating each program to have a complete and full set of its dependencies (and all of the dependencies of its dependencies. and all of those dependencies too!)
Fat binaries will cause increased memory usage, as each program will load it's individual collection of dependencies into memory.
For instance, individual copies of OpenSSL will would be loaded 5, 10, or more times (even if it's the same exact version!).
Is haiku really able to share a library in memory between programs? I don't think any other OS can do this... if you dynamically link something you will save disk space but if two programs that both use it are loaded they both load their own copy. This is linked to the run time loader, possibly the ELF format, and the practical problems like static variables/objects in a library that would, unless the library was specially designed, need to be loaded once for each program using the library (couldn't be shared). The run time linker would need to know which parts of a program do and don't need to be duplicated and load only the correct ones... very hard to get right.
Re: Package Management: Queries, Solutions, and the Status Quo
*Fragile
I don't know what's so fragile about yum. It doesn't break that easily. I've been adding and deleting repos, installing downloaded RPMs (if this is not close to your "download - click - next - next- finish" installation then I don't know what is), crash it in the middle of upgrade, etc. and it works perfectly fine every single time.
*Complex
I don't get how "sudo yum install firefox" is more complex than having to (1) Google for "firefox" (2) choose a link (3) follow until you can find the .exe or .dmg (4) save it somewhere then (5) run it and have to answer a bunch of questions. Oh, and then you would sometimes need to manually resolve dependency, too, like manually download DirectX9 or MSVC++ runtime...
*Slow
True that yum may be a little slower than apt or pacman, but if you have to update 50 different apps in your system, I don't think you would spend more time with yum than having each of those app update itself (and possibly restart every single time).
*...I have an unuseful package...
And how do you remove an unuseful package from your application if it's compiled into the application's "fat binary" versus dynamic library package?
I support a package manager in Haiku. Totally looking forward to A4.
Re: Package Management: Queries, Solutions, and the Status Quo
Additionally to what others replied, you seem to ignore that a problem already exists with the simple .zip archives distribution on Haikuware and similar sites. You can't just download something there, unzip it and expect it to run. The reasons are many: incompatible platforms, incompatible libraries or others. I find that a huge inconvenience and very much against what Haiku should stand for: Simplicity, convenience and comprehensiveness. The new package management solution is actually quite lean. It has yet to work out in practice, but it offers a cool vision and many compelling features, for example that there is not even an extraction step where files get spilled all over the place.
Re: Package Management: Queries, Solutions, and the Status Quo
Additionally to what others replied, you seem to ignore that a problem already exists with the simple .zip archives distribution on Haikuware and similar sites. You can't just download something there, unzip it and expect it to run. The reasons are many: incompatible platforms, incompatible libraries or others. I find that a huge inconvenience and very much against what Haiku should stand for: Simplicity, convenience and comprehensiveness. The new package management solution is actually quite lean. It has yet to work out in practice, but it offers a cool vision and many compelling features, for example that there is not even an extraction step where files get spilled all over the place.
Huh?
You should be able to download something, unzip it, and expect it to run.
If you can't, then your OS is failing somewhere. Either someone isn't being strict enough with the core libraries and APIs distributed with the operating system, or your binary format is whack.
Look at Mac OS X. You can download anything spanning back to nearly 10.1 and expect it to run on 10.6.x (with the exception of 10.7, which dropped Rosetta). There is no compatibility to worry about. There are no libraries to install (and if there are, they're distributed as framework bundles). There's no need to worry about crap like aclocal and autoconf and automake and all the god-aweful mess that those bring along with them.
If the software from Haikuware doesn't work by just extracting it and sticking it somewhere, then either that software was poorly written, poorly ported, or just plain crap. The same could be said for some stuff compiled for Mac OS X. But you don't see those users running around shafting Apple for the issues of a 3rd party developer and/or software site, do you?
I'm still with the apparent minority. This new system is obfuscated. It reeks of "designed for programmers, by programmers", and if your operating system is ever going to succeed- you need to target the people who don't give a crap about how lean and elegant your package management system happens to be. All they care about is being able to download software and get it running. If you even have to suggest that they go and read a document about how Haiku's package filesystem is laid out- then the whole idea is bunk and nobody but Linux users and CLI junkies will care about it.
-SC
Re: Package Management: Queries, Solutions, and the Status Quo
There's no need to worry about crap like aclocal and autoconf and automake and all the god-aweful mess that those bring along with them.
What makes you think people using the package manager will have to worry about this? 99% of linux repositories deliver BINARIES through the package manager. What makes you think Haiku won't? And from a user standpoint it will be even easier to just look through a list of available packages in a nice gui package manager frontend and click to install/remove, with any dependancy resolution being handled automatically, rather than going to websites and look download/unpack zip's. Apart from ease of use it also allows total control of what packages install and where so that they can be fully removed, something which OSX bundles does NOT handle as they usually leave data in Library/Application Support/ which is NOT removed when deleting the bundle.
All they care about is being able to download software and get it running.
Which is something a gui package manager makes incredibly easy.
I'm still with the apparent minority.
Because people are generally more informed than you are.
If you even have to suggest that they go and read a document about how Haiku's package filesystem is laid out- then the whole idea is bunk and nobody but Linux users and CLI junkies will care about it.
Why would they need to read up on that? Do you need to read up on OSX's filesystem in order to use the App Store?
Re: Package Management: Queries, Solutions, and the Status Quo
the OS X app store comparison is invalid because the objects are mostly self-contained fat binaries (or single object package files that behave like single binaries as far as the user is concerned). it's just an automation of the already present and commonly used drag-&-drop app installation (& removal). Any system devised to automate complex behaviors should tell you that the real solution is to eliminate the architecture of the complex system entirely (when will MS figure it out? and how long AFTER MS will the open source world linger with the old ways till they wake up to reality?).
Re: Package Management: Queries, Solutions, and the Status Quo
I think you've misunderstood... with the new package manager you WILL be able to download a file and double click on it and it will work, like bundles on OS X. It's just that in the background the file will be mounted in the filesystem. It's the best of both worlds (like most things in Haiku). Unless I missed something...
Re: Package Management: Queries, Solutions, and the Status Quo
after all this time coders are still addicted to the idea of shared code/libraries. The argument is always the same: efficient use of storage space/memory. Do you realize the amount of waste inherent in your systems devised to manage these things when simple fat binaries would solve the problem? I just learned of Microsoft's windows side-by-side (winsxs) system to avoid DLL hell... it's not only a cure that's worse than its sickness, it's also largely a solution looking for a problem that doesn't much exist any more (and need not exist ever again if fat binaries were used instead of shared libs). Winsxs wastes more drive space than duplicate code ever could. My own winsxs folder is over 17GB, which a Microsoft spokesman claimed shouldn't be more than 12GB on a 64-bit system... obviously it's a bad system designed without flexibility and foresight because there are so many users finding 14-25GB wasted space by winsxs...
You're still thinking like old-school programmers, not modern, user-oriented systems architects. Design for the future. Don't design for the old way. You're not solving the problem by constantly making management systems. You're perpetuating bad design and refusing to accept that shared libs have been an archaic & irrelevant concept for decades, only adding to complexity and fragility. The solution is to stop using these archaic concepts. Period.
but no way in hell would you abandon all that work you've done thus far, right? Sunken investment, my friends. Move on for the benefit of everyone in the future. Let go of shared libraries and embrace fat binaries.
Re: Package Management: Queries, Solutions, and the Status Quo
One other thing that I believe is more important than saving space are bug fixes and fixes of security holes. If you include the libs in one package you also need to update all the security fixed libs in all the apps that uses this library, not only in one place.
To me personally I like them both :)
Re: Package Management: Queries, Solutions, and the Status Quo
Have you seen Nix - http://nixos.org/nix/ - functional package manager. A very interesting approach that doesn't reinvent the bicycle as usual.
Re: Package Management: Queries, Solutions, and the Status Quo
I think the security updates and also binary compatible functional updates are the most compelling motivation for shared libraries. The redundant storage space of fat bundles could actually be fixed in other ways. For example a smart file system could share blocks in order to not actually store any redundant information multiple times physically. And the VM could share pages (I believe Linux already does this to reduce the amount of physical memory required to run many largely similar virtual machines). But being able to update a crucial component at a single place is very important, IMHO.
Also let's not forget that package management has other nice properties, like not actually extracting stuff and forcing a cleaner design (read-only package contents, handling settings files properly). The latter already has an impact by paving the way for going multi-user. A lot of things that needed changing to work with PM would have had to be changed in the same way for going multi-user.
And as a last point, package management prevents no-one from distributing fat packages.