[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a2aca039-7360-476e-a1b1-e950698cd26b@gmail.com>
Date: Fri, 15 Dec 2023 11:14:01 +0000
From: Tiago Lam <tiagolam@...il.com>
To: Viresh Kumar <viresh.kumar@...aro.org>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>, Boqun Feng
<boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...sung.com>, Alice Ryhl
<aliceryhl@...gle.com>, Jonathan Corbet <corbet@....net>,
Vincent Guittot <vincent.guittot@...aro.org>,
rust-for-linux@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] docs: rust: Clarify that 'rustup override' applies to
build directory
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.
Powered by blists - more mailing lists