From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91627 invoked by alias); 8 Dec 2018 22:22:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 91610 invoked by uid 89); 8 Dec 2018 22:22:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=sk:enable_, H*r:8.14.5, online X-HELO: mx.sdf.org Received: from ol.sdf.org (HELO mx.sdf.org) (205.166.94.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Dec 2018 22:22:15 +0000 Received: from sdf.org (IDENT:coypu@sdf.lonestar.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id wB8MLWNp014228 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO) for ; Sat, 8 Dec 2018 22:21:32 GMT Received: (from coypu@localhost) by sdf.org (8.15.2/8.12.8/Submit) id wB8MLWPC007135 for gcc-patches@gcc.gnu.org; Sat, 8 Dec 2018 22:21:32 GMT Date: Sat, 08 Dec 2018 22:22:00 -0000 From: coypu@sdf.org To: gcc-patches@gcc.gnu.org Subject: [PATCH] Provide early warning about configure failure Message-ID: <20181208222132.GA204@SDF.ORG> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2018-12/txt/msg00525.txt.bz2 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 639 Hi folks, I was bitten by this, and it seemed like a few people online had similar issues (for example https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65794). We run a configure script from another configure script, to generate auto-build.h. Secondary configure might fail. This failure isn't fatal, and we continue running a configure script. The output is obscured by a lot of configure messages. We fail later auto-build.h not existing. I added a test to see if making auto-build.h succeeded and fail & warn otherwise. As an added bonus, it means the secondary configure config.log stays around to inspect. Let me know what you think. --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="auto-build.diff" Content-length: 1713 configure.ac: Fail early if creating auto-build.h fails configure: regen --- gcc/configure | 8 ++++++-- gcc/configure.ac | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/configure b/gcc/configure index dc4298097..5bf4b2954 100755 --- a/gcc/configure +++ b/gcc/configure @@ -11893,6 +11893,10 @@ else --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias + if test ! -f auto-host.h ; then + as_fn_error $? "Failed to generate build configuration" "$LINENO" 5 + fi + # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. mv auto-host.h ../auto-build.h @@ -18572,7 +18576,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18575 "configure" +#line 18579 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18678,7 +18682,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18681 "configure" +#line 18685 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 2a1f3bb39..5f05ab8da 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1740,6 +1740,10 @@ else --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias + if test ! -f auto-host.h ; then + AC_MSG_ERROR([Failed to generate build configuration]) + fi + # We just finished tests for the build machine, so rename # the file auto-build.h in the gcc directory. mv auto-host.h ../auto-build.h -- 2.19.1 --7AUc2qLy4jB3hD7Z--