From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: [PATCH 1/2] build: union: Add create-all-directory? parameter to union-build Date: Mon, 27 Feb 2017 10:06:20 +0100 Message-ID: <20170227100620.6816ae38@scratchpost.org> References: <20170218004427.12392-1-huang_ying_caritas@163.com> <87tw7jn4mo.fsf@163.com> <20170224150256.641cb08d@scratchpost.org> <874lzjb5jy.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciHGL-00034T-AB for guix-devel@gnu.org; Mon, 27 Feb 2017 04:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciHGH-0005xF-Kv for guix-devel@gnu.org; Mon, 27 Feb 2017 04:06:32 -0500 Received: from dd1012.kasserver.com ([85.13.128.8]:58445) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciHGH-0005sq-ET for guix-devel@gnu.org; Mon, 27 Feb 2017 04:06:29 -0500 In-Reply-To: <874lzjb5jy.fsf@netris.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org, Alex Kost Hi Mark, On Fri, 24 Feb 2017 17:13:53 -0500 Mark H Weaver wrote: > If the purpose here is to facilitate mutating anything in the store, That's not what it does. It's used in the profile hook. 'union-build is basically just reused to avoid code duplication. See PATCH 2/2. > then we cannot accept this. > If you want to add something to your profile, e.g. fonts.dir, then use > profile hooks for that. See %default-profile-hooks in > guix/profiles.scm. However, we already have a hook to build fonts.dir, > so I'm not sure what's missing here. Yeah, that is the profile hook that is modified. The reason is that there are multiple font directories that can also be shared by different font packages. Currently, the hook to build fonts.dir only does it for the "truetype" directory. What the patch does is merge the font trees and then call mkfontdir for each of the output directories (via ftw). The modification in 'union-build is because it handles a special case of there just being one input directory: then 'union-build would have symlinked the entire directory - which would make the output (!) immutable. In the end 'fonts-dir-file returns a derivation that is an union of the inputs with those fonts.dir files added. That said, I'm not sure whether the added complexity is worth it - but it would be safe and it doesn't mutate existing store items in-place. It just adds "fonts.dir"s to the profile for all subdirs of share/fonts . It's avoiding symlinks in order to be able to do that without modifying the inputs in-place.