Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2980110rwd; Fri, 16 Jun 2023 10:33:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62xc320WjOcCBft3AOKk9wtGLpW9qO2dcP2Bfma+Wf5IbcHmqskC8uEFGu7xj16/NqdDU+ X-Received: by 2002:a05:6a20:394a:b0:116:df6e:c857 with SMTP id r10-20020a056a20394a00b00116df6ec857mr3513120pzg.16.1686936814459; Fri, 16 Jun 2023 10:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686936814; cv=none; d=google.com; s=arc-20160816; b=EIjjSS4sr2/qNBhiyUHFXRSwi5d0qcoc+VSbHXeBdggdknRNvVJ3r1l1VTWBcXUo2n U9Dp4F2GSBziTv/B8nw+P9Twe7bZgz4ox6zHXdohz0hIYpkmescBuDli81Lz9TmwZ77i jhO5nEb8rRlYNx1ed3KC/zuyZycYT6lPh0xTNVJqTlW2IoBmhw2XkE2ey82zR4BsIWlx AW1XDCAO7Qeno9/G/TfcbBtHxNspQR9BpxbhBmj2Y0G9TWKAgKA9c2oe328f+Cf8sFDT i02STtlsakMHmD8q00QHyHCGnOSgVX7QlcdFfw96BV0FXkJqfFiXBJithzoaTuLM8UsV p9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZymQO75Q+5eEqvMIs/XbmbPBgtkUyPb1BPIBlwUsroo=; b=kSq2yKw1P0+VIC0CRdy8dIf/PRoBqiYsNlVOyBS+6+JzUPxk+JTINce4m9e6vQZabh qT2sqw4PMqMRYPujAvYz6VxGMiNTRrQf88Cn1fzs+xhfQyWJFWVivFKcP8btcW905PPr 0YQDs2y8zNqx6bwU/iDOm1H0bjPxMhD737sF+XSUqCHe5EqRFPba52njqV8rwSvXoZQd FmnndePR8SrU4T5JyjZNmPQgaH0McU1j4M+iWt3N19SMuu9mySstIkIi0lzV4OUguVaq nOeHP5S/66gluJMzdkZx0lxM9abn1Hn6H8nNo6Oj+YhWWPyP6pOaF7BqUqh4QWtcyNDa a1Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nx/Yo4ox"; 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 h62-20020a638341000000b005098590f1edsi3702801pge.757.2023.06.16.10.33.21; Fri, 16 Jun 2023 10:33:34 -0700 (PDT) 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="nx/Yo4ox"; 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 S1345964AbjFPRHn (ORCPT + 99 others); Fri, 16 Jun 2023 13:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbjFPRHk (ORCPT ); Fri, 16 Jun 2023 13:07:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13E571BE3; Fri, 16 Jun 2023 10:07:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 98E0263F10; Fri, 16 Jun 2023 17:07:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16526C433C0; Fri, 16 Jun 2023 17:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686935259; bh=gmKQ0AURAJf8qyf6k8o+TXk5I0Kft2zeZCsgp/H5lno=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nx/Yo4ox0Jdf1B1O9v1eEYjSe1cMbRXurqE8t2Ulm+hIGL3/hJDTZ0E7JcrA0LmEG UI5YLgBWIcxCbtgVQzXyGIWUgXF7BiuQuTQTdGiyXQccDnSf6mzGfKItLmm/LreT2h 6Qc/DhWSksf3S6U6xP2sJZV1Gkw1y+qFuEeZVVt/8VfqKGSqHo+uhXfv6UQb4vIoEZ SoZPWMhVl60br4GrYepYeALYVq0xQPbXP4uWyvqI1hei1IMYJh8SxWnixTYuucCdOU y31whtpfWAgv4kaEGTUTCv4jWuUvj1cSoK6u8ym4F9u8EbM+ElY25rYufICs09ph1a Mc5aWZYnqdjtQ== Date: Fri, 16 Jun 2023 10:07:36 -0700 From: Nathan Chancellor To: Miguel Ojeda Cc: Masahiro Yamada , Wedson Almeida Filho , Alex Gaynor , Nick Desaulniers , Nicolas Schier , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Alice Ryhl , Andreas Hindborg , linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Finn Behrens Subject: Re: [PATCH v2 04/11] kbuild: rust_is_available: print docs reference Message-ID: <20230616170736.GC3474164@dev-arch.thelio-3990X> References: <20230616001631.463536-1-ojeda@kernel.org> <20230616001631.463536-5-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230616001631.463536-5-ojeda@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 16, 2023 at 02:16:24AM +0200, 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. > > Reviewed-by: Finn Behrens > Signed-off-by: Miguel Ojeda Reviewed-by: Nathan Chancellor > --- > scripts/rust_is_available.sh | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh > index 0c9be438e4cd..6b8131d5b547 100755 > --- a/scripts/rust_is_available.sh > +++ b/scripts/rust_is_available.sh > @@ -19,6 +19,20 @@ get_canonical_version() > echo $((100000 * $1 + 100 * $2 + $3)) > } > > +# Print a reference to the Quick Start guide in the documentation. > +print_docs_reference() > +{ > + echo >&2 "***" > + echo >&2 "*** Please see Documentation/rust/quick-start.rst for details" > + echo >&2 "*** on how to set up the Rust support." > + echo >&2 "***" > +} > + > +# If the script fails for any reason, or if there was any warning, then > +# print a reference to the documentation on exit. > +warning=0 > +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 "***" > @@ -60,6 +74,7 @@ if [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion" ]; then > echo >&2 "*** Your version: $rust_compiler_version" > echo >&2 "*** Expected version: $rust_compiler_min_version" > echo >&2 "***" > + warning=1 > fi > > # Check that the Rust bindings generator is suitable. > @@ -87,6 +102,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_version" > echo >&2 "***" > + warning=1 > fi > > # Check that the `libclang` used by the Rust bindings generator is suitable. > @@ -126,6 +142,7 @@ if [ "$cc_name" = Clang ]; then > echo >&2 "*** libclang version: $bindgen_libclang_version" > echo >&2 "*** Clang version: $clang_version" > echo >&2 "***" > + warning=1 > fi > fi > > -- > 2.41.0 >