Skip to content

exists_make_target edge case bug #9

@adsr

Description

@adsr

exists_make_target fails in an extremely narrow edge case:

user@host:~/tmp/bug$ find
.
./subdir
./Makefile
user@host:~/tmp/bug$ cat Makefile 
clean:
	true
	-$(MAKE) -C subdir clean
user@host:~/tmp/bug$ make clean && echo $?
true
make -C subdir clean
make[1]: Entering directory '/home/adam/tmp/bug/subdir'
make[1]: *** No rule to make target 'clean'.  Stop.
make[1]: Leaving directory '/home/adam/tmp/bug/subdir'
make: [Makefile:3: clean] Error 2 (ignored)
0

In this case, exists_make_target believes clean does not exist as a target because it sees output No rule to make target 'clean', but the target does exist, and would have succeeded.

The inline comment mentions parsing make -p output instead of the current behavior which I believe would be more reliable.

(Follow-up from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1047860)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions