On Tue, 10 May 2016 14:28:46 -0400
Mike Gilbert <flop...@gentoo.org> wrote:

> On Tue, May 10, 2016 at 11:08 AM, Michael Orlitzky <m...@gentoo.org>
> 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?

I thought that it was necessary for cross-compiling in some cases but I
was told that this should be SYSROOT instead. There is a bug open to
get that officially described in the PMS.

https://bugs.gentoo.org/show_bug.cgi?id=573306

Apart from that, I have grepped the tree for ROOT and I think many are
confusing it with EPREFIX. The example that stands out most for me is:

app-crypt/keybase/keybase-0.8.25.ebuild:
dosym "${D}/opt/${PN}/bin/main.js" "${ROOT}/usr/bin/keybase"

This is so wrong. If ROOT were /mnt/foo then the final result would be
a symlink at /mnt/foo/mnt/foo/usr/bin/keybase and it would point to
/var/tmp/portage/app-crypt/keybase-0.8.25/image//opt/keybase/bin/main.js.
Fortunately this madness is gone in later versions.

If you want to know what ROOT does then try it yourself.

ROOT=/mnt/foo emerge app-shells/dash

This isn't a system you can chroot into but it could be if you emerge
the whole of @system. Then trying throwing EPREFIX into the mix.

ROOT=/mnt/foo EPREFIX=/bar emerge app-shells/dash

I'm less familiar with prefixed systems and I think very few people mix
EPREFIX with ROOT but I try to do right by both.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

Attachment: pgpkqlujcdRBQ.pgp
Description: OpenPGP digital signature

Reply via email to