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.
'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...
Created attachment 184046 [details, diff] add_common_mistake_ROOT.patch first draft. please comment!
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