From owner-freebsd-ports@FreeBSD.ORG Fri Jul 27 08:47:19 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D98C716A419 for ; Fri, 27 Jul 2007 08:47:19 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout1.cac.washington.edu (mxout1.cac.washington.edu [140.142.32.134]) by mx1.freebsd.org (Postfix) with ESMTP id AF79C13C461 for ; Fri, 27 Jul 2007 08:47:19 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout1.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.06) with ESMTP id l6R8lI0d009485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Jul 2007 01:47:18 -0700 X-Auth-Received: from [192.168.10.45] (c-24-10-12-194.hsd1.ca.comcast.net [24.10.12.194]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l6R8lH8O011782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2007 01:47:18 -0700 Message-ID: <46A9B112.7040408@u.washington.edu> Date: Fri, 27 Jul 2007 01:47:14 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Yoshihiro Ota References: <20070726011654.cec378be.ota@j.email.ne.jp> <46A866BE.1000407@u.washington.edu> <20070726233610.e536c2e2.ota@j.email.ne.jp> In-Reply-To: <20070726233610.e536c2e2.ota@j.email.ne.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.2.304607, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.7.27.12533 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='SUPERLONG_LINE 0.05, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __USER_AGENT 0' Cc: freebsd-ports@freebsd.org Subject: Re: Call for testers for yet another ports upgrade program, ports+ X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 08:47:19 -0000 Yoshihiro Ota wrote: > On Thu, 26 Jul 2007 02:17:50 -0700 > Garrett Cooper wrote: > > >> Yoshihiro Ota wrote: >> >>> To Whom Slowness of Portupgrade Concerns a Lot: >>> >>> As I got tired of long waiting of portupgrade trying to resolve dependencies, I came up with >>> yet another tool for upgrading FreeBSD ports system. Unlink other tools, it tries to maximize >>> existing resource to maximize its performance. This program attempts to wrap around with >>> another 'make' and expand use of FreeBSD ports system. The heart of ports+ is parsing INDEX >>> and +CONTENTS files. The rest is handed to GNU make. I think it comes to a point where I seek >>> wider audiences to test with it. >>> >>> >> Hiro, >> You're correct when you say that reading INDEX* does take a long time >> for portupgrade, but the problem is partly with how portupgrade formats >> its version of the INDEX database in BDB format, as well as how it >> doesn't buffer up proper information (pkg database information for >> instance), and guesses at port dependencies (origins, deporigins, etc). >> > > Portupgrade is not only slow reading INDEX file but also on dependency resolving and updating +CONTENTS files, too. I think portmaster is also one tries to read and do the same things but with shell script. I personally didn't have good luck with portmaster and haven't really used to evaluate. However, "portmaster -a -n" wasn't not fast, neither. By the way, it builds ports in background, doesn't it? > Yes, but a lot of time is spent reading the INDEX file, especially since portupgrade / portinstall don't keep that information in memory (probably for the better though). Like Doug said, portmaster doesn't built ports in the background, and the way that the package system is currently setup I don't advise doing that unless you plan everything out properly (I see potential for duplicated installs, race conditions, and other unwanted possibilities). I'm working on getting away from that at the moment. > >> 1. Can your solution be made bsdmake and bsd awk compatible? >> > > I am not as familiar in newer BSD awk and make extensions. I can point out what kinds of GNU extensions are being used so that someone can tell it is also available in BSD make/awk. > > For awk, this feature is required, quoted from "man gawk". I am not sure if BSD awk implements this feature. > > The book indicates that command line variable assignment happens when > awk would otherwise open the argument as a file, which is after the > BEGIN block is executed. However, in earlier implementations, when > such an assignment appeared before any file names, the assignment would > happen before the BEGIN block was run. Applications came to depend on > this "feature." When awk was changed to match its documentation, the > -v option for assigning variables before program execution was added to > accommodate applications that depended upon the old behavior. (This > feature was agreed upon by both the Bell Laboratories and the GNU > developers.) > > For make, 1.1 and 1.2 below are in the same topic. I use GNU extension which keeps generating makefiles until dependency rule saticifies and use it part of the make rule. GNU extension reloads newer makefiles and reconstruct dependencies. I am not sure if it is possible in BSD make; however, this is not a heart of this program. We can work around with bootstrap script or something. > 1.3 This is recursive expansion of variables. If you take a look, every port needs upgrade uses $(UPGRADE). $(UPGRADE) is expanded multiple times using the target variable, $@, such that it backups up correct old package names and so on. This is very important and unless this works in BSD make, my tool really needed full redesign from scratch. > 1.4 is just how GNU make does shell invocations. It is available in most of Make tools. > 1.5 is something I am not sure which makes support these. I don't think GUN make recommends using special characters as variable names. However, when I tried, it was too difficult to normalize to alphabets and underscore only. If we cannot use variable like PORTS+IGNORE as a variable name, it will be very difficult and personally I don't even think about trying that myself. If you take a look at compat.gmk which ports+ generates as a part of its build rule, you can find something like "COMPAT_$(PKG_DIR)Hermes-1.3.3_2 = cp -f /usr/local/lib/libHermes.so.1 /usr/local/lib/compat/pkg&&" being variable. > > 1.1 How makefiles get remade: > http://uw713doc.sco.com/cgi-bin/info2html?(make.info)Remaking%2520Makefiles&lang=en > > 1.2 Including Other Makefiles: > http://uw713doc.sco.com/cgi-bin/info2html?(make.info)Include&lang=en > > 1.3 Computed Variable Names or recursive expandsion of variables: > http://uw713doc.sco.com/cgi-bin/info2html?(make.info)Computed%2520Names&lang=en > > 1.4 The `shell' Function > http://uw713doc.sco.com/cgi-bin/info2html?(make.info)Shell%2520Function&lang=en > > 1.5 Special characters in variable names such as dot, ., comma, ,, slash, /, and so on. > Ah, good ole SCO.. I can't believe they're posting docs like that. Lol. I do see your variable naming scheme as a cause for concern though, unfortunately. I steer clear of shell-like configurations like this when you can potentially get malicious text inside a variable name / declaration. >> 2. Does your solution account for cases when you're trying to install >> package a, which depends on package b, but because you built package b >> while trying to build a, and are at an intermediate package c (between a >> and b), the dependencies for a are only partially complete. Thus when >> you try to install direct or indirect dependences, the install fails? >> > > Some of answers are explain in the GNUmakefile. Anyway, ports+ categorizes all ports into three, NEW as ones not installed, UPGRADE as installed and newer version is available, NOOP as installed an no newer version is available. I only started with upgrading only and haven't really though thought installing new ones. I am not ready to talk about installing new ports via ports+. Short answer for upgrade is, "Yes, it does." Here are some examples. Let's say 'a' depends on 'b'. Then, it builds 'b' first and than 'a'. If new version of 'b' has new requirement of 'c'. Making 'a' will result installing 'c' and than upgrading 'b.' If 'e' requires 'f', 'g', and 'h' and these are independent from each other, upgrading 'e' with -j 3 will start upgrading 'f', 'g', and 'h' at the same time and once all three are upgraded, it will start on 'e'. > That's really good thinking sir for single installs. Props to you for that :). >> 3. How is this different from pkg_version combined with similar scripts? >> > > I wasn't aware of pkg_version, but it looks like it only tells if port is up to date or not. It doesn't tell anything about dependencies among ports, does it? If so, it doesn't provide enough information to upgrade. > Every time you run make install, portmaster, or portupgrade, there's a lot of stuff going on behind the scenes. One of the things involved is installing package information in /var/db/pkg. That's where pkg_version gets its information from, along with portmaster (AFAIK) and the makefiles for ports (for sure). It does provide enough info to tell whether or not something needs to be upgraded, based on the output (<, =, or >). It doesn't tell you the official target you're upgrading to, but it doesn't really need to do that though. > The difference from other two is the following. Portupgrade and portmaster "reads" what's in ports, INDEX, and what's installed, +CONTENTS, "solves" dependencies itself, and "manages" upgrading port itself. Instead, ports+ "converts" INDEX and +CONTENTS to (GNU) Makefile and let the dependency expert solve the rest. > > Hiro > I do like the ideas of simplified makefiles, but I see dependencies changing frequency, unfortunately, and if dependencies are changed or touch(1)'ed, then things have to be rebuilt to make gmake happy :). Your exercise in doing this is interesting though, nonetheless. -Garrett