From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28442 invoked by alias); 8 Jul 2015 12:47:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 28432 invoked by uid 89); 8 Jul 2015 12:47:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <559D1BC3.1060703@redhat.com> Date: Wed, 08 Jul 2015 12:47:00 -0000 From: "Carlos O'Donell" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Siddhesh Poyarekar CC: Feng Gao , GNU C Library Subject: Re: [PATCH] Use "|" instead of "+" when combine the _IO_LINE_BUF and _IO_UNBUFFERED flags References: <20150707073145.GK13549@spoyarek.pnq.redhat.com> <20150707162858.GR13549@spoyarek.pnq.redhat.com> <559CE58A.90706@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00242.txt.bz2 On 07/08/2015 05:44 AM, Siddhesh Poyarekar wrote: > On 8 July 2015 at 14:25, Carlos O'Donell wrote: >> This is a super annoying failure mode that happens when `make` fails or >> is not run. The fix is as follows, and I'll check it in shortly. >> >> 2015-07-08 Carlos O'Donell >> >> * Makefile ($(objpfx)check-local-headers.out): >> Redirect input from /dev/null. >> >> diff --git a/Makefile b/Makefile >> index 658ccfa..c88b2e5 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -262,7 +262,7 @@ endif >> >> $(objpfx)check-local-headers.out: scripts/check-local-headers.sh >> AWK='$(AWK)' scripts/check-local-headers.sh \ >> - "$(includedir)" "$(objpfx)" > $@; \ >> + "$(includedir)" "$(objpfx)" < /dev/null > $@; \ >> $(evaluate-test) > > That looks like a hack. Does it hang because $(objpfx) and > $(includedir) are not set? A better fix ought to be to ensure that > either 'make check' invokes make (and hence sets things up for the > check target) or it fails early and cleanly, i.e. irrespective of > whether the check-local-headers test is run or not. It's not a hack. The script reads from stdin for the list of *.d files that were created by the build, but if there are no *.d files the shell expansion is empty and that forces the script to read from the parent's inherited stdin. Since the parent never writes anything to stdin the awk script blocks on the read forever. As Andreas notes it should dep on the *.d files existing, and that is true. However, even if that were fixed we should still read from /dev/null and fail the test even if all the *.d files were deleted between the time they were created and the script ran (robust). Cheers, Carlos.