Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204608 - directory $EPREFIX$EPREFIX is created during emerging odcctools
Summary: directory $EPREFIX$EPREFIX is created during emerging odcctools
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: All OS X
: High minor (vote)
Assignee: osx porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-06 15:43 UTC by MATSUI Tetsushi
Modified: 2008-02-01 23:07 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MATSUI Tetsushi 2008-01-06 15:43:48 UTC
I have sometimes found $EPREFIX directory under $EPREFIX.
That is, my $EPREFIX is /Users/tetsushi/Gentoo and there has been
/Users/tetsushi/Gentoo/Users/tetsushi/Gentoo.
Today, I noticed that at least emerging odcctools creates the directory,
but I'm not sure whether odcctools is the only cause or not.

A part of my command history is:
   483  23:49   rm -fr ~/Gentoo/Users/
   484  23:49   emerge -1 odcctools
   485  23:51   ls -ltr ~/Gentoo/

and the tail of the last command output is:
   drwxr-xr-x 35 tetsushi tetsushi   1190 Jan  6 02:48 lib
   drwxr-xr-x  3 tetsushi tetsushi    102 Jan  6 23:51 Users
   drwxr-xr-x 48 tetsushi tetsushi   1632 Jan  6 23:51 etc

You see that ~/Gentoo/Users was created again, and in fact it contains tetsushi/Gentoo.

The directory created is almost empty, and I can remove it manually,
so it might do no harm.


emerge --info:
Portage 2.2.00.9139-prefix (default-prefix/darwin/macos/10.4/x86, gcc-4.0.1, unavailable, 8.11.1 i386)
=================================================================
System uname: 8.11.1 i386 i386
Timestamp of tree: Sat, 05 Jan 2008 16:47:58 +0000
distcc 2.18.3-Apple.1 powerpc-apple-darwin8.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r04.2, 2.5.1-r4
sys-devel/autoconf:  2.13, 2.61-r01.1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
ACCEPT_KEYWORDS="x86-macos ~x86-macos"
CBUILD="i686-apple-darwin8"
CFLAGS="-O2 -march=nocona -pipe"
CHOST="i686-apple-darwin8"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=nocona -pipe"
DISTDIR="/Users/tetsushi/Gentoo/usr/portage/distfiles"
EPREFIX="/Users/tetsushi/Gentoo"
FEATURES="distlocks metadata-transfer nostrip preserve-libs sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.gg3.net/ ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LINGUAS="ja en it"
MAKEOPTS="-j3"
PKGDIR="/Users/tetsushi/Gentoo/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/Users/tetsushi/Gentoo/var/tmp"
PORTDIR="/Users/tetsushi/Gentoo/usr/portage"
PORTDIR_OVERLAY="/Users/tetsushi/Gentoo/usr/portage/local/layman/prefix-users /Users/tetsushi/Gentoo/usr/portage/local/exp /Users/tetsushi/Gentoo/usr/portage/local/log"
SYNC="svn+http://overlays.gentoo.org/svn/proj/alt/trunk/prefix-overlay"
USE="aqua cjk coreaudio cracklib midi mmx mmxext ncurses nls objc objc++ prefix readline sse sse2 ssl unicode x86-macos zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ja en it" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Fabian Groffen gentoo-dev 2008-01-07 20:33:46 UTC
Thank you VERY much for finding this.  The cause is binutils-config, which sets ROOT to ROOT/EPREFIX, and hence causes the double prefix as portage returns and tries to do stuff.

odcctools ebuild (binutils for Darwin) runs in pkg_config binutils-config to set the new linker.

binutils-config itself changes ROOT when set into an absolute path if relative.  In prefix, binutils-config also adds EPREFIX to ROOT, to cheaply get prefix support from binutils-config.

@zmedico: is it possible to "protect" Portage from picking up this changed variable.  ROOT is quite important (so are other vars) and when modified in called code, should IMO not affect Portage, e.g. it should be immume for changes to it (does it make sense?).

Would it make sense to declare ROOT as a read-only variable, like P, PN, etc.?
Comment 2 Zac Medico gentoo-dev 2008-01-08 21:56:18 UTC
(In reply to comment #1)
> @zmedico: is it possible to "protect" Portage from picking up this changed
> variable.  ROOT is quite important (so are other vars) and when modified in
> called code, should IMO not affect Portage, e.g. it should be immume for
> changes to it (does it make sense?).
> 
> Would it make sense to declare ROOT as a read-only variable, like P, PN, etc.?

The drawback of declaring variables readonly is that it makes it impossible to ebuilds to override them as local variables when necessary. For example, the gimp ebuild declares AA as an empty local variable in src_compile in order to prevent the real value from interfering with econf. When we make variables readonly, ebuilds need something like the env command if they want to do a local override for some reason. Because of issues like this, I prefer not to make variables with short names like ROOT readonly since ebuilds may need to override them locally. Of course, it it was something like PORTAGE_ROOT then in wouldn't be an issue because ebuilds would almost certainly never need to override it locally.
Comment 3 Fabian Groffen gentoo-dev 2008-02-01 23:07:34 UTC
Thank you very much again.  I fixed binutils-config appropriately and bootstrapping completely from scratch appears not to have the double prefix any more.