compiledb icon indicating copy to clipboard operation
compiledb copied to clipboard

Redundant match for square brackets when matching 'Entering directory' and 'Leaving directory'

Open idanpa opened this issue 5 years ago • 4 comments

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 avatar Nov 15 '19 18:11 idanpa

@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.

lyonlh avatar Dec 04 '19 08:12 lyonlh

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?

idanpa avatar Dec 04 '19 10:12 idanpa

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 avatar Dec 04 '19 22:12 agnjunio

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!

lyonlh avatar Dec 05 '19 02:12 lyonlh