Received: by 2002:ac8:3b51:0:b0:3f3:9eb6:4eb6 with SMTP id r17csp1416783qtf; Fri, 16 Jun 2023 08:06:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+KzZFPMvMKy1YkHKWKx9Ldu7i/CODcGxFBKbkyKAoAki2puoEA3gy2QriX6ty+yFBavh8 X-Received: by 2002:a17:903:41ce:b0:1b5:3da1:3761 with SMTP id u14-20020a17090341ce00b001b53da13761mr76882ple.30.1686927993631; Fri, 16 Jun 2023 08:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686927993; cv=none; d=google.com; s=arc-20160816; b=ERu7M5zp4ILJggBLb13HN5R9DYaBT5HV28YvEklZuxXqvh7gDQ5z6ndEmBUmlCtxp4 bgfdKmPFz8PKacYn9QPIX+UG69GbjtPlxIy7LDU88SdFaNV/Y7nqsd1aYB6CGZYa6MqR fPLcg6DX+KJBr2KgI7zIdeL23CXosGaaGGrMN8zuq1o0lygbpEyoB74YaNRZHCLmirZV A/prOTC3bDLqKIJdO7iKj+YorZEovcPrVht3sGi67B7i1+rPlLcqEl+Gb4ngirH2XQKz v2AC3i4CMIhhpB3J6HeRLzaeAcHDppNghJpF4/PD6pk/KI2VgK35tQZP3bwIuaduHmf/ feAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7YzLkZ7R/8qUwBNf++ojl6KCaGOyRjez93untqJDgCQ=; b=Ra8iu9xbP5yjicORp2dk6ynCC9T4gZeZQCKAb7a9Sv8Bhd/+l6roiNCwWI2STg4/RA Z7g51HUVGn8M4fxYDZWlVnRXCIg7ZcmqSyifzWASxhY7StvW+U5uwKS/26I7p6kDZ1m5 eWHwhakOIYTZOBhvPvFVu1HElJmhAXHbmve5HTM7z2zB5e7pwoAXVJtVMzeddngTiR/f H++RSLEZ3uX2uUozhXl+KasBFtOyP35Y9IWwgLOKOB8FG/YTybioELjpM6fJ9nPSNXrz 35wW1zJdNAC96PclWEMHVBFXjGYHwGMGNRgUCh1Orm79I8FSHRbUI56nX8zVXtjZI3yY 6CGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="IVQVw15/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a170903018a00b001a637615a89si15910088plg.561.2023.06.16.08.05.59; Fri, 16 Jun 2023 08:06:33 -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=@gmail.com header.s=20221208 header.b="IVQVw15/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbjFPPBk (ORCPT + 99 others); Fri, 16 Jun 2023 11:01:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345797AbjFPPB2 (ORCPT ); Fri, 16 Jun 2023 11:01:28 -0400 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 534B330EB; Fri, 16 Jun 2023 08:01:22 -0700 (PDT) Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-55b171c1e16so565899eaf.1; Fri, 16 Jun 2023 08:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686927682; x=1689519682; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7YzLkZ7R/8qUwBNf++ojl6KCaGOyRjez93untqJDgCQ=; b=IVQVw15/AYeIaQrf6ByOLNtHAKZaTuY9e752LuCYmu4j99mC13t/vQksIuc9WeqJza sKda+8z3cBRqhGT4Kr4Li6SGtIa8+P895ZA0VRm16wj11EUNqvL5f9B2BPZWhE/THY3L qrXK4RLUcgsglARS6war7oox9qTc0LK2+Hb4fAWoJHTEcJ7FEIJ1ap7IBaeuTVS713yG bXI/bcEiFuf0O2Q/AtOl6yFdkjBAoi9HI5K6cHdDF293iFw37VRuCIXTC79vs9H3t/Zy pr1QyXN0wGyaIz3V9n7RKVBmSE6idL3AYX7HsThS3oyXEIhbX4yi8h5gLnfdx1sK7pGQ xmtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686927682; x=1689519682; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7YzLkZ7R/8qUwBNf++ojl6KCaGOyRjez93untqJDgCQ=; b=CtaTLpyVxWv7MVBv9ZtbJFqb148hCJ8VW2BMjuSfu33+FDUjDzv29HZhRgtEpBDRdF koy18qbQXiabXFwvX/jwqg7B8ATqVHLNOYR/zr/2EJfd5CoVHkNNqSrwGwdOjpvqG8K2 5o0Raz2AXCGpb58LcIp1LqYRuDa0TIko2gynacurKUzYhKjV2AWgJdpKAyYm4K4jDR4+ 1eWctwkUFXHqQ61+Yhc3n6mUJMjAHyn/kRTOCrIt4tm8Xck3+l1cAp1J5fI1IIoR9Jf4 516LtqIXx8w5JmyhqbtHkdpsSTys3biB2STdna/vbr9soUzFWfPH4AOICRJEbPFXDDAM sI2A== X-Gm-Message-State: AC+VfDy28DxnA3jlZdJwdQwxJUT5m67WTU+tX0wxjR1HAuIzwAMqnyCB x9WpgOvJeXyVIn+tJ96FcL0= X-Received: by 2002:a4a:e78f:0:b0:55c:6812:27c5 with SMTP id x15-20020a4ae78f000000b0055c681227c5mr1787573oov.9.1686927681955; Fri, 16 Jun 2023 08:01:21 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id n1-20020a9d4d01000000b006af99ac5832sm7928823otf.47.2023.06.16.08.01.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Jun 2023 08:01:21 -0700 (PDT) Message-ID: <51e0fd1d-4d8f-8ef6-f910-6fb1a92755d0@gmail.com> Date: Fri, 16 Jun 2023 11:06:46 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 05/11] kbuild: rust_is_available: add check for `bindgen` invocation Content-Language: en-US To: Miguel Ojeda , Masahiro Yamada , Wedson Almeida Filho , Alex Gaynor Cc: Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=c3=b6rn_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, =?UTF-8?Q?Fran=c3=a7ois_Valenduc?= , Alexandru Radovici , Matthew Leach References: <20230616001631.463536-1-ojeda@kernel.org> <20230616001631.463536-6-ojeda@kernel.org> From: Martin Rodriguez Reboredo In-Reply-To: <20230616001631.463536-6-ojeda@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 6/15/23 21:16, Miguel Ojeda wrote: > `scripts/rust_is_available.sh` calls `bindgen` with a special > header in order to check whether the `libclang` version in use > is suitable. > > However, the invocation itself may fail if, for instance, `bindgen` > cannot locate `libclang`. This is fine for Kconfig (since the > script will still fail and therefore disable Rust as it should), > but it is pretty confusing for users of the `rustavailable` target > given the error will be unrelated: > > ./scripts/rust_is_available.sh: 21: arithmetic expression: expecting primary: "100000 * + 100 * + " > make: *** [Makefile:1816: rustavailable] Error 2 > > Instead, run the `bindgen` invocation independently in a previous > step, saving its output and return code. If it fails, then show > the user a proper error message. Otherwise, continue as usual > with the saved output. > > Since the previous patch we show a reference to the docs, and > the docs now explain how `bindgen` looks for `libclang`, > thus the error message can leverage the documentation, avoiding > duplication here (and making users aware of the setup guide in > the documentation). > > Reported-by: Nick Desaulniers > Link: https://lore.kernel.org/rust-for-linux/CAKwvOdm5JT4wbdQQYuW+RT07rCi6whGBM2iUAyg8A1CmLXG6Nw@mail.gmail.com/ > Reported-by: François Valenduc > Closes: https://github.com/Rust-for-Linux/linux/issues/934 > Reported-by: Alexandru Radovici > Closes: https://github.com/Rust-for-Linux/linux/pull/921 > Reported-by: Matthew Leach > Closes: https://lore.kernel.org/rust-for-linux/20230507084116.1099067-1-dev@mattleach.net/ > Fixes: 78521f3399ab ("scripts: add `rust_is_available.sh`") > Signed-off-by: Miguel Ojeda > --- > [...] Reviewed-by: Martin Rodriguez Reboredo