Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp839229rdf; Tue, 21 Nov 2023 19:49:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGot2nYUuCE/tv64lFnCs0UoYc92ZSm58lzgv9ebpbc5LOJIOAjg6f6V1+W0nHxdiaJXyei X-Received: by 2002:a9d:7f8c:0:b0:6d6:4557:bb2 with SMTP id t12-20020a9d7f8c000000b006d645570bb2mr1545990otp.30.1700624941592; Tue, 21 Nov 2023 19:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700624941; cv=none; d=google.com; s=arc-20160816; b=WGyTWJrv7S1tJ+raEOQ4hbokKvjP1OnegupPHyilnKlBL2XenrXamSopigiP8szGwj Fqv0GesWQIvwuNyHAmOrG5e7SpO5fXNE531USmNUAJSg5W/6qfqCzp/ZA4QG9P/NkmV4 JcXrGsZhg7UPpZOAhcswq3/E9mt5nG2MyzagHmGh+i7IHlRJ7qe4ekOlann3Bo5TaWJW EcD0+P+nEGEeObVlQ4q+JSkncsT8cw7gjV2r2120KucqJncKnGZsDLj7p98BLFlHht8z EaG4KmdkPKaccUSmwoPW8s45GQ5s7LRnWmiO9WMy6vsjstskH4A4cTGfcvttoekjQ4Y4 Vw+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7dli5291sgoxdBf0M7ZcZCemBOpnn4oJYx/LL1st4SQ=; fh=xiPTbIp9d1SCJLg1NxfUX+CQALaV4RlSRmoaaKsXbVU=; b=G5h7pH6XAMztz+DIZ8RGq0Tw7Ba8qxL5aePbtC3+IOyJq6rJGRc9zHknCLmUMEhK8+ 1ozZCJP5UyGWOLWtckMcikVYV8kwJIhwYpkmZGn5S1XG3cG+HLlg3GfIAUtdHqVSny5R PjidpAOe5zkE5k4F1HCnhiescaksLut0vsYh4B+y6F6N8uMagsStK7o1ZkZysy/6DGnF 6OtMH5nXcXHDYaZCh6Kz5dEGJJAl94IHkRbiUIq8EcHElAXa8fRDrLKp6q1+Z+a9n/nf RbQ1aUHAB9J3MSgg55cbIZfu+lanW0pnyNstmg5T1B5NNE3T800TyK3YolZ+J9IFV9yB EbYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E1yqsT3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id cl20-20020a056a02099400b005c1b313a127si12380005pgb.660.2023.11.21.19.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 19:49:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E1yqsT3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 54DA280947C6; Tue, 21 Nov 2023 19:48:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343543AbjKVDsw (ORCPT + 99 others); Tue, 21 Nov 2023 22:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjKVDsv (ORCPT ); Tue, 21 Nov 2023 22:48:51 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C457181 for ; Tue, 21 Nov 2023 19:48:47 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-28120aa1c24so4403361a91.0 for ; Tue, 21 Nov 2023 19:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700624926; x=1701229726; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7dli5291sgoxdBf0M7ZcZCemBOpnn4oJYx/LL1st4SQ=; b=E1yqsT3YLm8x6TGPOSPxSmSnLdYJ0cXCSHSJ1SFo7IGo56sXCEFJe5xLQeRW7PmyEF kjHLfTOfPXLNitFeyxZlTgHJG2p75BbV5fs96A1K+0b38p46ddPJ/NXy9winayYilZjd vr52kJGLIK2MCb9Dgz2xnI+brWfx8MboR80Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700624926; x=1701229726; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7dli5291sgoxdBf0M7ZcZCemBOpnn4oJYx/LL1st4SQ=; b=mGYKIhRt8Hm9B+m131zQdhPtibItueLoeJFh+rq0enNPWJlE9zKp9UND1hmkZ7JFpp ya/bhR1xxbPxzP5XH5z1JDMImRMjHvHuXxEUS9TaDe70pKJxEGVUMo/Rf83tjgqD4Khn vnETQaKpFRMX9ep4RvUEZZyI0VUe79VK+2JvI/5q46z2hGPJRNsS7J7+PNL4NyYi0V14 +aUdmQde0TjIYImTa8buiP64DiLeX++h5mDNU8ae0hheagx0yJldOitFQPQGbBqdge1e yp1973uOAfD4vUCEsnOuWYrJcjmIO3X1/jq1qktsxCEoERpA+6K26vGK1Rll2RvAiChc 6mdA== X-Gm-Message-State: AOJu0Yx64pwiGnUTg1ZuHfSb1b6M0CikBcIk1XQJcl4exrN6JMD0Lw2H EAA3mtRgta781aJOgajM1ZPOew== X-Received: by 2002:a17:90b:1d8f:b0:27d:2109:6279 with SMTP id pf15-20020a17090b1d8f00b0027d21096279mr1340292pjb.12.1700624926197; Tue, 21 Nov 2023 19:48:46 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:1aba:fb75:807e:7620]) by smtp.gmail.com with ESMTPSA id i16-20020a17090adc1000b00280215e7aebsm300191pjv.15.2023.11.21.19.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 19:48:45 -0800 (PST) From: Sergey Senozhatsky To: Masahiro Yamada Cc: Patrick Georgi , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Stefan Reinauer Subject: [PATCH] kconfig: WERROR unmet symbol dependency Date: Wed, 22 Nov 2023 12:47:45 +0900 Message-ID: <20231122034753.1446513-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 19:48:59 -0800 (PST) When KCONFIG_WERROR env variable is set treat unmet direct symbol dependency as a terminal condition (error). Suggested-by: Stefan Reinauer Signed-off-by: Sergey Senozhatsky --- scripts/kconfig/symbol.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index a76925b46ce6..34fc66e075b7 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -37,6 +37,7 @@ static struct symbol symbol_empty = { struct symbol *modules_sym; static tristate modules_val; +static int sym_warnings; enum symbol_type sym_get_type(struct symbol *sym) { @@ -317,12 +318,14 @@ static void sym_warn_unmet_dep(struct symbol *sym) " Selected by [m]:\n"); fputs(str_get(&gs), stderr); + sym_warnings++; } void sym_calc_value(struct symbol *sym) { struct symbol_value newval, oldval; struct property *prop; + const char *werror; struct expr *e; if (!sym) @@ -338,8 +341,9 @@ void sym_calc_value(struct symbol *sym) sym_calc_value(prop_get_symbol(prop)); } + werror = getenv("KCONFIG_WERROR"); + sym_warnings = 0; sym->flags |= SYMBOL_VALID; - oldval = sym->curr; switch (sym->type) { @@ -430,6 +434,9 @@ void sym_calc_value(struct symbol *sym) ; } + if (sym_warnings && werror) + exit(1); + sym->curr = newval; if (sym_is_choice(sym) && newval.tri == yes) sym->curr.val = sym_calc_choice(sym); -- 2.43.0.rc1.413.gea7ed67945-goog