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 C5284138252 for ; Wed, 11 May 2016 01:42:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A196224044; Wed, 11 May 2016 01:42:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0CC7A21C012 for ; Wed, 11 May 2016 01:42:41 +0000 (UTC) Received: from mail-oi0-f52.google.com (mail-oi0-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 8883C340754 for ; Wed, 11 May 2016 01:42:40 +0000 (UTC) Received: by mail-oi0-f52.google.com with SMTP id x19so45078333oix.2 for ; Tue, 10 May 2016 18:42:40 -0700 (PDT) X-Gm-Message-State: AOPr4FXJ4v4dWz9sjPa7huUH2BLd8RQJTJ1ZzvOjeFbdyqBLAjKXSCaM513Td4nwzjeBNg9LdhA15nHI8l/+UQ== X-Received: by 10.202.74.195 with SMTP id x186mr372331oia.104.1462930958521; Tue, 10 May 2016 18:42:38 -0700 (PDT) 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.202.75.195 with HTTP; Tue, 10 May 2016 18:42:19 -0700 (PDT) In-Reply-To: <573251B8.8090103@gentoo.org> References: <1462729330-24788-1-git-send-email-floppym@gentoo.org> <5731F960.50205@gentoo.org> <573251B8.8090103@gentoo.org> From: Mike Gilbert Date: Tue, 10 May 2016 21:42:19 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH] ebuild-writing/variables: better describe ROOT To: Gentoo Dev Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 9069f037-7c92-4b18-b4be-ea7c598e3c48 X-Archives-Hash: e0fadad89a676326076d36b4c45434b3 On Tue, May 10, 2016 at 5:25 PM, Michael Orlitzky wrote: > On 05/10/2016 02:28 PM, Mike Gilbert wrote: >> On Tue, May 10, 2016 at 11:08 AM, Michael Orlitzky wrote: >>> We have maybe 150 ebuilds in the tree using $ROOT in src_* functions. >>> Some are bugs, but many look OK to me. Do we really want to say "never" >>> do that? >> >> According to PMS, it is only legal in pkg functions. >> >> Can you point to an example where using ROOT in a src function is appropriate? >> > > Modulo the question "when should you use $ROOT over $EPREFIX"... > > * the chrome-binary-plugins ebuilds use it in src_install. This is quite obviously wrong. I happen to maintain that ebuild, so I just fixed. > * dmraid does > > einfo "Appending pkg.m4 from system to aclocal.m4" > cat "${ROOT}"/usr/share/aclocal/pkg.m4 >>"${S}"/aclocal.m4 || \ > die "Could not append pkg.m4 This should be one of two things: cat /usr/share/aclocal/pkg.m4 Or, if prefix support is desired: cat "${EPREFIX}"/usr/share/aclocal/pkg.m4 > Both of those look like EPREFIX candidates to me, but they're not > obviously wrong, either. Maybe it made sense in EAPI <= 3. > > Anywhere that you need addpredict() it also seems reasonable. The > v4l-dvb-saa716x ebuilds use "${ROOT}/usr/src/linux/" where EPREFIX would > not be a good replacement. Nah, usually addpredict is dealing with stuff in the system that is performing the build. Sandboxed phases should never be looking at ROOT. Those ebuilds should probably do addpredict /usr/src/linux instead. > > Something needs to be fixed, though: you're right that the PMS limits > ROOT to pkg_*. Who knew? If we want to be serious about banning ROOT in > src_*, we should add a repoman error. Based on my own understanding of the ROOT variable, its use in src functions is always nonsensical, especially when you consider binpkgs. A binpkg can be installed with a ROOT value that is completely different from its value when the package is being compiled. To put it another way, in src functions, ROOT could/should always be "/". The real value of ROOT isn't determined until merge time. I agree, repoman should be catching this stuff.