Mercurial > hg > truffle
comparison mxtool/mx.py @ 21634:0a2fc09f6ed6
mx: make dependency omission more strict so that a distribution that lists a non-existent project is detected
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 01 Jun 2015 15:24:37 +0200 |
parents | 60154926b513 |
children | ec47283499ef |
comparison
equal
deleted
inserted
replaced
21633:9966b358bc2b | 21634:0a2fc09f6ed6 |
---|---|
1212 # JDK for a project. Also remove projects whose Java compliance requirement | 1212 # JDK for a project. Also remove projects whose Java compliance requirement |
1213 # cannot be satisfied by the configured JDKs. | 1213 # cannot be satisfied by the configured JDKs. |
1214 # | 1214 # |
1215 # Removed projects and libraries are also removed from | 1215 # Removed projects and libraries are also removed from |
1216 # distributions in they are listed as dependencies. | 1216 # distributions in they are listed as dependencies. |
1217 ommittedDeps = set() | |
1217 for d in sorted_deps(includeLibs=True): | 1218 for d in sorted_deps(includeLibs=True): |
1218 if d.isLibrary(): | 1219 if d.isLibrary(): |
1219 if d.optional: | 1220 if d.optional: |
1220 try: | 1221 try: |
1221 d.optional = False | 1222 d.optional = False |
1224 path = None | 1225 path = None |
1225 finally: | 1226 finally: |
1226 d.optional = True | 1227 d.optional = True |
1227 if not path: | 1228 if not path: |
1228 logv('[omitting optional library {0} as {1} does not exist]'.format(d, d.path)) | 1229 logv('[omitting optional library {0} as {1} does not exist]'.format(d, d.path)) |
1230 ommittedDeps.add(d.name) | |
1229 del _libs[d.name] | 1231 del _libs[d.name] |
1230 self.libs.remove(d) | 1232 self.libs.remove(d) |
1231 elif d.isProject(): | 1233 elif d.isProject(): |
1232 if java(d.javaCompliance, cancel='some projects will be omitted which may result in errrors') is None: | 1234 if java(d.javaCompliance, cancel='some projects will be omitted which may result in errrors') is None: |
1233 logv('[omitting project {0} as Java compliance {1} cannot be satisfied by configured JDKs]'.format(d, d.javaCompliance)) | 1235 logv('[omitting project {0} as Java compliance {1} cannot be satisfied by configured JDKs]'.format(d, d.javaCompliance)) |
1236 ommittedDeps.add(d.name) | |
1234 del _projects[d.name] | 1237 del _projects[d.name] |
1235 self.projects.remove(d) | 1238 self.projects.remove(d) |
1236 else: | 1239 else: |
1237 for name in list(d.deps): | 1240 for name in list(d.deps): |
1238 jreLib = _jreLibs.get(name) | 1241 jreLib = _jreLibs.get(name) |
1239 if jreLib: | 1242 if jreLib: |
1240 if not jreLib.is_present_in_jdk(java(d.javaCompliance)): | 1243 if not jreLib.is_present_in_jdk(java(d.javaCompliance)): |
1241 if jreLib.optional: | 1244 if jreLib.optional: |
1242 logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) | 1245 logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) |
1246 ommittedDeps.add(d.name) | |
1243 del _projects[d.name] | 1247 del _projects[d.name] |
1244 self.projects.remove(d) | 1248 self.projects.remove(d) |
1245 else: | 1249 else: |
1246 abort('JRE library {0} required by {1} not found'.format(jreLib, d)) | 1250 abort('JRE library {0} required by {1} not found'.format(jreLib, d)) |
1247 elif not dependency(name, fatalIfMissing=False): | 1251 elif not dependency(name, fatalIfMissing=False): |
1248 logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) | 1252 logv('[omitting project {0} as dependency {1} is missing]'.format(d, name)) |
1253 ommittedDeps.add(d.name) | |
1249 del _projects[d.name] | 1254 del _projects[d.name] |
1250 self.projects.remove(d) | 1255 self.projects.remove(d) |
1251 for dist in _dists.itervalues(): | 1256 for dist in _dists.itervalues(): |
1252 for name in list(dist.deps): | 1257 for name in list(dist.deps): |
1253 if not dependency(name, fatalIfMissing=False): | 1258 if name in ommittedDeps: |
1254 logv('[omitting {0} from distribution {1}]'.format(name, dist)) | 1259 logv('[omitting {0} from distribution {1}]'.format(name, dist)) |
1255 dist.deps.remove(name) | 1260 dist.deps.remove(name) |
1256 | 1261 |
1257 if hasattr(self, 'mx_post_parse_cmd_line'): | 1262 if hasattr(self, 'mx_post_parse_cmd_line'): |
1258 self.mx_post_parse_cmd_line(opts) | 1263 self.mx_post_parse_cmd_line(opts) |