Meson has a common pattern of using 'if len(foo) == 0:' or
'if len(foo) != 0:', however, this is a common anti-pattern in python.
Instead tests for emptiness/non-emptiness should be done with a simple
'if foo:' or 'if not foo:'
Consider the following:
>>> import timeit
>>> timeit.timeit('if len([]) == 0: pass')
0.10730923599840025
>>> timeit.timeit('if not []: pass')
0.030033907998586074
>>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass')
0.1154778649979562
>>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass")
0.08259823200205574
>>> timeit.timeit('if len("") == 0: pass')
0.089759664999292
>>> timeit.timeit('if not "": pass')
0.02340641999762738
>>> timeit.timeit('if len("foo") == 0: pass')
0.08848102600313723
>>> timeit.timeit('if not "foo": pass')
0.04032287199879647
And for the one additional case of 'if len(foo.strip()) == 0', which can
be replaced with 'if not foo.isspace()'
>>> timeit.timeit('if len(" ".strip()) == 0: pass')
0.15294511600222904
>>> timeit.timeit('if " ".isspace(): pass')
0.09413968399894657
>>> timeit.timeit('if len(" abc".strip()) == 0: pass')
0.2023209120015963
>>> timeit.timeit('if " abc".isspace(): pass')
0.09571301700270851
In other words, it's always a win to not use len(), when you don't
actually want to check the length.
At installation, if the executable is a ELF file, we try to fix the
dependencies in the binary section.
If a executable has been compiled with the --static flag, there is
no .dynamic section in the ELF binary and so we need to handle this case.
************* Module depfixer
E: 57,39: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 57,63: Instance of 'DynamicEntry' has no 'SxwordSize' member (no-member)
E: 58,37: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 58,60: Instance of 'DynamicEntry' has no 'XWordSize' member (no-member)
E: 60,39: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 60,62: Instance of 'DynamicEntry' has no 'SwordSize' member (no-member)
E: 61,37: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 61,59: Instance of 'DynamicEntry' has no 'WordSize' member (no-member)
E: 65,36: Instance of 'DynamicEntry' has no 'Sxword' member (no-member)
E: 66,36: Instance of 'DynamicEntry' has no 'XWord' member (no-member)
E: 68,36: Instance of 'DynamicEntry' has no 'Sword' member (no-member)
E: 69,36: Instance of 'DynamicEntry' has no 'Word' member (no-member)
E: 79,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 79,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 81,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 81,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 84,42: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 84,65: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 86,42: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 86,64: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 88,37: Instance of 'SectionHeader' has no 'Addr' member (no-member)
E: 88,59: Instance of 'SectionHeader' has no 'AddrSize' member (no-member)
E: 90,39: Instance of 'SectionHeader' has no 'Off' member (no-member)
E: 90,60: Instance of 'SectionHeader' has no 'OffSize' member (no-member)
E: 93,41: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E: 93,64: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E: 95,41: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 95,63: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 97,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 97,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E: 99,37: Instance of 'SectionHeader' has no 'Word' member (no-member)
E: 99,59: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:102,46: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:102,69: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:104,46: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:104,68: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:107,44: Instance of 'SectionHeader' has no 'XWord' member (no-member)
E:107,67: Instance of 'SectionHeader' has no 'XWordSize' member (no-member)
E:109,44: Instance of 'SectionHeader' has no 'Word' member (no-member)
E:109,66: Instance of 'SectionHeader' has no 'WordSize' member (no-member)
E:148,36: Instance of 'Elf' has no 'Half' member (no-member)
E:148,60: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:149,39: Instance of 'Elf' has no 'Half' member (no-member)
E:149,63: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:150,39: Instance of 'Elf' has no 'Word' member (no-member)
E:150,63: Instance of 'Elf' has no 'WordSize' member (no-member)
E:151,37: Instance of 'Elf' has no 'Addr' member (no-member)
E:151,61: Instance of 'Elf' has no 'AddrSize' member (no-member)
E:152,37: Instance of 'Elf' has no 'Off' member (no-member)
E:152,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:153,37: Instance of 'Elf' has no 'Off' member (no-member)
E:153,60: Instance of 'Elf' has no 'OffSize' member (no-member)
E:154,37: Instance of 'Elf' has no 'Word' member (no-member)
E:154,61: Instance of 'Elf' has no 'WordSize' member (no-member)
E:155,38: Instance of 'Elf' has no 'Half' member (no-member)
E:155,62: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:156,41: Instance of 'Elf' has no 'Half' member (no-member)
E:156,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:157,37: Instance of 'Elf' has no 'Half' member (no-member)
E:157,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:158,41: Instance of 'Elf' has no 'Half' member (no-member)
E:158,65: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:159,37: Instance of 'Elf' has no 'Half' member (no-member)
E:159,61: Instance of 'Elf' has no 'HalfSize' member (no-member)
E:160,40: Instance of 'Elf' has no 'Half' member (no-member)
E:160,64: Instance of 'Elf' has no 'HalfSize' member (no-member)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>