Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22570 - env var TMPDIR causes many packages to fail during unpack
Summary: env var TMPDIR causes many packages to fail during unpack
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Nicholas Jones (RETIRED)
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-10 12:48 UTC by John Whitney
Modified: 2003-06-29 19:27 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 John Whitney 2003-06-10 12:48:26 UTC
If the TMPDIR environment variable is set then the gentoo-sources-2.4.20-r5
ebuild fails during the "unpack" stage

Reproducible: Always
Steps to Reproduce:
1. export TMPDIR="~/tmp"
2. emerge gentoo-sources

Actual Results:  
...
Current kernel version is 2.4.20
Scanning patch directory: '.'
Checking 000_o1_pe_ll_030412_ck_2.4.20 (plain text format)... patch: **** Can't
create file '~/tmp/ppcIo0jQ' : No such file or directory
cat: write error: Broken pipe
can't be applied.  Please modify the patch.

!!! ERROR: sys-kernel/gentoo-sources-2.4.20-r5 failed.
!!! Function kernel_src_unpack, Line 83, Exitcode 1
!!! Addpatches failed, bad KERNEL_EXCLUDE?


Expected Results:  
Applied Gentoo patches to the vanilla kernel

This is a showstopper for people who have TMPDIR set and don't know why they are
getting errors.  Here's the output I get from emerge info:

Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.20-gentoo-r3 i686 AMD Athlon(tm) XP 2000+
GENTOO_MIRRORS="http://localhost ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb
/usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss apm avi crypt encode gif jpeg libg++ libwww mikmod mmx ncurses nls
pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline
arts bonobo svga tcltk java guile X sdl gpm tcpd pam ssl perl python esd imlib
oggvorbis motif opengl mozilla scanner dga cups usb qt kde gtk gnome 3dnow mpeg
mysql dvd"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O2 -mcpu=athlon-xp -march=athlon-xp -fomit-frame-pointer
-falign-functions=4 -pipe -mmmx -m3dnow"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 1 John Whitney 2003-06-10 13:33:40 UTC
Apparantly, this bug was more widespread and not gentoo-sources specific... Other patched packages fail too, including gcc, xfree, binutils, vim, gpm, and lynx.  
Comment 2 Jay Pfeifer (RETIRED) gentoo-dev 2003-06-11 06:51:07 UTC
this is not a gentoo-sources bug. looks like addpatches... 
 
who maintains that package? 
 
Jay 
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2003-06-14 10:53:36 UTC
This is a user error. We can't fix everything that can be broken.
TMPDIR is more than likely not doing expansion on the value it
contains. Set it to a real path and make sure that path has
sane build-rights.

Unless someone takes interest, I will close this bug Invalid.
Comment 4 John Whitney 2003-06-14 14:08:14 UTC
Having TMPDIR set is a user error?  Certainly not!  This turned out to be a really simple problem with a really simple fix.  The change should be made in ebuild.sh.  Search for "TMPDIR" in this file.  As you see, this problem has already been fixed for the "compile" and "install" stages.  Simply copy the two environment assignments (and comments) into the dyn_unpack() function before src_unpack() is called.  I have tested this fix and it works perfectly.  Frankly, I consider this a crucial bug - affecting practically everyone who uses TMPDIR.  
BTW, A better fix would be to place the code at a global level before any of the dyn_* functions are called, removing the need for several copies.
Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2003-06-29 19:27:22 UTC
TMP and TMPDIR moved to ${T} as in dyn_compile

fixed in cvs