From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 209EC138010 for ; Sat, 22 Sep 2012 16:49:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E3D721C00E; Sat, 22 Sep 2012 16:49:04 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 94899E027D for ; Sat, 22 Sep 2012 16:48:24 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so4309290obb.40 for ; Sat, 22 Sep 2012 09:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RFy3yHfG3MtBDKFXgILueQ8l3O51lTUytDlPEnfo3As=; b=w4NEJaOeWEzN1Jx5/g1jlMJ1wTtb8A9PVcGsKAVtOUHFaHlaxVLrh95Uk6wZIwFTw0 82+QHZkid+AQsFl/a8UBPGDbPZSMvVnkYYZBlOAc3/yO5g6dEAha+sSPvEx5O5wNSYi7 nMN/QQnipxWJRQi23vto6cJV40p/lfGcDf0kgruDXdXU/4rGI3/rVIJPyIYf+5aWNLIn pLZcPDMAxXyl69Ozzs0MC1m/YTD6lRUAfxTCI3RjZZyz3Q4k2xo2GrjifYlKW3/0LXBj zP5qsvmzx3wudqS7Pad96AtpSu3ZS63/O5431xjTxDdXMoBAnAqIeoT+2rrqBt5Q2Bmv I+JA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Received: by 10.60.7.230 with SMTP id m6mr6290458oea.41.1348332503840; Sat, 22 Sep 2012 09:48:23 -0700 (PDT) Received: by 10.182.81.34 with HTTP; Sat, 22 Sep 2012 09:48:23 -0700 (PDT) In-Reply-To: References: <505C90A2.90405@gentoo.org> <505DE7D7.8060205@gentoo.org> Date: Sat, 22 Sep 2012 18:48:23 +0200 Message-ID: Subject: [gentoo-dev] RFC: method of checking for cross compilation from ebuild functions From: Ambroz Bizjak To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: a6d1c0f8-7257-45c8-833c-8d2b158fb78d X-Archives-Hash: 895349d40c4039e79454d73185c8b58a Zac, I think you misunderstood me here. Crosscompile-only HDEPEND is definitely necessary, I've seen many packages need this. But what I'm suggesting is that we also, and maybe only, need "ROOT != /" - only HDEPEND dependencies. This means that the dependency would only be required if the package is being built for a ROOT that is not /. The idea is to eliminate the strange case that is ROOT!=/ but FEATURES has no crosscompile. If the package requires tools that it would build itself if ROOT was /, it will use the host's version of the tool whenever ROOT!=/ It wouldn't have to worry about whether the tools it builds link to libraries in ROOT. So my proposal is basically, instead of: HDEPEND="crosscompile? ( ~${CATEGORY}/${P} ) (yes, that seems to be the most common case) there would also, and maybe only, be: HDEPEND="root_not_slash? ( ~${CATEGORY}/${P} )" root_not_slash (or another name) would essentially be a superset of crosscompile, since crosscompile implies ROOT!=/. P.S. sorry Zac I sent you this twice, damn GMail :) On Sat, Sep 22, 2012 at 6:31 PM, Zac Medico wrote: > On 09/22/2012 09:08 AM, Ambroz Bizjak wrote: >> Yes, I think this is a good idea, it would allow the dependencies to >> be expressed nicely as conditions. >> >> But I'm not sure how this would be a USE flag. It should behave like >> one during the build, but it would be best if it was not written into >> the VDB as such, at least in a way that would be considered by >> --newuse. It don't want "emerge -unD" on the booted system want to >> reinstall all packages because the current ones were cross-compiled. >> Does the test flag already behave nicely like that? In that case, all >> is good, and I can try to implement this. > > Simply add your special flag to the _feature_flags variable in > config.py, and it will be exempt from --newuse. See this commit: > > http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b19f71b39b6af43307abf20654511bace041217 > >> On a slightly different subject: I've been porting some packages to >> HDEPEND and I've seen problems with packages that want to use the >> programs they build during the build (or in postinst). Of couse this >> works for native builds, and it can be fixed to work for cross-compile >> builds (build native version or HDEPEND on host package). >> >> But what do we do with the strange case where ROOT!=/ but >> --crosscompile/FEATURES=crosscompile is not in affect? Can we expect >> that we will be able to run the programs that were built? What if they >> link to libraries only available in ROOT? >> >> So, I think it would make sense for a lot of packages to treat ROOT!=/ >> equivalently to cross-compilation, i.e. require host tool to be >> present. But with what has currently been proposed there is no >> conditional dependency on ROOT!=/, so a package cannot demand that a >> tool be present on the host. Then, it may be a good idea to add a >> conditional dependency on ROOT!=/. > > If I understand correctly, that would be like a CROSS_TDEPEND? If we > translate that to a conditional, it would become DEPEND="crosscompile? ( > foo )", since our plan was to make DEPEND apply to ROOT!=/ and HDEPEND > apply to ROOT=/, right? > >> In fact, I think that --crosscompile or FEATURES=crosscompile could >> actually be abolished and only this condition would be available. It's >> true that some packages would only use the host dependency if there's >> actual cross-compilation going on, but nothing will break. This would >> ease configuration and reduce the number of cases to be tested. > > Yeah, the split between HDEPEND and DEPEND might be enough so that you > don't need these conditionals. If you're not really sure that the > conditionals are needed, then maybe it's better to eliminate them for now. > -- > Thanks, > Zac