Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Dec 2017 17:55:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-testing@freebsd.org
Subject:   [Bug 223564] Using a test script with filename "null" prevent "make install"
Message-ID:  <bug-223564-32464-6pjPqkAybp@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-223564-32464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-223564-32464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223564

Alan Somers <asomers@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |asomers@FreeBSD.org

--- Comment #1 from Alan Somers <asomers@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 thi=
s:

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 =3D /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, li=
ne
0, fd -1, nextbuf 0x414cc0, arg 0x800d647c0
  Global:.PARSEDIR =3D
/usr/obj/usr/home/alans/freebsd/head/amd64.amd64/tests/bug/testing
  Global:.PARSEFILE =3D null
  ParseSetParseFile: ${.PARSEDIR} =3D
`/usr/obj/usr/home/alans/freebsd/head/amd64.amd64/tests/bug/testing'
${.PARSEFILE} =3D `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

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223564-32464-6pjPqkAybp>