compiledb
compiledb copied to clipboard
Redundant match for square brackets when matching 'Entering directory' and 'Leaving directory'
On parser.py lines 35 and 36:
# Leverage `make --print-directory` option
make_enter_dir = re.compile(r"^\s*make\[\d+\]: Entering directory [`\'\"](?P<dir>.*)[`\'\"]\s*$")
make_leave_dir = re.compile(r"^\s*make\[\d+\]: Leaving directory .*$")
I see you expect make to print some number inside square brackets.
Why is it so? My make doesn't print this number (GNU Make 4.1 on Ubuntu 16.04) with the given flags from the manual (make -Bnwk -C directory)
@idanpa It's about the depth of recursion. You should get the point from https://stackoverflow.com/questions/27943149/what-does-numbers-in-make1-make2-make3-mean and https://stackoverflow.com/questions/12842469/makes-output-the-number-in-the-brackets. The reason your make doesn't print the number is there's no recursive make of your project.
Thanks @lyonlh for explaining. This is causing the parser to fail on non recursive make. Should I pass some extra flag to make or maybe you should make this regex part optional?
I guess the obvious fix for this is to make the brackets in the regex optional. Someone else agree? If so, I can patch this right away.
I guess the obvious fix for this is to make the brackets in the regex optional. Someone else agree? If so, I can patch this right away.
@agnjunio You're right. Thanks!