# HG changeset patch # User Doug Simon # Date 1434915793 -7200 # Node ID db48a62aba3624e5076412161521c1a3cced15f8 # Parent 56c50504d60d9c79ebeeb49cde4cdee5ebf67e88 only (re)make archives from build command if at least one compilation occurred diff -r 56c50504d60d -r db48a62aba36 mx.graal/mx_graal.py --- a/mx.graal/mx_graal.py Sat Jun 20 12:37:01 2015 +0200 +++ b/mx.graal/mx_graal.py Sun Jun 21 21:43:13 2015 +0200 @@ -2370,7 +2370,6 @@ optionsOwner = arcname[len('META-INF/jvmci.options/'):] provider = optionsOwner + '_Options' self.expectedOptionsProviders.add(provider.replace('.', '/') + '.class') - #assert exists(providerClassfile), 'missing generated Options provider ' + providerClassfile self.services.setdefault('com.oracle.jvmci.options.Options', []).append(provider) return False @@ -2382,7 +2381,8 @@ assert len(self.expectedOptionsProviders) == 0, 'missing generated Options providers:\n ' + '\n '.join(self.expectedOptionsProviders) for service, providers in self.jvmciServices.iteritems(): arcname = 'META-INF/jvmci.services/' + service - self.arc.zf.writestr(arcname, '\n'.join(providers)) + # Convert providers to a set before printing to remove duplicates + self.arc.zf.writestr(arcname, '\n'.join(frozenset(providers))) def mx_post_parse_cmd_line(opts): # # TODO _minVersion check could probably be part of a Suite in mx? diff -r 56c50504d60d -r db48a62aba36 mxtool/mx.py --- a/mxtool/mx.py Sat Jun 20 12:37:01 2015 +0200 +++ b/mxtool/mx.py Sun Jun 21 21:43:13 2015 +0200 @@ -316,7 +316,8 @@ for service, providers in services.iteritems(): arcname = 'META-INF/services/' + service - arc.zf.writestr(arcname, '\n'.join(providers)) + # Convert providers to a set before printing to remove duplicates + arc.zf.writestr(arcname, '\n'.join(frozenset(providers))) self.notify_updated() @@ -3119,17 +3120,18 @@ log('Compiling {0} failed'.format(t.proj.name)) abort('{0} Java compilation tasks failed'.format(len(failed))) - if args.java and not args.only: - files = [] - for dist in sorted_dists(): - if dist not in updatedAnnotationProcessorDists: - archive(['@' + dist.name]) - if args.check_distributions and not dist.isProcessorDistribution: - with zipfile.ZipFile(dist.path, 'r') as zf: - files.extend([member for member in zf.namelist() if not member.startswith('META-INF')]) - dups = set([x for x in files if files.count(x) > 1]) - if len(dups) > 0: - abort('Distributions overlap! duplicates: ' + str(dups)) + if len(tasks) != 0: + if args.java and not args.only: + files = [] + for dist in sorted_dists(): + if dist not in updatedAnnotationProcessorDists: + archive(['@' + dist.name]) + if args.check_distributions and not dist.isProcessorDistribution: + with zipfile.ZipFile(dist.path, 'r') as zf: + files.extend([member for member in zf.namelist() if not member.startswith('META-INF')]) + dups = set([x for x in files if files.count(x) > 1]) + if len(dups) > 0: + abort('Distributions overlap! duplicates: ' + str(dups)) if suppliedParser: return args