Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 258125

Summary: devmanual common mistakes: section about ROOT misuse
Product: Gentoo Linux Reporter: Thilo Bangert (RETIRED) (RETIRED) <bangert>
Component: [OLD] UnspecifiedAssignee: Gentoo Quality Assurance Team <qa>
Status: RESOLVED FIXED    
Severity: QA CC: ciaran.mccreesh, darkside
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 144332    
Bug Blocks:    
Attachments: add_common_mistake_ROOT.patch

Description Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-02-08 13:43:28 UTC
a lot of developers still get ${ROOT} wrong. perhaps a paragraph or section in the common mistakes chapter would help.

Ciaran McCreesh has written the following about ROOT misuse in the bugs he filed two years ago. it could be used as a starter (provided he gives permission). Ciaran?

Some notes on ROOT:

* The idea behind ROOT is that one can build a system with ROOT=/somewhere and
then chroot into it or tar up /somewhere as a system image. It is not designed
to allow the user to run /somewhere/usr/bin/foo.

* ROOT can't be used correctly in src_*, since ROOT might be different when
merging a binary package. For example, a binary package might be built with
ROOT=/ and then installed onto a system using ROOT=/somewhere.

* ROOT isn't used for library dependencies. When building, libraries, headers
etc. on / have to be used. Cross-compiling etc is done by configuring the
toolchain correctly, not by hacking ebuilds in a way that breaks binary
packages.
Comment 1 Ciaran McCreesh 2009-02-08 13:50:04 UTC
'Twould help if we could get the package managers setting ROOT=/invalid/in/this/phase for src_* in future EAPIs. Unfortunately bash doesn't have var read traps...
Comment 2 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-03-05 19:48:36 UTC
Created attachment 184046 [details, diff]
add_common_mistake_ROOT.patch

first draft. please comment!
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-03-09 16:43:11 UTC
Better late than never? Thanks.

commit 4d025023b322d0f82f49143a3164a3d0c176485d
Author: Jeremy Olexa <darkside@gentoo.org>
Date:   Wed Mar 9 10:37:45 2011 -0600

    common-mistakes: Add section about ROOT

    Patch by Thilo Bangert, bug 258125