Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6818991rwl; Mon, 9 Jan 2023 13:32:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8UAnkkxJSZFCVPtr8kTS6JVcBm2F+EA+Qgs9MDhyVlP+bj3ASeW6C8T7QHwZgyTKqgBuw X-Received: by 2002:a17:907:3f9f:b0:840:4901:901f with SMTP id hr31-20020a1709073f9f00b008404901901fmr75229473ejc.3.1673299973257; Mon, 09 Jan 2023 13:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673299973; cv=none; d=google.com; s=arc-20160816; b=G2YhyZByM/YBdrENeNnfqaQNkwpRObA2j9IC5GZYYM5ieYlEJgP4bi9y0dBUURgACW q5uUtW29JxyQrKSBl9JWiL/f2ZC8rF0q8nCfzgTjhf03FRKhsvntoQbSEx20TeNyQcrg MKZ8KES4mb1ZCilYNGaQOuLbs5Hd/DJrUlBY/yqNRCxd7rXLxuA27+Q/V72EUuJTA5l3 04uE7o7ReeGQCR8PL/piQnHofvZgFFQwEchbbcPpY+famU3bPh9RpnqIf4mLptQPADMT /J/oBez3cyG0lnQ8IZm0g/hlT9gUCqMV80mNehemxy3Jyjb2Wj3FMOkNc+s1jfKgO59d qH6w== 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=bCpbMmW0eLev9FdtuyFUocFIcOdmXfyBWebTqFK5CIA=; b=SeMzJYCXPGOrDHQCYJvMJYTQ5o9BKxTJTADGinr4xPMNmtSA9ZOFKbubrOnA4/qc/Z 7UgV/HpaqL2crj5/S6uPfR0rTi6CC6/Vp2gIpkBMNA7YKxN4naawMgskF2JGrEXCRZJK VpMIfGQXUK1CEN007CKRlO0yc4qwUkSLJPV2jtPsctMY9bFdNsorXoeQne99WWDM2lmp pUl6lVRGuxnK6Uxto73fWtQyvfX+c82uBrf/I1r207F9hW99vdwuCPb3KK1pw2Mtx79D jd2BoFnwYLGjLacYivBm4WVYuSGEKjs0C5d379winpQz5PWWD6sNTq2TaOa/nNxSUnqy CEyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=h4agD+4j; 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=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb41-20020a170907962900b0084d44bd6939si4466237ejc.508.2023.01.09.13.32.40; Mon, 09 Jan 2023 13:32:53 -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=@google.com header.s=20210112 header.b=h4agD+4j; 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=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237541AbjAIU4y (ORCPT + 53 others); Mon, 9 Jan 2023 15:56:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237670AbjAIUz7 (ORCPT ); Mon, 9 Jan 2023 15:55:59 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0213887F32 for ; Mon, 9 Jan 2023 12:54:36 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id d10so6734959pgm.13 for ; Mon, 09 Jan 2023 12:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bCpbMmW0eLev9FdtuyFUocFIcOdmXfyBWebTqFK5CIA=; b=h4agD+4jNY3gjy2SULguao1y1SDRTBALR9O8Bjx0eLoYRsDA2ETD9q9AMY5zysnq+q 6GujFw61YQklfxifLoM25/Qx27WxO+muJS7gQ2/y584ocSmZlbkb+YerHNikmmopMt8Q 8rlV/PMlrHVvPBQwSUX45mQgkl/lnEsPItg7VmFwxpKVkQ0wxzMolPIiKpSrMm9vWf91 BdnidegVeoi+AAnpJEtgYYuR8Hj6cvvQ4gLOYJJiMwV7jAU647pgrMmjixSWC4tlr/XH 6G2iG/BNRvOLrlnG/a3jkymflXl2P3YV8Dio+cecoWhApoEiT0ZHCb/LmhkfF6l0Q1eF Zn0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bCpbMmW0eLev9FdtuyFUocFIcOdmXfyBWebTqFK5CIA=; b=XOmLmtr095cbP+RFBAIcGFfulcjSMrYgqXWfGZrGb0xTU0sSgzmBeDksPMxy2ZtAdI fMHbt/agj7Ph1QdbDQqRIjzW/+ebpaNfPPJWVwSVmxCf+6JX4RsmpQC5o05tVfJIU2yU dXN+wshtIqjCmPafOPyIBlEIt3WfZBMF6PEfKLiNSOZZ8TS6O/MklTbLKPiNyQZwP44G MR6XCiZ2IqI6rZin3mcQdWBuKGl8u5NG6J4MFhI93Ys9/+o8PXhlTXEvl15i2wn5aAM6 455g20t4r+4au0GT246JXdu7CeqSRcS1Qw/UizknQDrfjZ2rqxhX1lZPCisWk1ZS3t6J EVaw== X-Gm-Message-State: AFqh2kpyE/ICdUXkuTFt8EZf+edIMt/w1gsBzUs8Osd92w/nEDpgCEt3 tmwAVa1PP+sKgm3vt/m13ggvcFJcx0axUqWRxqX9Ig== X-Received: by 2002:aa7:914e:0:b0:578:202d:a33a with SMTP id 14-20020aa7914e000000b00578202da33amr3345635pfi.23.1673297676007; Mon, 09 Jan 2023 12:54:36 -0800 (PST) MIME-Version: 1.0 References: <20230109204520.539080-1-ojeda@kernel.org> In-Reply-To: <20230109204520.539080-1-ojeda@kernel.org> From: Nick Desaulniers Date: Mon, 9 Jan 2023 12:54:24 -0800 Message-ID: Subject: Re: [PATCH 1/6] docs: rust: add paragraph about finding a suitable `libclang` To: Miguel Ojeda Cc: Masahiro Yamada , linux-kbuild@vger.kernel.org, Nathan Chancellor , 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?= , Jonathan Corbet , linux-doc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Mon, Jan 9, 2023 at 12:45 PM Miguel Ojeda wrote: > > Sometimes users need to tweak the finding process of `libclang` > for `bindgen` via the `clang-sys`-provided environment variables. > > Thus add a paragraph to the setting up guide, including a reference > to `clang-sys`'s relevant documentation. > > Link: https://lore.kernel.org/rust-for-linux/CAKwvOdm5JT4wbdQQYuW+RT07rCi6whGBM2iUAyg8A1CmLXG6Nw@mail.gmail.com/ > Signed-off-by: Miguel Ojeda This is super helpful for me, since I build clang from source and would like to use my libclang.so! Thanks for this documentation Miguel! Reviewed-by: Nick Desaulniers > --- > Documentation/rust/quick-start.rst | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst > index 13b7744b1e27..cae21ea7de41 100644 > --- a/Documentation/rust/quick-start.rst > +++ b/Documentation/rust/quick-start.rst > @@ -100,6 +100,23 @@ Install it via (note that this will download and build the tool from source):: > > cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen > > +``bindgen`` needs to find a suitable ``libclang`` in order to work. If it is > +not found (or a different ``libclang`` than the one found should be used), > +the process can be tweaked using the environment variables understood by > +``clang-sys`` (the Rust bindings crate that ``bindgen`` uses to access > +``libclang``): > + > +* ``LLVM_CONFIG_PATH`` can be pointed to an ``llvm-config`` executable. > + > +* Or ``LIBCLANG_PATH`` can be pointed to a ``libclang`` shared library > + or to the directoy containing it. > + > +* Or ``CLANG_PATH`` can be pointed to a ``clang`` executable. > + > +For details, please see ``clang-sys``'s documentation at: > + > + https://github.com/KyleMayes/clang-sys#environment-variables > + > > Requirements: Developing > ------------------------ > -- > 2.39.0 > -- Thanks, ~Nick Desaulniers