From owner-freebsd-ports@FreeBSD.ORG Fri Jan 24 16:33:48 2014 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D84E21D3; Fri, 24 Jan 2014 16:33:48 +0000 (UTC) Received: from forward4l.mail.yandex.net (forward4l.mail.yandex.net [IPv6:2a02:6b8:0:1819::4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97E7510A3; Fri, 24 Jan 2014 16:33:48 +0000 (UTC) Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward4l.mail.yandex.net (Yandex) with ESMTP id 6DC241440D62; Fri, 24 Jan 2014 20:33:46 +0400 (MSK) Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id 133992C2AA0; Fri, 24 Jan 2014 20:33:45 +0400 (MSK) Received: from 46.38.39.210.tel.ru (46.38.39.210.tel.ru [46.38.39.210]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7UFSCGju3D-XjiStKn9; Fri, 24 Jan 2014 20:33:45 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: 081aa875-6088-4863-8fdf-26150e242121 Message-ID: <52E295E9.6080406@passap.ru> Date: Fri, 24 Jan 2014 20:33:45 +0400 From: Boris Samorodov Organization: =?UTF-8?B?0JfQkNCeICLQktCQ0KDQoiI=?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: lev@FreeBSD.org, ports@FreeBSD.org Subject: Re: Is it Ok to write files into ${STAGEDIR}/${PREFIX} on "build" stage? References: <1731518990.20140120000401@serebryakov.spb.ru> In-Reply-To: <1731518990.20140120000401@serebryakov.spb.ru> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jan 2014 16:33:48 -0000 20.01.2014 00:04, Lev Serebryakov пишет: > Hello, Ports. > > I'm writing port, which has complex, multi-stage build. In the middle ofg > build some files should be installed into some directory with exactly same > structure, as final result -- some ${TEMPROOT}/${PREFIX}. I could create > special place for files, and in "do-install" simple do "tar -cf - -C > ${TEMPROOT} . | tar -xf - -C ${STAGEDIR}" -- it will be correct install to > stage dir for this port. But it looks strange -- to have two copies of all > final files. > > Now I'm using ${STAGEDIR}/${PREFIX} instead of ${TEMPROOT}/${PREFIX} and > it works nicely -- do-install: becomes no-op, everything is in-place and > port doesn't spent another 250MiB of disk place. > > But, maybe, I don't something significant flaw in this approach and it is > bad idea? This is a bad idea in general. And if you try to test the port then at stage time you should get an error like "the the file system touched before the stage phase". Those stages are: 1. fetch, ...; 2. build; 3. stage (install to a STAGEDIR); 4. actual install (to PREFIX). Our staging allows having a full install at STAGEDIR but doing a partially install to PREFIX. I.e. DOCS, EXAMPLES, NLS, etc. may be installed to real filesystem (PREFIX) only if an appropriate option is checked up. In the future this allows us to get different binary packages (libs-*, bin-*, what_you_like-*) from one source (STAGEDIR). And yes, this system has a drawback. If you write an application only for FreeBSD, it is a monolith one (no docs, examples, etc.) and you use only ports system (no packages) then you'll get your application duplicate disk consumption (at stage/install phase). -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve