lkml.org 
[lkml]   [2023]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V2] docs: rust: Clarify that 'rustup override' applies to build directory
From
On 15/12/2023 06:48, Viresh Kumar wrote:
> On 14-12-23, 18:22, Miguel Ojeda wrote:
>> Something like v1 but a bit simpler, e.g. keeping things as they are,
>> but with just a sentence after the command like "If you are building
>> the kernel with `O=`, i.e. specifying an output directory, then you
>> should append `--path <builddir>`." could work.
>>
>> Or we could just provide a `rustupoverride` Make target to do this for
>> us [1], since we have all the information needed and would be
>> copy-pasteable by everybody. I can send it as a non-mangled patch and
>> then Viresh can redo this one on top using it.
>
> How about this ?
>
> diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-start.rst
> index f382914f4191..367b06f3edc2 100644
> --- a/Documentation/rust/quick-start.rst
> +++ b/Documentation/rust/quick-start.rst
> @@ -39,8 +39,17 @@ If ``rustup`` is being used, enter the checked out source code directory
> rustup override set $(scripts/min-tool-version.sh rustc)
>
> 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:
> +``rustc`` without affecting your default toolchain.
> +
> +If you are building the kernel with `O=`, i.e. specifying an output
> +directory, then you should append `--path <builddir>` to the above
> +command.
> +

I think we can drop the reference to the `--path <buildir>` to avoid
giving too much information to the users following the guide. It doesn't
seem to bring anything given users should now always go through `make
rustupoverride`.

> +Alternatively, you can use the ``rustupoverride`` Make target::
> +
> + make LLVM=1 O=<builddir> rustupoverride
> +

But if I understood this correctly, the point here is that with the new
target we can now abstract both cases behind the `make rustupoverride`
target - i.e. we don't need to provide alternatives. So, maybe something
like the following is clearer:

If ``rustup`` is being used, enter the checked out source code
directory, or your build directory (if you're using the `O=` option to
build the kernel), and run::

make LLVM=1 rustupoverride

This will configure your current 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

Tiago.

\
 
 \ /
  Last update: 2023-12-15 12:14    [W:0.102 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site