Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp592920rwb; Sat, 14 Jan 2023 05:27:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXvon6FGNZpkvQtZiUOSYDwnK95gGn2KiG2PcO+sED9En8gWcNFATrmqaUi9yn+3cHzBIpDH X-Received: by 2002:a17:90a:64c9:b0:229:a2:a273 with SMTP id i9-20020a17090a64c900b0022900a2a273mr9740061pjm.2.1673702829471; Sat, 14 Jan 2023 05:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673702829; cv=none; d=google.com; s=arc-20160816; b=vB8L5AiUxjeVYcXHJ28mcpT9DThOHHn1QHY0ozNVA27XKEpH1ZZ+kuLF9NcMUSxy0J FXHG/RMKI/TVOKkKI8YSqFa27Rn4OvztuQ/m9qdCeuWMejJ2xdH4fIEefc4SchIMpKve Y46yepd2HcGvZtwFhTqvv5gFnJ6qq7qOkfm7uN0rvtqAEyfnwTjInzdp2v8hE0TRbNnM YAYTT+L1XM9iIghGbS9o5lwQWiBgrYgLfnOOu8W53VzHui6ks4MIQD33W9X6dY9Y7Ljl lHMf3YVhdz5+RsHzo0QlLlnH9F3lQrYWFypiEK9IANtduVZB15SyavGj8l+89CpAaih+ 4/mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=weRUeqAB6iocxXbPXfcbXsar+6Z86ZOrG+V2tDMHzmU=; b=d1vzl1Al4uCfXVYSZKxIoVtFLELIUfZswo86uQiIeW/TCDUeRJ85f0e16SD1gs10MV x4s9TErssL+Zc8lxwtjruCls85wY1fOlaYpmd+LE/BFra1uJWJjZ7sVvIv6J5QL8VoVM E0o1c5XuNed00HdliI1RHzAmv/Ojr4dFPbLfxy9SzuOENSZEpz+eua+wband7ZVPNQRo kx3vkfyiCo2KBYatpbepfHQ5DQpQv36XhsYTTrdD7wbmX6xFm8j2gWsnk5jp7fyQIPCZ z2mK6jCjKeN0o+S+E6NTwj/IdXQxwidjA7S5bxwiS0DLekK9/tJtUHEGgU1hl3dNPotP wrWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S23PGG2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc7-20020a17090b3b8700b002271ef403e6si17151142pjb.145.2023.01.14.05.26.53; Sat, 14 Jan 2023 05:27:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S23PGG2H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbjANMea (ORCPT + 51 others); Sat, 14 Jan 2023 07:34:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbjANMe1 (ORCPT ); Sat, 14 Jan 2023 07:34:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F6B869E; Sat, 14 Jan 2023 04:34:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5829CB807E8; Sat, 14 Jan 2023 12:34:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFEC1C43392; Sat, 14 Jan 2023 12:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673699663; bh=4hogCgx26O6O66FhdhmvB8UE2W3v4MDEQPIa4tPZ7wg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S23PGG2Hrb07B5ZjmoVblAHiG7+WSQvjOSRlZBPyRME5RxG8uB54fQbPX1Z4ObGfr xoyg4MZNsmIXIDr/Dcs1JxvOTPsG7msX2q9aLI55eyzW57U1EjZsBm+5OTpWcxNpLY NAoXxYcFdKrrybubfWk8SxmqugfIKih1D7+gNh5jwVjc72ZKoVi9oklyn4F0xzE26h gE0K8bLzrZub0mCYECqOz/PFkkhSlowDsB02qAtgiPMMciQrU5xu6CmR8FICzL14kH z1k8YdhnIZSCrN4+R8YhX1m/nso9qc2r2u3CH/tfqwjX75LGPPTkPzlGYFOLzOEjlT bc+6Diy1C83Tw== Received: by mail-oi1-f170.google.com with SMTP id s124so2872730oif.1; Sat, 14 Jan 2023 04:34:23 -0800 (PST) X-Gm-Message-State: AFqh2kqzzEjZjs77TiywL42K1WAhSEQWfvd/WoIyaHnQftUZsvTmHtes zZLfFrGUKv1yBmpBqay7j8uPOwFCrW5eiKiv6II= X-Received: by 2002:a05:6808:1510:b0:364:5d10:7202 with SMTP id u16-20020a056808151000b003645d107202mr799454oiw.194.1673699662783; Sat, 14 Jan 2023 04:34:22 -0800 (PST) MIME-Version: 1.0 References: <20230109204520.539080-1-ojeda@kernel.org> <20230109204520.539080-4-ojeda@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 14 Jan 2023 21:33:46 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/6] kbuild: rust_is_available: check if the script was invoked from Kbuild To: Miguel Ojeda Cc: Miguel Ojeda , linux-kbuild@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 14, 2023 at 8:12 AM Miguel Ojeda wrote: > > On Thu, Jan 12, 2023 at 6:29 AM Masahiro Yamada wrote: > > > > I do not like this. > > We do not need to cater to every oddity. > > > > Checking MAKEFLAGS is too much. > > I agree we should not attempt to catch every possible mistake in the > script, but there have been several people hitting precisely this case > (the latest is in the linked thread in the commit message), i.e. some > people read the `Makefile` and notice the script invocation, and go > execute it, but they are unlikely to be aware of the target in that > case. > > > You can check RUSTC/BINDGEN/CC if you persist in this. > > This is fine, and actually we should do it regardless of `MAKEFLAGS`. > I can add it to v2. > > However, that does not cover the same thing as `MAKEFLAGS` is trying > to here. The reason is that even if they see e.g. "RUSTC is not set", > they will not know about how to call the script properly, i.e. through > the `Makefile` target. > > For `RUSTC` and `BINDGEN`, it does not really matter (and we could > give a default to the variable, since the name rarely would be > different). However, for `CC`, the logic that Kbuild uses is more > complex, so it seems best to me to let Kbuild tell us what the actual > compiler is. > > Cheers, > Miguel OK, you maintain this script, so it is up to you. -- Best Regards Masahiro Yamada