diff options
author | Jack Lloyd <[email protected]> | 2016-09-01 10:35:32 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-09-01 10:35:32 -0400 |
commit | 6680ef45401dd205b6d9497fa48ed590e4c5c1d6 (patch) | |
tree | acd1bca9081ef70a5c665d1070d96c6219e8945b | |
parent | de94c3778d91fa329f83eeb93efb1b7eb6a35f13 (diff) |
Check for non-existent modules in policy files.
Fix policy files.
GH #614
-rwxr-xr-x | configure.py | 19 | ||||
-rw-r--r-- | src/build-data/policy/bsi.txt | 6 | ||||
-rw-r--r-- | src/build-data/policy/modern.txt | 5 |
3 files changed, 20 insertions, 10 deletions
diff --git a/configure.py b/configure.py index 82f30cd47..5ab812fad 100755 --- a/configure.py +++ b/configure.py @@ -478,6 +478,8 @@ Generic lexer function for info.txt and src/build-data files """ def lex_me_harder(infofile, to_obj, allowed_groups, name_val_pairs): + to_obj.infofile = infofile + # Format as a nameable Python variable def py_var(group): return group.replace(':', '_') @@ -733,6 +735,19 @@ class ModulePolicyInfo(object): lex_me_harder(infofile, self, ['required', 'if_available', 'prohibited'], {}) + def cross_check(self, modules): + + def check(tp, lst): + for mod in lst: + if mod not in modules: + logging.error("Module policy %s includes non-existent module %s in <%s>" % ( + self.infofile, mod, tp)) + + check('required', self.required) + check('if_available', self.if_available) + check('prohibited', self.prohibited) + + class ArchInfo(object): def __init__(self, infofile): lex_me_harder(infofile, self, @@ -838,7 +853,6 @@ class CompilerInfo(object): self.mach_abi_linking = force_to_dict(self.mach_abi_linking) self.isa_flags = force_to_dict(self.isa_flags) - self.infofile = infofile self.mach_opt_flags = {} while self.mach_opt != []: @@ -1887,6 +1901,9 @@ def main(argv = None): module_policies = load_build_data('module policy', 'policy', ModulePolicyInfo) + for policy in module_policies.values(): + policy.cross_check(modules) + if options.list_modules: for k in sorted(modules.keys()): print(k) diff --git a/src/build-data/policy/bsi.txt b/src/build-data/policy/bsi.txt index 048f63892..c4ed27648 100644 --- a/src/build-data/policy/bsi.txt +++ b/src/build-data/policy/bsi.txt @@ -58,7 +58,6 @@ beos_stats cryptoapi_rng darwin_secrandom dev_random -hres_timer proc_walk rdrand rdseed @@ -70,9 +69,7 @@ system_rng # utils locking_allocator -simd_altivec -simd_scalar -simd_sse2 +simd </if_available> <prohibited> @@ -140,7 +137,6 @@ eme_raw #emsa_pkcs1 // needed for tls emsa_raw emsa_x931 -emsa1_bsi # hash blake2 diff --git a/src/build-data/policy/modern.txt b/src/build-data/policy/modern.txt index a98ec5077..fa4b45d74 100644 --- a/src/build-data/policy/modern.txt +++ b/src/build-data/policy/modern.txt @@ -56,9 +56,7 @@ aes_ssse3 serpent_simd threefish_avx2 -simd_scalar -simd_sse2 -simd_altivec +simd rdrand_rng system_rng @@ -68,7 +66,6 @@ beos_stats cryptoapi_rng darwin_secrandom dev_random -hres_timer proc_walk rdrand rdseed |