rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tiago Lam <tiagolam@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] docs: rust: Clarify that 'rustup override' applies to build directory
Date: Fri, 15 Dec 2023 11:14:01 +0000	[thread overview]
Message-ID: <a2aca039-7360-476e-a1b1-e950698cd26b@gmail.com> (raw)
In-Reply-To: <20231215064823.ltm55fk4zclsuuwq@vireshk-i7>

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.

  reply	other threads:[~2023-12-15 11:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  7:43 [PATCH V2] docs: rust: Clarify that 'rustup override' applies to build directory Viresh Kumar
2023-12-12  9:19 ` Alice Ryhl
2023-12-12 17:43 ` Benno Lossin
2023-12-14 13:26 ` Tiago Lam
2023-12-14 17:22   ` Miguel Ojeda
2023-12-14 22:25     ` Miguel Ojeda
2023-12-15  6:48     ` Viresh Kumar
2023-12-15 11:14       ` Tiago Lam [this message]
2023-12-15 11:24         ` Viresh Kumar
2023-12-15 11:53           ` Miguel Ojeda
2023-12-18 12:06             ` Masahiro Yamada
2023-12-21 21:39               ` Miguel Ojeda
2023-12-15 12:19           ` Tiago Lam
2023-12-15 11:35         ` Miguel Ojeda
2023-12-21 21:40 ` Miguel Ojeda

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=a2aca039-7360-476e-a1b1-e950698cd26b@gmail.com \
    --to=tiagolam@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.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=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.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).