The following command fails when run as a normal user, with FEATURES="fakeroot": PKGDIR=/tmp/mypkg emerge -B gawk tar complains about too many levels of symbolic links. Reproducible: Always Steps to Reproduce: 1. Add fakeroot to FEATURES in make.conf 2. mkdir /tmp/mypkg 3. PKGDIR=/tmp/mypkg emerge -B gawk Actual Results: package phase of ebuild failed with tar error about too many levels of symbolic links. Expected Results: successful binpkg creation. emerge --info '=sys-apps/gawk-4.0.1': Portage 2.1.11.31 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.4, glibc-2.15-r3, 3.5.7-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.5.7-gentoo-x86_64-AMD_Opteron-tm-_Processor_246-with-gentoo-2.1 Timestamp of tree: Sun, 16 Dec 2012 20:00:01 +0000 ld GNU ld (GNU Binutils) 2.22 app-shells/bash: 4.2_p37 dev-lang/python: 2.7.3-r2, 3.2.3 dev-util/cmake: 2.8.9 dev-util/pkgconfig: 0.27.1 sys-apps/baselayout: 2.1-r1 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.5 sys-devel/autoconf: 2.13, 2.68 sys-devel/automake: 1.11.6 sys-devel/binutils: 2.22-r1 sys-devel/gcc: 4.5.4 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.6 (virtual/os-headers) sys-libs/glibc: 2.15-r3 Repositories: gentoo x-portage ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ ftp://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ http://gentoo.netnitco.net" LANG="en_CA.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/james/software/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow 3dnowext X a52 aac acl acpi alsa amd64 bash-completion branding bzip2 cairo cdda cdr cjk cli colord consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif firefox flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv ipv6 jpeg lcms libnotify lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pppd readline sdl session socialweb spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ALSA_CARDS="emu10k1 intel8x0 usb-audio" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fbdev r300 radeon vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON ================================================================= Package Settings ================================================================= sys-apps/gawk-4.0.1 was built with the following: USE="(multilib) nls readline" emerge -pqv '=sys-apps/gawk-4.0.1': [ebuild R ] sys-apps/gawk-4.0.1 USE="nls readline"
Created attachment 332594 [details] environment file for ebuild
Created attachment 332596 [details] build log for ebuild
It seems like it must be a bug in fakeroot, tar, or the interaction between them.
My money's on fakeroot. Overriding syscalls is a bit heavyhanded. Perhaps some kind of FUSE/libarchive filesystem in the staging area would be better?
I've seen this before when making my own chroot to compile things into. I forget exactly but for a while some of the utilities we had I believe 4 symlinks to get to the actual binary. If you copied that whole directory structure in for building you'd easily hit the Linux max of 5. Not that this helps much, but it was something specific with our setup and I've been trying to get packages to not go that deep.
The weird thing is that, for the gawk example cited here, there's another symlink in the same directory as the symlink that errored out, but it looks like that one tarred up just fine. I don't even know what to think about that. Anyway, I've been looking at the FUSE tutorial, and it actually looks like it'll be pretty easy to code something up to do the same thing as fakeroot without messing with the system glibc or using symlinks.
i wonder how fakeroot interacts with sandbox
(In reply to comment #7) > i wonder how fakeroot interacts with sandbox Currently, fakeroot disables sandbox inside the spawn function in pym/portage/package/ebuild/doebuild.py.
Have a look at https://bugs.gentoo.org/show_bug.cgi?id=489016
*** This bug has been marked as a duplicate of bug 489016 ***