nornagon/ninja — comment on commit 9be1597a218e61fd6f7f5b3c3a52ebd2e51cac6b
File: misc/ninja_syntax.py line 95
By nico:

That's not good. See:

>>> import re
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'asdf asdf').start()
3 # ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', ' asdf').start()
0 # hm, broken
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'a asdf').start()
0 # ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', '$ asdf').start()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'NoneType' object has no attribute 'start'
# ^ ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', '$$ asdf').start()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'NoneType' object has no attribute 'start'
# ^ hm, probably broken
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', '$$a asdf').start()
0 # looks wrong to me
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 's asdf').start()
0 # ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'sd asdf').start()
1 # ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'sd$ asdf').start()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'NoneType' object has no attribute 'start'
# ^ ok
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'sd$$ asdf').start()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'NoneType' object has no attribute 'start'
>>> re.search('((\$\$)+([^$]|^)|[^$]|^) ', 'sd$$a asdf').start()
2 # looks wrong to me

The first problem is breaking the chromium build with werror='', because build/common.gypi contains

'cflags': [
'<(werror)', # See note above about the werror variable.
'-pthread',
# ...
]

With werror='', the first entry in that list is emtpy, and due to the first wrongness, -pthread gets written as 'pthread' (without the dash) into the ninja file. See http://crbug.com/108428

The output above suggests that $$ handling is broken too.

I tried taking a look, but running `python ninja_test.py` in misc doesn't even terminate :-/