comparison mx/commands.py @ 5152:cfdb3c24bd6c

changed Graal class path declaration (back) to a constant that is checked for correctness during building
author Doug Simon <doug.simon@oracle.com>
date Fri, 23 Mar 2012 11:48:39 +0100
parents 276e14614531
children 57546200db29
comparison
equal deleted inserted replaced
5151:5717fc2be01c 5152:cfdb3c24bd6c
435 435
436 def filterXusage(line): 436 def filterXusage(line):
437 if not 'Xusage.txt' in line: 437 if not 'Xusage.txt' in line:
438 sys.stderr.write(line + os.linesep) 438 sys.stderr.write(line + os.linesep)
439 439
440 # Update graal_paths.hpp
441 #for p in mx.project('com.oracle.max.graal.hotspot').all_deps([], False):
442 # out.write(' prepend_to_graal_classpath(scp_compiler, graal_dir, "' + p.name + '");\n')
443 argumentsCpp = join(_graal_home, 'src', 'share', 'vm', 'runtime', 'arguments.cpp')
444 assert exists(argumentsCpp), 'File does not exist: ' + argumentsCpp
445 with open(argumentsCpp) as fp:
446 source = fp.read();
447 decl = 'const char* graal_projects[] = {'
448 start = source.find(decl)
449 assert start != -1, 'Could not find "' + decl + '" in ' + fp.name
450 end = source.find('};', start)
451 assert end != -1, 'Could not find "' + decl + '" ... "};" in ' + fp.name
452 actual = frozenset([a.strip().strip('"') for a in source[start + len(decl):end].split(',')])
453 expected = frozenset([p.name for p in mx.project('com.oracle.graal.hotspot').all_deps([], False)])
454 missing = expected - actual
455 extra = actual - expected
456 if len(missing) != 0:
457 mx.abort(fp.name + ':' + str(source[:start].count('\n') + 1) + ': add missing projects to declaration: ' + ','.join(missing))
458 if len(extra) != 0:
459 mx.abort(fp.name + ':' + str(source[:start].count('\n') + 1) + ': remove projects from declaration: ' + ','.join(extra))
460
440 if platform.system() == 'Windows': 461 if platform.system() == 'Windows':
441 compilelogfile = _graal_home + '/graalCompile.log' 462 compilelogfile = _graal_home + '/graalCompile.log'
442 mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin') 463 mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin')
443 464
444 variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm) 465 variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm)