Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 258125 - devmanual common mistakes: section about ROOT misuse
Summary: devmanual common mistakes: section about ROOT misuse
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Gentoo Quality Assurance Team
URL:
Whiteboard:
Keywords:
Depends on: 144332
Blocks:
  Show dependency tree
 
Reported: 2009-02-08 13:43 UTC by Thilo Bangert (RETIRED) (RETIRED)
Modified: 2011-03-09 16:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
add_common_mistake_ROOT.patch (add_common_mistake_ROOT.patch,808 bytes, patch)
2009-03-05 19:48 UTC, Thilo Bangert (RETIRED) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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