Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7563820rwl; Tue, 10 Jan 2023 02:27:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXuYlXtJ8aatuazkts3EyxKHOiXlN93SwZoP9W3sqrhaqC0h9I/yBCLhuYSdV38SAOEEXCOa X-Received: by 2002:a05:6a20:3d16:b0:9d:efbf:48c7 with SMTP id y22-20020a056a203d1600b0009defbf48c7mr99864805pzi.11.1673346445078; Tue, 10 Jan 2023 02:27:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673346445; cv=none; d=google.com; s=arc-20160816; b=QsXruTHlPi66NZkxSIdLblEJM7JvKFQuwZDzfxDwONjZYunEu2SaPvEmIRwslWQA1W duq0FMpYNXRMeIIH37S5rmQO4B1tbt8v50c4cfMJvZbjbnEgkYKqbqKFOXDNIJFWngom 7NwPxlcK3d66nA5bmMw48j2Pztb1L19big8HDbc2z0ijWeiH55nw6UcCAAGOeLGjBWM2 qQSkbjl3ddkPOxfJrIGIxtbxpW34/ZQrB8cDgm1S5QsOnmoeLZ9uopii4vAHUKU9XczJ iN5Ufu34ckHWuMtpADsIRXryaWga8hG9jG57sfzSL2DBxI2R8OSwMWl/ZOLBqc0ntOfz Mqog== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6IUg8Et5IkHA9DdwmBM0zPxl4bj+zRYsG0exsYo0MV0=; b=p+MwWqUwHSymkkEk1BcJ7j2s5yenG8ojhnsu2aYmpsngScDq7F3yPtBf6ChTj7IlGN 44HRmSIew/S//nqPv9b3fSQ3tdjpqjqux+feuRAqzG2mEieb25XaeZ5TQFmpwekT+O/y VxcWUpkFPp0TkEwinjb7WV6nUtZZ32+NPiBmmsClBIONOgrfWkWi/gcSdCeZo+1Lh+hs aeHuMh07cN8Wod+xaUZ8VtOfKeYDsvZIZsQVDIffe7KZTQRkgnOU9Npd003Yckmio48g l9hVwE0kmXLc1jeg5NuWejeD+gmPCyuYyKQbKzqANB5j2c6tbB35+U9mO4somcTuPgjf 5I3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nyantec.com header.s=default header.b=poeGSm+l; 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=REJECT sp=REJECT dis=NONE) header.from=nyantec.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a636501000000b0046ece301e82si11470576pgb.756.2023.01.10.02.27.18; Tue, 10 Jan 2023 02:27:25 -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=@nyantec.com header.s=default header.b=poeGSm+l; 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=REJECT sp=REJECT dis=NONE) header.from=nyantec.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237727AbjAJKR1 (ORCPT + 53 others); Tue, 10 Jan 2023 05:17:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbjAJKQy (ORCPT ); Tue, 10 Jan 2023 05:16:54 -0500 X-Greylist: delayed 171 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 10 Jan 2023 02:16:39 PST Received: from mout-b-110.mailbox.org (mout-b-110.mailbox.org [195.10.208.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9E141D76; Tue, 10 Jan 2023 02:16:39 -0800 (PST) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-110.mailbox.org (Postfix) with ESMTPS id 4Nrmtq4LVhz9t7Z; Tue, 10 Jan 2023 11:16:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nyantec.com; s=default; t=1673345795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6IUg8Et5IkHA9DdwmBM0zPxl4bj+zRYsG0exsYo0MV0=; b=poeGSm+lgAhdQHYBpqCTYPAZ8w3Pb1lDmlitQO9C27MYchgg2SQJ3E9SDkQ40CbNWEs/X0 6W3/S+e0MyKAb90i1y9+sWmuQQ74/RjmHjFv41hneE7Zmg9GgQUznfyt9lopyESrZxJhxl 3R2RPETiIW87xD05Qn8+PWMvMT2CZ3kdP3f321XrHPEkD74PKH3t7v8zW7YUwuK9szOqtb VoBXflXAqp1h8eunk9/zUEYOnj3I3V3OuushZ4cI/d7HjUHeWPFaOtqZQ/2ol3P/kv5d5p 24CHzCuW4jBdcHnWpK1xo1cOHq9Khe8m49T+tAMijQnYAsqct393gaItk/jDVA== From: Finn Behrens To: Miguel Ojeda Cc: Masahiro Yamada , 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?= Subject: Re: [PATCH 2/6] kbuild: rust_is_available: print docs reference Date: Tue, 10 Jan 2023 11:16:33 +0100 Message-ID: <1E542F5E-220F-4061-BC71-F37C76616F34@nyantec.com> In-Reply-To: <20230109204520.539080-2-ojeda@kernel.org> References: <20230109204520.539080-1-ojeda@kernel.org> <20230109204520.539080-2-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Nrmtq4LVhz9t7Z X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 9 Jan 2023, at 21:45, Miguel Ojeda wrote: > People trying out the Rust support in the kernel may get > warnings and errors from `scripts/rust_is_available.sh` > from the `rustavailable` target or the build step. > > Some of those users may be following the Quick Start guide, > but others may not (likely those getting warnings from > the build step instead of the target). > > While the messages are fairly clear on what the problem is, > it may not be clear how to solve the particular issue, > especially for those not aware of the documentation. > > We could add all sorts of details on the script for each one, > but it is better to point users to the documentation instead, > where it is easily readable in different formats. It also > avoids duplication. > > Thus add a reference to the documentation whenever the script > fails or there is at least a warning. As I always use my systems rustc/bindgen, I always get the warning, which= already clutters the build output a bit. But I see why it is helpful, so= not a fan, but this patch is reasonable. > > Signed-off-by: Miguel Ojeda Reviewed-by: Finn Behrens Regards, Finn > --- > Note that is based on top of patch "kbuild: rust: remove -v > option of scripts/rust_is_available.sh" applied on v6.2-rc3: > https://lore.kernel.org/rust-for-linux/20230109061436.3146442-1-masahir= oy@kernel.org/ > > scripts/rust_is_available.sh | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.s= h > index eaeafebf8572..c907cf881c2c 100755 > --- a/scripts/rust_is_available.sh > +++ b/scripts/rust_is_available.sh > @@ -21,6 +21,20 @@ get_canonical_version() > echo $((100000 * $1 + 100 * $2 + $3)) > } > > +# Print a reference to the setup guide in the documentation. > +print_docs_reference() > +{ > + echo >&2 "***" > + echo >&2 "*** Please see Documentation/rust/quick-start.rst for detai= ls" > + echo >&2 "*** on how to setup Rust support." > + echo >&2 "***" > +} > + > +# If the script fails for any reason, or if there was any warning, the= n > +# print a reference to the documentation on exit. > +warning=3D0 > +trap 'if [ $? -ne 0 ] || [ $warning -ne 0 ]; then print_docs_reference= ; fi' EXIT > + > # Check that the Rust compiler exists. > if ! command -v "$RUSTC" >/dev/null; then > echo >&2 "***" > @@ -62,6 +76,7 @@ if [ "$rust_compiler_cversion" -gt "$rust_compiler_mi= n_cversion" ]; then > echo >&2 "*** Your version: $rust_compiler_version" > echo >&2 "*** Expected version: $rust_compiler_min_version" > echo >&2 "***" > + warning=3D1 > fi > > # Check that the Rust bindings generator is suitable. > @@ -89,6 +104,7 @@ if [ "$rust_bindings_generator_cversion" -gt "$rust_= bindings_generator_min_cvers > echo >&2 "*** Your version: $rust_bindings_generator_version" > echo >&2 "*** Expected version: $rust_bindings_generator_min_versio= n" > echo >&2 "***" > + warning=3D1 > fi > > # Check that the `libclang` used by the Rust bindings generator is sui= table. > @@ -128,6 +144,7 @@ if [ "$cc_name" =3D Clang ]; then > echo >&2 "*** libclang version: $bindgen_libclang_version" > echo >&2 "*** Clang version: $clang_version" > echo >&2 "***" > + warning=3D1 > fi > fi > > -- = > 2.39.0