From: Trevor Gross <tmgross@umich.edu>
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 <tmgross@umich.edu>
Subject: [PATCH 1/2] docs: rust: update instructions for obtaining 'core' source
Date: Tue, 18 Jul 2023 01:44:15 -0400 [thread overview]
Message-ID: <20230718054416.861412-2-tmgross@umich.edu> (raw)
In-Reply-To: <20230718054416.861412-1-tmgross@umich.edu>
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 <tmgross@umich.edu>
---
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
--
2.34.1
next prev parent reply other threads:[~2023-07-18 6:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 5:44 [PATCH 0/2] docs: rust: update instructions on obtaining 'core' source Trevor Gross
2023-07-18 5:44 ` Trevor Gross [this message]
2023-07-19 17:39 ` [PATCH 1/2] docs: rust: update instructions for " Martin Rodriguez Reboredo
2023-07-20 13:44 ` Alice Ryhl
2023-07-20 14:52 ` Miguel Ojeda
2023-07-18 5:44 ` [PATCH 2/2] docs: rust: clarify what 'rustup override' does Trevor Gross
2023-07-19 17:39 ` Martin Rodriguez Reboredo
2023-07-20 13:45 ` Alice Ryhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230718054416.861412-2-tmgross@umich.edu \
--to=tmgross@umich.edu \
--cc=alex.gaynor@gmail.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=corbet@lwn.net \
--cc=gary@garyguo.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).