From 9cd8973eb8ed881dfbc592772fdc0724c5d1a111 Mon Sep 17 00:00:00 2001 From: David Seikel Date: Wed, 2 Mar 2011 00:24:13 +1000 Subject: Bugfix from snowglobe - stops the build system from trying to build the viewer with 6 extra computers I don't have. Forward ported from the old meta viewer. --- linden/indra/develop.py | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/develop.py b/linden/indra/develop.py index af7e42f..a705719 100755 --- a/linden/indra/develop.py +++ b/linden/indra/develop.py @@ -367,23 +367,31 @@ class LinuxSetup(UnixSetup): cpus += m and int(m.group(1)) or 1 return hosts, cpus - def mk_distcc_hosts(): + def mk_distcc_hosts(basename, range, num_cpus): '''Generate a list of LL-internal machines to build on.''' loc_entry, cpus = localhost() hosts = [loc_entry] dead = [] - stations = [s for s in xrange(36) if s not in dead] + stations = [s for s in xrange(range) if s not in dead] random.shuffle(stations) hosts += ['station%d.lindenlab.com/2,lzo' % s for s in stations] + hosts += ['%s%d.lindenlab.com/%d,lzo' % (basename, s, num_cpus) for s in stations] cpus += 2 * len(stations) return ' '.join(hosts), cpus if job_count is None: hosts, job_count = count_distcc_hosts() - if hosts == 1 and socket.gethostname().startswith('station'): - hosts, job_count = mk_distcc_hosts() - os.putenv('DISTCC_HOSTS', hosts) - opts.extend(['-j', str(2)]) + if hosts == 1: + hostname = socket.gethostname() + if hostname.startswith('station'): + hosts, job_count = mk_distcc_hosts('station', 36, 2) + os.environ['DISTCC_HOSTS'] = hosts + if hostname.startswith('eniac'): + hosts, job_count = mk_distcc_hosts('eniac', 71, 2) + os.environ['DISTCC_HOSTS'] = hosts + opts.extend(['-j', str(job_count)]) + + '''opts.extend(['-j', str(2)])''' if targets: targets = ' '.join(targets) @@ -729,6 +737,15 @@ Examples: ''' def main(arguments): + if os.getenv('DISTCC_DIR') is None: + distcc_dir = os.path.join(getcwd(), '.distcc') + if not os.path.exists(distcc_dir): + os.mkdir(distcc_dir) + print "setting DISTCC_DIR to %s" % distcc_dir + os.environ['DISTCC_DIR'] = distcc_dir + else: + print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR') + setup = setup_platform[sys.platform]() try: opts, args = getopt.getopt( -- cgit v1.1