From owner-freebsd-arch Fri Jul 12 18:20:20 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4131037B406; Fri, 12 Jul 2002 18:20:09 -0700 (PDT) Received: from soulshock.mail.pas.earthlink.net (soulshock.mail.pas.earthlink.net [207.217.120.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D0D343E75; Fri, 12 Jul 2002 18:20:08 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from hawk.mail.pas.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by soulshock.mail.pas.earthlink.net (8.11.6+Sun/8.11.6) with ESMTP id g6CMLLI08846; Fri, 12 Jul 2002 15:21:21 -0700 (PDT) Received: from pool0049.cvx22-bradley.dialup.earthlink.net ([209.179.198.49] helo=mindspring.com) by hawk.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17T8m7-000604-00; Fri, 12 Jul 2002 15:20:31 -0700 Message-ID: <3D2F5602.9039F5DE@mindspring.com> Date: Fri, 12 Jul 2002 15:19:46 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mark Valentine Cc: Wes Peters , Jordan K Hubbard , Dan Nelson , Archie Cobbs , Dan Moschuk , Dag-Erling Smorgrav , arch@freebsd.org Subject: Re: Package system flaws? References: <200207120055.g6C0tbpQ084565@dotar.thuvia.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mark Valentine wrote: > wes@softweyr.com (Wes Peters) > > On problem in particular comes from changing the PREFIX of a > > package. You can easily do this in the package tools, but how do you > > change the BINARIES to realize they've been installed under another > > PREFIX? > > How about providing a packaging API call (and utility) for the packages > to grab their install root from a record in /var/db/pkg? Something > like pkg_getroot(3) and pkg_config(1). > > There probably isn't much less intrusive way to make a package's root > configurable at install time. > > If you didn't want the package to have to look in /var/db/pkg, have > the package binaries hold a maximum-length padded string variable (marked > similarly to what(1) strings), and provide a tool to edit the binary (and > scripts) at install time. > > I think environment variables are too fragile for this purpose. At this point, the best approach is probably a registry. The problem that you are trying to solve with this is that there is implied knowledge of a fixed path which is compiled into data stored in the binary. While it's theoretically possible to edit this data in place, assuming the path is not assembled from components at runtime, in practice, you are limited to a path of equal or smaller size. A lesser alternative is to have a "/var/opt" or some other location which is guaranteed to be a symlink to the real path location... and is never, itself, a real directory. This still would not address the ability to locate packages in more than one installation target location at a time, when you have multiple packages on a system: you are still limited to one directory hierarchy. In an ideal world, you would probably want to put each package and all dependent files, including the shared libraries it cares about, into its own directory. This was really Windows original problem. A number of researchers have suggested that this problem could be solved by causing packages themselves to be in directories that were exported as their own mini FS's. This "live image" could be mounted read-only off a remote server, or locally off a CDROM, without introducing further issues. Likewise, it would permit control of licensing by providing a usecount control point that could be monitored asn adminstered centrally, with little additional effort. The main benefits to this are that you install an application once, it never interferes with the operation of another applicaiton, and it's location is a Schelling point which can be identified by other applications easily, if they depend on it. A secondary benefit is that, "if you need powerpoint for a presentation, you can mount it from the local public network and use a local license instance, rather than carrying it around with you". That's probably not a "benefit", if your job is selling as many "powerpoint" licenses as humanly possible. 8-). There are really three problems with this: 1) Windows is limited to 26(32) mount points: one per drive letter; so it is difficult to make this work in Windows, though it can be done... either through unification of the applicaiton namespace on a local network through peer-to-peer implementation, or through a single FS that hooks IFSMgr to turn directories themselves into mount points in the Windows FS namespace, rather than relying on the Windows "drive letter" mechanism, whose only benefit is "it's already supported". 2) Applications vendors don't write applications this way, so needing them to be written this way implies a constraint on porting. 3) Cross-references are unidirectional along a graph edge; the implications of this may not be obvious at first, but to break it down into simple terms: it's hard to add plug-ins to applications that already exist, without those applications knowing about the possibility of a given plug-in at the time they are written, without writing the plug-in to a directory owned by the original application -- thereby violating the model; e.g.: C:\Program Files\Netscape\Communicator\Program\Plugins Once again, some of this can be resolved... with a Schelling point that is location invariant ... or within which, locations are themselves invariant: once again... a registry. I personally don't know if I'm ready to fight the "Not Invented Here" war that trying to implement a registry entails. As an idea that came from Windows, there is a gut-level reaction among many UNIX people that tries to pretend that engineers employed by Microsoft (or, sometimes, even RedHat) could not possibly have a good idea on their own, or solve a problem in a way that was not already thought of by themselves. Maybe we can table the "change PREFIX on binary during install" issue while we slog through the rest of the mess, and then come back to it when people aren't looking? 8-). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message