Message ID | 54890AA3.4040706@redhat.com |
---|---|
State | New |
Headers | show |
"Carlos O'Donell" <carlos@redhat.com> writes: > We have three options, close stdin, more awk to detect missing input > or more shell. I chose the latter, but we could probably fix this with > `exec 0>&-` in the shell if anyone objects to using find/grep or more > awk. Just redirect from /dev/null. Andreas.
On Wed, 10 Dec 2014, Carlos O'Donell wrote: > If you have a failed build, and run `make check` it could hang forever > in check-local-headers.sh because the awk script waits reading stdin > if the input shell glob expands to nothing (missing input). > > We have three options, close stdin, more awk to detect missing input > or more shell. I chose the latter, but we could probably fix this with > `exec 0>&-` in the shell if anyone objects to using find/grep or more > awk. We have consensus to redirect test input from /dev/null (unless a test needs input from some other file, of course). See bug 14753.
diff --git a/scripts/check-local-headers.sh b/scripts/check-local-headers.sh index 9bffed3..5404e4b 100755 --- a/scripts/check-local-headers.sh +++ b/scripts/check-local-headers.sh @@ -25,6 +25,13 @@ cd "$objpfx" # OK if *.os is missing. shopt -s nullglob +# Don't hang in awk reading stdin if there is no input to the test. +# The most likely cause of this failure is a build failure. +if ! find . -regex '.*\.o[sS]*\.d' | grep -q '.*\.o[sS]*\.d'; then + echo "FAIL: No input files to read." + exit 1 +fi + # Search all dependency files for file names in the include directory. # There are a few system headers we are known to use. # These include Linux kernel headers (asm*, arch, and linux),