From patchwork Fri May 22 21:40:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1296476 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Thh+gOxD; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49TKg42Cn4z9sPK for ; Sat, 23 May 2020 07:41:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A1D1920363; Fri, 22 May 2020 21:41:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fRPA7sCGeXWM; Fri, 22 May 2020 21:40:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6CABB204C5; Fri, 22 May 2020 21:40:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9084B1BF9BF for ; Fri, 22 May 2020 21:40:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8869488AA1 for ; Fri, 22 May 2020 21:40:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fJNLt4GDjg3y for ; Fri, 22 May 2020 21:40:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3A4AD88A9D for ; Fri, 22 May 2020 21:40:55 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id f13so9958478wmc.5 for ; Fri, 22 May 2020 14:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QzMvv4CRp7Oz0MomF+tG0INg1umSxfpl0kBrCTC8x5g=; b=Thh+gOxDIado4eyzNSS/DmaffgsMwNN44Sqg/qpStFP/l24g7dProPvfYSdgCUBMHJ 6vv9xC9dO0nd8E3WkBV/hDTWYeyaXMth8aL4tn8p4jvx6uyM9DO/XE6fWnjxNImUmVMl 1GIGM181cfpy55EoLtSufUm+l77l574Aod/0vAPPTyw8ZEMMij52mFvkZBTckQFYGVmz XLA0pX2IinQkfeTJjPhR5hElmPV4kGi/qExsqTLA1RT0oufL+y6OZmsafARTj2YCWva6 bmIVy2qQC53xSBV3gud0+zQoGvSM3+rdSOqq1DxVaMrRav+PmZ4DIpi1vhHrFT6OONdr 6okw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QzMvv4CRp7Oz0MomF+tG0INg1umSxfpl0kBrCTC8x5g=; b=SkgyyznGZzWGvaYCtpFbDPs6m31gXunq0HAkpaR5O2tp0VMioG2MzykSetUGbPsIDo 0dwXQ3WKtlxEVXomBCyQ85Mzyr+qJxLl2JEdJcvtWsoNI5Ry0vfNFXWxPck2E32cH52y TuxSz5DtJvvixwg4KhN09X+mfZ516gawpCmqCBiSYxiKHlSYTwWiGletp0aGmSqNn90s QV7iYPRuvBc1hjRIEznRfhSStrfY85pgbmgLRFP4k/JkRvtihrttCvF7CIZ8OSpYLsoI BCA/1Lcr0PogtGOYz9ZfqD7kW3m4dtYlf8IO+gqpNZwbd9Ygr8IQG6dAzu8CG9pdR8vb XwtA== X-Gm-Message-State: AOAM5313ybrV5Rawz0gEO8q+EL2GFF+pEvqMKfPSVJGCQI9QO1n67MAs 5PEyXNIgVBxzHKNJx+Uo+hjLuNqm X-Google-Smtp-Source: ABdhPJwHDEuhbeyxwxCNAYKIBbAphsbpsQTxDnDwKNyoEQpFbcXlXTclC0rF6Mn0oWClGzJjNZtGMg== X-Received: by 2002:a1c:790b:: with SMTP id l11mr14106458wme.2.1590183653255; Fri, 22 May 2020 14:40:53 -0700 (PDT) Received: from scaer.home ([2a01:cb19:8b51:cb00:c0e2:996c:914c:92d3]) by smtp.gmail.com with ESMTPSA id p10sm10997776wra.78.2020.05.22.14.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 14:40:52 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 22 May 2020 23:40:50 +0200 Message-Id: <22d695ca68ad664cbe5af125683b61c80f828d35.1590183628.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] core.br2-external: fix reporting errors X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a br2-external tree has an issue, e.g. a missing file, or does not have a name, or the name uses invalid cahrs, we report that condition by setting the variable BR2_EXTERNAL_ERROR. That variable is defined in the script support/scripts/br2-external, which outputs it on stdout, and checked by the Makefile. Before d027cd75d09, stdout was explicitly redirected to the generated .mk file, with exec >"${ofile}" as the Makefile and Kconfig fragments were generated each with their own call to the script, and o the validation phase would emit the BR2_EXTERNAL_ERROR variable in the Makefile fragment. But with d027cd75d09, both the Makefile and Kconfig fragmetns were now generated with a single call to the script, and as such the semantics of the scripts changed, and only each of the actual generators, do_mk and do_kconfig, ahd their out put redirected. Which left do_validate with the default stdout. Which would emit BR2_EXTERNAL_ERROR on stdout. In turn, the stdout of the script would be interpreted by as part of the Makefile. But this does not end up very well when a br2-external tree indeed has an error: Makefile:184: *** multiple target patterns. Stop. So we must redirect the output of the validation step to the Makefile fragment. Note that we don't need to append in do_mk, and we can do an overwrite redirection: if we go so far as to call do_mk, it means there was no error, and thus the fragment is empty. Signed-off-by: Yann E. MORIN Reviewed-by: Romain Naour Tested-by: Romain Naour --- support/scripts/br2-external | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 171526f8c8..fdea5aa251 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -33,9 +33,8 @@ main() { # Trap any unexpected error to generate a meaningful error message trap "error 'unexpected error while generating ${ofile}\n'" ERR - do_validate ${@//:/ } - mkdir -p "${outputdir}" + do_validate "${outputdir}" ${@//:/ } do_mk "${outputdir}" do_kconfig "${outputdir}" } @@ -51,7 +50,9 @@ main() { # snippet means that there were no error. # do_validate() { + local outputdir="${1}" local br2_ext + shift if [ ${#} -eq 0 ]; then # No br2-external tree is valid @@ -60,7 +61,7 @@ do_validate() { for br2_ext in "${@}"; do do_validate_one "${br2_ext}" - done + done >"${outputdir}/.br2-external.mk" } do_validate_one() { From patchwork Fri May 22 21:40:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1296475 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BERPtcCW; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49TKg12CsTz9sRK for ; Sat, 23 May 2020 07:41:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 845E588BCF; Fri, 22 May 2020 21:40:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8c+TBMzV-URh; Fri, 22 May 2020 21:40:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id EA41A88CB8; Fri, 22 May 2020 21:40:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5B9211BF34F for ; Fri, 22 May 2020 21:40:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 58A27872E8 for ; Fri, 22 May 2020 21:40:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8V1_C6HUcMEl for ; Fri, 22 May 2020 21:40:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BD29387093 for ; Fri, 22 May 2020 21:40:55 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id w64so11262501wmg.4 for ; Fri, 22 May 2020 14:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ek6QK0XgX9ZFMSFeRaeCBbYYfi2MD6moDKaCYk5CPFo=; b=BERPtcCW12ktPgF8dhivGPx+9v5HJNDPF+A6Di72Tmfppex2nT4OtVCXYa3oMHXWcX Sp5QClBlKDmmEa8gnE4zDA0gJn30lxBBzzJlWt4tzfBTCFRNaPgSto6eL84/wBx2+uOa XSNBH9ZGwgR9W0PAYgcpEqvuo0sECLH2gjW2AQCSqU9JkJxq9SHSZWgqIUgqNB9aATCa b1bkGkRGr7xg+rtRQsApvv0w4GEsKtUT9NvXfow1vyPEds0wfz8CHNx0Swz38y/wakqM 53kGgfgK26xgjMzIb1f9FnANNDsvcSbwBpQB2DPFMxbbhhgoq5F9Ub00rLCkTcKEFYqn lzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ek6QK0XgX9ZFMSFeRaeCBbYYfi2MD6moDKaCYk5CPFo=; b=Ui/O+jvUWygRxXZnjOtwogGS0B12nvcxU/0wTsTlgyzDW6/ndXY55MyDhhj2fjJQ3e rcK+1+spkq2Qw+bYYA5qXjXLAgF/iSgRImrQ/a2KtpGRzr13EhstYcuAUgvggkrOCnU1 m5yptQUde/Xnzjsr9FTOwDgaWI5FZ99SDQA7vV1Embfz4fbxPqj67YtPWxb6K/y8umhh HQv52/ufQpaT3MWCfa3cKDCuzBGNEuMOuJeb6DsvlylGWmxsL52HT159li1Qgvhx+R3K yfBlZg5Cn1JKCrrFc/JBXWXuHu0JzxGZVJslrmWyKxQvqkBpsb2ziSmhjkZvvT9do5mF VDug== X-Gm-Message-State: AOAM533IbXnS4RrUmGlsqM9Y/bjjuJzX/dvoQx+1sfHFcR6igTXZt+QF waeGy+MGmv1BF392WiJT12CGv6t9 X-Google-Smtp-Source: ABdhPJw5HOOpeVoBGkiR2zj/6kC6E0O+IY8KigMPYfX5h6Al1mdr5ArRwX8niLWYbLQ/jddzkq42+w== X-Received: by 2002:a05:600c:2109:: with SMTP id u9mr14339820wml.75.1590183654042; Fri, 22 May 2020 14:40:54 -0700 (PDT) Received: from scaer.home ([2a01:cb19:8b51:cb00:c0e2:996c:914c:92d3]) by smtp.gmail.com with ESMTPSA id p10sm10997776wra.78.2020.05.22.14.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 14:40:53 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 22 May 2020 23:40:51 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] core/br2-external: report better error messages X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E. MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The error is misleading: it reports that no name was provided, when in fact the external.desc file is missing. Signed-off-by: Yann E. MORIN p Reviewed-by: Romain Naour --- support/scripts/br2-external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index fdea5aa251..ededd2d900 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -75,7 +75,7 @@ do_validate_one() { error "'%s': permission denied\n" "${br2_ext}" fi if [ ! -f "${br2_ext}/external.desc" ]; then - error "'%s': does not have a name (in 'external.desc'). See %s\n" \ + error "'%s': does not have an 'external.desc'. See %s\n" \ "${br2_ext}" "${MANUAL_URL}" fi br2_name="$(sed -r -e '/^name: +(.*)$/!d; s//\1/' "${br2_ext}/external.desc")"