[Bug 223564] Using a test script with filename "null" prevent "make install"
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Dec 1 17:55:33 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223564
Alan Somers <asomers at FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|New |Open
CC| |asomers at FreeBSD.org
--- Comment #1 from Alan Somers <asomers at FreeBSD.org> ---
I can confirm the bug. I ran "make && sudo make -dA install" in both the
working and non-working case and compared the output. What I found was very
surprising. In the working (file name is not named "null") case, I see this:
Applying[.MAKE.DEPENDFILE] :T to "/dev/null"
Result[.MAKE.DEPENDFILE] of :T is "null"
Searching for null ...
failed.
Searching for null ...
/usr/home/alans/freebsd/head/share/mk ...
/usr/share/mk ...
failed.
In the non-working (file name is "null") case, I see this:
Applying[.MAKE.DEPENDFILE] :T to "/dev/null"
Result[.MAKE.DEPENDFILE] of :T is "null"
Global:.MAKE.MAKEFILES = /usr/home/alans/freebsd/head/share/mk/sys.mk
/usr/home/alans/freebsd/head/share/mk/local.sys.env.mk
/usr/home/alans/freebsd/head/share/mk/src.sys.env.mk
/usr/home/alans/freebsd/head/s
Parse_SetInput: file
/usr/obj/usr/home/alans/freebsd/head/amd64.amd64/tests/bug/testing/null, line
0, fd -1, nextbuf 0x414cc0, arg 0x800d647c0
Global:.PARSEDIR =
/usr/obj/usr/home/alans/freebsd/head/amd64.amd64/tests/bug/testing
Global:.PARSEFILE = null
ParseSetParseFile: ${.PARSEDIR} =
`/usr/obj/usr/home/alans/freebsd/head/amd64.amd64/tests/bug/testing'
${.PARSEFILE} = `null'
ParseReadLine (3): 'atf_test_case "dummy" "cleanup"'
ParseDoDependency(atf_test_case "dummy" "cleanup")
So it looks like in every case make thinks that /dev/null is a depend file (the
thing that is normally named Makefile.depend) for the target, and tries to read
commands from it. Also, for some reason it strips off the dirname. Most of
the time, the file can't be found. But if a file named "null" exists, then
make will try to read commands from it. The target doesn't even need to be
named "null". The bug can be reproduced as long as a file named "null" is
present that contains invalid make syntax. For example:
$ cd /usr/src/tests/etc/rc.d
$ echo "a b c" > null
$ make && sudo make install
make: "/usr/src/tests/etc/rc.d/null" line 1: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/src/tests/etc/rc.d
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-testing
mailing list