From owner-freebsd-ports@FreeBSD.ORG Sat Jan 25 10:06:16 2014 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB7EA688; Sat, 25 Jan 2014 10:06:16 +0000 (UTC) Received: from forward2l.mail.yandex.net (forward2l.mail.yandex.net [84.201.143.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39BA41235; Sat, 25 Jan 2014 10:06:15 +0000 (UTC) Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward2l.mail.yandex.net (Yandex) with ESMTP id 386DA1AC0C78; Sat, 25 Jan 2014 14:06:13 +0400 (MSK) Received: from smtp1h.mail.yandex.net (localhost [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id CEA1813402F7; Sat, 25 Jan 2014 14:06:12 +0400 (MSK) Received: from 46.38.39.210.tel.ru (46.38.39.210.tel.ru [46.38.39.210]) by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id j2f3npjYeD-6CGCq9VN; Sat, 25 Jan 2014 14:06:12 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: 42193d17-dd5e-483b-9e42-c6e82db7eafe Message-ID: <52E38C94.1000107@passap.ru> Date: Sat, 25 Jan 2014 14:06:12 +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 Subject: Re: Is it Ok to write files into ${STAGEDIR}/${PREFIX} on "build" stage? References: <1731518990.20140120000401@serebryakov.spb.ru> <52E295E9.6080406@passap.ru> <7210367408.20140125123334@serebryakov.spb.ru> In-Reply-To: <7210367408.20140125123334@serebryakov.spb.ru> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: ports@FreeBSD.org 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: Sat, 25 Jan 2014 10:06:16 -0000 25.01.2014 12:33, Lev Serebryakov пишет: > Hello, Boris. > You wrote 24 января 2014 г., 20:33:45: > >>> 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? > > BS> This is a bad idea in general. And if you try to test the port then at > BS> stage time you should get an error like "the the file system touched > BS> before the stage phase". > I didn't get any errors, it works like a charm, with all "make install" / > "make deinstall" and "make package" as user and other stuff. > > Only problem, that "check-orphan" complains about *.info files not in > pkg-plist, but it looks like bug in "check-orphan", as I have all *.info > in INFO Makefile variable and, again, install/deinstall and package works > and there are not orphan files, target filesystem is exactly the same after > "sudo make install deinstall" or "sudo pkg add ${package} && sudo pkg > delete ${package}". > > Oh, yes, other problem, that *.info files are installed to real system > even if OPTIONS_UNSET=DOCS / NOPORTDOCS=yes is used, so interaction between > staging and INFO variables is broken in some way (and portlint insists, > that putting info files into pkg-plist is bad idea). > > BS> Those stages are: > BS> 1. fetch, ...; > BS> 2. build; > BS> 3. stage (install to a STAGEDIR); > BS> 4. actual install (to PREFIX). > > BS> Our staging allows having a full install at STAGEDIR but doing > BS> a partially install to PREFIX. I.e. DOCS, EXAMPLES, NLS, etc. may be > BS> installed to real filesystem (PREFIX) only if an appropriate option is > BS> checked up. In the future this allows us to get different binary > BS> packages (libs-*, bin-*, what_you_like-*) from one source (STAGEDIR). > How this contradict with putting file to ${STAGEDIR}${PREFIX} before > "stage" phase (I don't like word "stage" instead of "phase" here due to > obvious reason)? To my mind build is, well, for building and install... you know... > Now my port does all "installation" (from upstream > software point of view) into ${STAGEDIR}${PREFIX} at port build phase > ("do-build" target from port's Makefile point of view), "stage" phase > (really "do-install" target from port's Makefile point of view) is no-op, > and it works! And that (install while being at build target) is imho not good. May be not now but later. May be with different user rights... One more time -- it's just my imho. _I_ wouldn't do so. > BS> And yes, this system has a drawback. If you write an application only > BS> for FreeBSD, it is a monolith one (no docs, examples, etc.) and you > BS> use only ports system (no packages) then you'll get your application > BS> duplicate disk consumption (at stage/install phase). > I have docs, examples, etc. And use packages. It works. It supports > NOPORTDOCS / NOPORTEXAMPLES properly in all cases. I could send port > prototype to you to examine. Please, do. I'll try to scrub it. -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve