-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Rust documentation with workflow speed improvements #1024
Update Rust documentation with workflow speed improvements #1024
Conversation
6ce13e3
to
0943c89
Compare
Talked on Zulip and the team recommended using the source tarball rather than cloning via git. This is significantly faster compared to the time to clone, and it only keeps the Technically I have tested this by using the standalone installer in a docker container then runninng the command, default build with Rust succeeds. |
83982cb
to
96d7b75
Compare
Originally, I intentionally did not write extra options, because the idea was to show what was required, not anything extra. In other words, the document is not intended to be a general guide to kernel development, or to replace the kernel documentation elsewhere nor the GNU Make documentation; in order to keep it minimal and focused on the Rust bits. |
Understood, I can remove that. Are you ok with switching to the tarball? |
Unsure -- can you think of some reason not to do it? For instance, is it easier/harder when updating? I guess in both cases the user can simply delete the folder and reapply the instructions, right? By the way, the sentence "...upgrading the Rust compiler version later on requires manually updating this clone." would need to be slightly tweaked too if we do it. |
Nope, but I thought maybe you could :) It seems straightforward enough and I think that is how
Thanks, I will update this when I fix the other thing |
There are two separate tarballs. One with the source code of the entirety of rustc which you can use to build rustc from scratch (rustc-1.71.0-src) and one which contains just enough to build the standard library (rust-1.71.0-src). It is the later which ends up providing the files in |
That one is much smaller, I'll update this to use that one. Thanks for the link |
a5c3e43
to
03028b0
Compare
I removed mentions of I can submit this to the list if there aren't any further changes needed. |
Sounds good. (To be clear, reviews typically happen in the list, i.e. you may get more feedback there.) I would recommend splitting the changes into two different patches, since they are independent. Also, I would explain the improvement in time in the commit message. With an standalone installer, is the sysroot the same when you install a different version? I am asking because if the sysroot stays the same in some cases (unlike e.g. |
40f7554
to
93a4cfd
Compare
It seems like they do not change by version, testing on debian the system package manager uses I will post this to the list shortly. edit: all done https://lore.kernel.org/rust-for-linux/20230718054416.861412-1-tmgross@umich.edu/T/#t |
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>
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 <tmgross@umich.edu>
93a4cfd
to
002cac1
Compare
Thanks! I see it in Lore now (it took a while to arrive, it seems). Looks quite good for a first submission! |
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: Rust-for-Linux#1024 Signed-off-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
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: Rust-for-Linux#1024 Signed-off-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
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: #1024 Signed-off-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20230803060437.12157-2-tmgross@umich.edu Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This updates instructions for downloading the Rust source tree to use the tarball rather than cloning the repository.
I'll submit this to the list but a quick review here is nice :)