From patchwork Tue Jul 18 05:44:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gross X-Patchwork-Id: 121783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1537097vqt; Mon, 17 Jul 2023 23:17:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFT8hmbDlKdALB1CVBWy0UtuTMjOsmRQa2K21a5mZlTjFg6n/xbeAyKQsCA8ZBUqTcc44VA X-Received: by 2002:a05:6a20:9482:b0:131:5b6f:ccb6 with SMTP id hs2-20020a056a20948200b001315b6fccb6mr13153379pzb.19.1689661041439; Mon, 17 Jul 2023 23:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689661041; cv=none; d=google.com; s=arc-20160816; b=PlWXD4TJNkd5DmnOsfQJsvDV6I+CATNscz/NLP6nmOaA4fkwaPYXI47BsIsyQCcwUv s8xPpfLx4u4mSQ+boRJSEv8tg68e4QZMdVI02Vv1QuQvoyxbER3X62m83YFGqsuGtVYX MHdOg8rS/0KOVyLlKojvct/E5UoU4QJOCiFly21nEBycIjHIAYPQPnPbJyq6+WOISSh8 GN65k9YK+d+8xGLcR7XkBBcaD2p/MstCJWRxXvhMRzuuKL3auAtyhlziHM1Zju5f7BwL D7f8BAa/J9LtqYJiNzo3Kkc2ms4f6M6N5jZT0CvaQHWoAfC3M8hfFjO1SOiFyuzLuoE/ MvZQ== 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=WWZmjNjUdtOVY6mFV4Fs1VBGqTdLbx+K3/EPKF1ZPXI=; fh=t4M4ZC0mNvfUyxmrvVgwN74hGybUenkJSb1js9kpyV8=; b=Ua7NDX867L/JICcjcayb323GkFVyeNhvRBLaDxEfbFJgRLjnRL/Wuif0r+SGq9zuei KJYbH3kW7fnaUhJfWRP/qaDZQrnlU+yiFBq+ygRQGDdMQw858wbtb3gJULHH1EFGG4CI y5fWAYsq8DXlnxEOekPo+mRe3k54jMwD7EXTpiUpu9JRr6qE/PfzRgGA3wgmYSSHqLkr DSL6jWuKdSpyv+ya18Ep3xSCnJlmoMyac4vONynfDWqLojwEfd0tFQEBPPp29pAtNO4z hz9wqJh1OPCt5LwQdJqkS3vZcw4ZVssiOG9iwHr421Vee4a1lBmnrUyW7vs3U16Fh7a4 pLNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=relay-2018-08-29 header.b=l8An3RRY; 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=umich.edu Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z130-20020a633388000000b0055bbc6e2c6csi1102452pgz.491.2023.07.17.23.17.08; Mon, 17 Jul 2023 23:17:21 -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=@umich.edu header.s=relay-2018-08-29 header.b=l8An3RRY; 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=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjGRGBn (ORCPT + 99 others); Tue, 18 Jul 2023 02:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjGRGBk (ORCPT ); Tue, 18 Jul 2023 02:01:40 -0400 Received: from germane-culhwch.relay-egress.a.mail.umich.edu (relay-egress-host.us-east-2.a.mail.umich.edu [18.217.159.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED1B810C2; Mon, 17 Jul 2023 23:01:38 -0700 (PDT) Received: from jacinth-ogre.authn-relay.a.mail.umich.edu (ip-10-0-74-216.us-east-2.compute.internal [10.0.74.216]) by germane-culhwch.relay-egress.a.mail.umich.edu with ESMTPS id 64B62716.39D52385.317E5C5C.1115286; Tue, 18 Jul 2023 01:45:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1689659155; bh=WWZmjNjUdtOVY6mFV4Fs1VBGqTdLbx+K3/EPKF1ZPXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l8An3RRY+vM7LBin6JUJOpFfyyUZq2wzeCxFsxZt01beyoTemTgWzfAeQoT2FyIHD 8TxpLo1D3k8NddnESMD9ZosMtr3MVUFhmbDzAjEvo+iOUB8KcrgNJJwhhcKTgU2yKb Be1M8HkTYSDFpEWTCgHwIOs7r3Xs0SDYsISxc11xbJ/o3X7HC0Uwk67QaKl1JzR9uI hERsz3tuNTBgJbpvy2zkJlN5XoWnB8GZDaTeGw55mnc8pLrLk7T/TL+TOPYntmZW7T JS4LqjNh0HGmoz3ouipZTqkH1BYO1PhBnn5MntA9dA6dn8mRXxsozAAZNau4sCYBtd hIiy6cvSYX/VQ== Authentication-Results: jacinth-ogre.authn-relay.a.mail.umich.edu; iprev=permerror policy.iprev=68.32.216.219 (unknown); auth=pass smtp.auth=tmgross Received: from localhost.localdomain (unknown [68.32.216.219]) by jacinth-ogre.authn-relay.a.mail.umich.edu with ESMTPSA id 64B62713.1A83BD55.686D6C9.46279; Tue, 18 Jul 2023 01:45:55 -0400 From: Trevor Gross To: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, corbet@lwn.net Cc: linux-doc@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Trevor Gross Subject: [PATCH 1/2] docs: rust: update instructions for obtaining 'core' source Date: Tue, 18 Jul 2023 01:44:15 -0400 Message-Id: <20230718054416.861412-2-tmgross@umich.edu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230718054416.861412-1-tmgross@umich.edu> References: <20230718054416.861412-1-tmgross@umich.edu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771738016113920003 X-GMAIL-MSGID: 1771738016113920003 The source for Rust's 'core' library is needed to build the kernel with Rust support. This must be obtained manually when using a non-rustup install, such as when using 'rustc' from a package manager or from a standalone installer. Currently, the documentation suggests cloning the 'rust' repository to obtain these sources, but this is quite slow (on the order of a few minutes). This patch changes this documentation to suggest using the source tarball instead, which includes only needed information (<5M) and is significantly faster to download. This is more in line with what 'rustup' does. Signed-off-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- Documentation/rust/quick-start.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst index a8931512ed98..bb67deb19100 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -56,16 +56,17 @@ If ``rustup`` is being used, run:: The components are installed per toolchain, thus upgrading the Rust compiler version later on requires re-adding the component. -Otherwise, if a standalone installer is used, the Rust repository may be cloned -into the installation folder of the toolchain:: +Otherwise, if a standalone installer is used, the Rust source tree may be +downloaded into the toolchain's installation folder:: - git clone --recurse-submodules \ - --branch $(scripts/min-tool-version.sh rustc) \ - https://github.com/rust-lang/rust \ - $(rustc --print sysroot)/lib/rustlib/src/rust + curl -L https://static.rust-lang.org/dist/rust-src-$(scripts/min-tool-version.sh rustc).tar.gz | + tar -xzf - -C $(rustc --print sysroot)/lib \ + rust-src-$(scripts/min-tool-version.sh rustc)/rust-src/lib/ \ + --strip-components=3 In this case, upgrading the Rust compiler version later on requires manually -updating this clone. +updating the source tree (this can be done by removing ``$(rustc --print +sysroot)/lib/rustlib/src/rust`` then rerunning the above command). libclang From patchwork Tue Jul 18 05:44:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gross X-Patchwork-Id: 121787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1539211vqt; Mon, 17 Jul 2023 23:23:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3gZ8mkyezGA+P+1i4ZQwgVon6mOTpsrIJF5vwjDEisDMDwh7/VNeReNNGodR0uNFG+w93 X-Received: by 2002:a05:6a00:1f19:b0:67b:77e7:f467 with SMTP id be25-20020a056a001f1900b0067b77e7f467mr13370374pfb.16.1689661399351; Mon, 17 Jul 2023 23:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689661399; cv=none; d=google.com; s=arc-20160816; b=GOm8afSIo7e2A8r/d9Pk1X5+ioT1COxiTucRhyoApKlsNOiVNfuEE6GHV+hRiwQlCg DQX8USdVDRj7IuqQnTyb2GeXDva+eVzqjV9wegABi8G5ugvzSZ4sjmNUDEPyUZjzbky7 TCQEbDDXzowoP4mgZ8SlyA+oj/cwTAMAbJJ3z2l0scIPiq0dTAg+aiLa0QMLUQW1yrCT Iw14mSe9i+6Eu4yskYaXMtQziwurpPgH3moM4MjkXohhMVkzZ6nK5crfF5gi9ba9yMCZ Ln/rvuhJLQ28/bqanWxzx/z2zTQNykfv89Cd+VMdMMRm+Ioq17KaWphItGlDZi9GexXp KEnA== 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=32KuaL9XprTSau8shHufKOsqD5/ATF/mtI1/00+YRqo=; fh=t4M4ZC0mNvfUyxmrvVgwN74hGybUenkJSb1js9kpyV8=; b=XIwuHdUMBusfQJtwx0Q604q1Zxcb8pPM2fVjI8YfV9Jim37axh/xOmpnSzQqZKJ3W9 2sMz3jOJdor9mY7KwaSsZroMq+05Y8jcZsbvDBA6lWS/XpNeZ3VtCBpiVvtZnbqNer5X qx1SsijUAhHubGWOsW7DNDR7obNEtqdmlNHKrN8erhiPwLPe6KffFM7fX76sagDl5BgZ JXXi2cF+qSbhm3cW4sywOfeo2mk64PHBdChwP+pBbhBDsRKRB+1Z+OBDk8j3ezVW+ZYu nWnbBWu3BaDbPHFdL9iK5N3m7upjNxWAF+NwECgJSl+CaIpYBPgUZ4Vb4p0gFqZQmZOA iN6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=relay-2018-08-29 header.b=s9+fYcCr; 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=umich.edu Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e126-20020a636984000000b0055c4c9cbfedsi1060618pgc.862.2023.07.17.23.23.04; Mon, 17 Jul 2023 23:23:19 -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=@umich.edu header.s=relay-2018-08-29 header.b=s9+fYcCr; 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=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230527AbjGRGBr (ORCPT + 99 others); Tue, 18 Jul 2023 02:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjGRGBl (ORCPT ); Tue, 18 Jul 2023 02:01:41 -0400 Received: from germane-culhwch.relay-egress.a.mail.umich.edu (relay-egress-host.us-east-2.a.mail.umich.edu [18.217.159.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D776D1; Mon, 17 Jul 2023 23:01:40 -0700 (PDT) Received: from jacinth-ogre.authn-relay.a.mail.umich.edu (ip-10-0-74-216.us-east-2.compute.internal [10.0.74.216]) by germane-culhwch.relay-egress.a.mail.umich.edu with ESMTPS id 64B62717.11552E7.18B8CF7B.1115286; Tue, 18 Jul 2023 01:45:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1689659157; bh=32KuaL9XprTSau8shHufKOsqD5/ATF/mtI1/00+YRqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=s9+fYcCr1NEJtujl318yCSU4k+WYadNcttOxXc/ppCJNAJYF0SlVX/nydtAY5/Brm soSuIGVL8UhFAQj8feVZSllfbzlf1dojWKZYoPDDIrtqLUE8RdTlp467T9Fjzb2mby 1bYRI24vge4lU14/E+UHmgN+T+w7PkMo56Dem+DwngdyGcEh1bU0D5IAeUPqGi22y4 pAwikZ3aqFOmMG88a/jeDHDwudAOjIQExvGjs61AqDOX6DFOcDlovZh2fkg1Ku3j36 ET1Z43nmt1Aos5/mdVC7eBejKFpzHxssAjLbaoqaD2ifXdMtc0dS7oPJ5aQCvbgvow amaotLeZB2B2Q== Authentication-Results: jacinth-ogre.authn-relay.a.mail.umich.edu; iprev=permerror policy.iprev=68.32.216.219 (unknown); auth=pass smtp.auth=tmgross Received: from localhost.localdomain (unknown [68.32.216.219]) by jacinth-ogre.authn-relay.a.mail.umich.edu with ESMTPSA id 64B62715.21F24970.53FCB6DA.46279; Tue, 18 Jul 2023 01:45:57 -0400 From: Trevor Gross To: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, corbet@lwn.net Cc: linux-doc@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Trevor Gross Subject: [PATCH 2/2] docs: rust: clarify what 'rustup override' does Date: Tue, 18 Jul 2023 01:44:16 -0400 Message-Id: <20230718054416.861412-3-tmgross@umich.edu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230718054416.861412-1-tmgross@umich.edu> References: <20230718054416.861412-1-tmgross@umich.edu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771738391423814503 X-GMAIL-MSGID: 1771738391423814503 The behavior of 'rustup override' is not very well known. This patch is a small edit that adds details about what it does, so users have a better understanding of how it affects their system toolchain (i.e., it does not affect system toolchain and only sets a directory-specific override). Signed-off-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl --- Documentation/rust/quick-start.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst index bb67deb19100..700d37dcff5c 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -38,7 +38,9 @@ and run:: rustup override set $(scripts/min-tool-version.sh rustc) -Otherwise, fetch a standalone installer from: +This will configure your working directory to use the correct version of +``rustc`` without affecting your default toolchain. If you are not using +``rustup``, fetch a standalone installer from:: https://forge.rust-lang.org/infra/other-installation-methods.html#standalone