From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SB94P-0005Io-6O for garchives@archives.gentoo.org; Fri, 23 Mar 2012 18:18:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E4DDE08F2; Fri, 23 Mar 2012 18:18:28 +0000 (UTC) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by pigeon.gentoo.org (Postfix) with ESMTP id AB279E06E8 for ; Fri, 23 Mar 2012 18:17:57 +0000 (UTC) Received: by wgbfm10 with SMTP id fm10so2342802wgb.10 for ; Fri, 23 Mar 2012 11:17:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:x-gm-message-state :content-type:content-transfer-encoding; bh=lohLz1YIp9YeJOdN1ODzboQ55OQKPVe/kDeWsoYhVw0=; b=e9mLVS0MOi1nBrolJYYFWa8dW0FIZcP5UKNZsPMJWIU5cWKAf5QRb/WtzHUIp9p7Tq L2bFIdKnHtTXAag7RzY8Z+DLQDIIT1//hwXyVM+6eEWn35h2u2qOy9/A4vvPIUdepHeP z4jRFct9VmMdMYhF3Ir5XiEoZ/4KS5sNV/UZr2TCYhLS3ic/GrSwru+ycaigJC+s3pro hKkZo/A/lBq57tJ9A/nV7W8T3V03vsnfK02kONnj98olenkGV5pI57d2bnHH/xY+FZXz 0Wpg34Wqt0dhtyi1S9ly9Yj4AiQ24QC82wWhF4mUlCGsLfnHsdEhluuyfXZfrovpDWhP Fepg== 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.180.95.74 with SMTP id di10mr10008251wib.1.1332526676821; Fri, 23 Mar 2012 11:17:56 -0700 (PDT) Sender: antarus@scriptkitty.com Received: by 10.227.5.138 with HTTP; Fri, 23 Mar 2012 11:17:56 -0700 (PDT) In-Reply-To: <1332522577.28660.22.camel@rook> References: <20120323051534.06ccfc4b@gentoo.org> <20120323160250.0cc7b56b@googlemail.com> <1332522577.28660.22.camel@rook> Date: Fri, 23 Mar 2012 11:17:56 -0700 X-Google-Sender-Auth: EYmOX2qRaSXZm_iO8mDguOTOjz8 Message-ID: Subject: Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages. From: Alec Warner To: gentoo-dev@lists.gentoo.org X-Gm-Message-State: ALoCoQn/ayvwWkGlv/u0SzdOL6dO93NSH+uLp6xRVk7UmljvoJeqCNYaSMZDqd469spnkQKopZWB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 0b2448c7-a5a5-4d82-8ef6-4488e73c1a2c X-Archives-Hash: a4e67652ae9ccf7911fb6f54f245574f On Fri, Mar 23, 2012 at 10:09 AM, Alexandre Rostovtsev wrote: > On Fri, 2012-03-23 at 12:50 -0400, Mike Gilbert wrote: >> On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh >> wrote: >> > On Fri, 23 Mar 2012 11:58:47 -0400 >> > Mike Gilbert wrote: >> >> > oasis_src_compile() { >> >> > =C2=A0 =C2=A0 oasis_src_compile_no_doc >> >> > =C2=A0 =C2=A0 if has doc ${IUSE} && use doc; then >> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ocaml setup.ml -doc || di= e >> >> > =C2=A0 =C2=A0 fi >> >> > } >> >> >> >> This should probably call use_if_iuse from eutils.eclass, which >> >> handles IUSE=3D"[+-]doc". >> > >> > Actually, neither way works. The spec says: >> > >> > =C2=A0 =C2=A0Global variables must only contain invariant values >> > =C2=A0 =C2=A0(see~\ref{sec:metadata-invariance}). If a global variable= 's value is >> > =C2=A0 =C2=A0invariant, it may have the value that would be generated = at any >> > =C2=A0 =C2=A0given point in the build sequence. >> > >> > So you can't rely upon IUSE having the "merged" value in an eclass. >> > >> >> use_if_iuse is called from functions in several eclasses already in >> the tree. See chromium, kde4-base, qt4-build, and toolchain. >> >> Are all of these usages incorrect? Do you have an alternate solution? > > By my count, there are already at least 19 eclasses in the tree that > access an ebuild's IUSE from eclass code (autotools-utils, chromium, > clutter, db, enlightenment, eutils, gnome2, gnome-python-common, > java-ant-2, java-pkg-2, java-utils-2, mozconfig-3, pam, qt4-build, > qt4-r2, ruby-ng, xfconf, x-modular, and xorg-2). Lets be clear here. Just because we do already it does not mean we should keep doing it. In general if you are going to say 'this usage is wrong' then you need some kind of tool to detect and report on it; otherwise a subset of developers will get it wrong. Don't make it easy to do the wrong thing, make it easy to do the right thing. -A > > -Alexandre Rostovtsev. > >