[G3D] Bug in g3dbuild

74 views
Skip to first unread message

David Pitchford

unread,
Feb 2, 2012, 11:21:09 AM2/2/12
to G3D Users
I am installing G3D 8.01 on Ubuntu 10.10 and kept getting the error

Compiling FFMPEG requires that environment variable TMPDIR refer to a
writable directory. Current value is $TMPDIR=/tmp

I set my environment variable TMPDIR to a writable directory, but the
program took no notice of this change. It turned out that as I was
running buildg3d as root, it was apparently being passed a different
set of environment variables than python normally would be passed, one
that did not include my definition of TMPDIR. I'm not entirely sure
how you would fix this, but that isn't the bug. As a last resort, I
hardwired the TMPDIR I wanted into the code, but kept getting the same
error message. I traced the error to this section of python code,
lines 236-252 of buildg3d in buildNativeFFMPEG.

if linux:
# test that we can write to TMPDIR
TMPDIR = os.environ.get('TMPDIR')
f = 0
if TMPDIR == None:
TMPDIR = '/tmp'
os.environ['TMPDIR'] = TMPDIR
try:
testname = TMPDIR + '/G3D.test'
f = open(testname, 'wb')
f.close()
os.fchmod(testname, stat.S_IRWXU | stat.S_IRWXG |
stat.S_IRWXO)
except:
raise Exception('Compiling FFMPEG requires that
environment variable TMPDIR refer to a writable directory. Current
value is $TMPDIR=' + TMPDIR)

What I discovered was happening was that os.chmod should have been
used instead of os.fchmod, since a string pathname is being passed to
it instead of a file descriptor. This was causing a different error
which was being caught by the blanket except statement and resulting
in the error message which had nothing to do with the actual problem.
Please change the usage to os.chmod and/or modify the except statement
to only catch the expected IOError (testname does not refer to a
writable file) described by the error message. Thank you.

Corey Taylor

unread,
Feb 3, 2012, 2:01:14 PM2/3/12
to g3d-...@googlegroups.com
I believe that changed was made in G3D 9, but I will double check.  I recall this issue with another user last year.
 
corey

Reply all
Reply to author
Forward
0 new messages