From: Trevor Gross Date: Thu, 3 Aug 2023 06:04:36 +0000 (-0400) Subject: docs: rust: update instructions for obtaining 'core' source X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8cb40124cf923d4627d2e29b84dbff72e41fa0ef;p=linux.git docs: rust: update instructions for obtaining 'core' source The source for Rust's 'core' library is needed to build the kernel with Rust support. This sometimes needs to be obtained by hand when using a standalone version of 'rustc' not managed by 'rustup'. Currently, the documentation suggests cloning the 'rust' repository to obtain these sources, but this is quite slow (on the order of a multiple minutes). Change this documentation to suggest using the source tarball instead. The tarball includes only needed files (<5M) and is significantly faster to download; this is more in line with what 'rustup' does. Also simplify wording of the relevant section. Link: https://github.com/Rust-for-Linux/linux/pull/1024 Signed-off-by: Trevor Gross Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Alice Ryhl Link: https://lore.kernel.org/r/20230803060437.12157-2-tmgross@umich.edu Signed-off-by: Miguel Ojeda --- diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst index 1274cd74f7679..a0a47a6f216b5 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