public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Igor Korotin <igor.korotin@yahoo.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v2] docs: rust: quick-start: update Ubuntu instructions
Date: Wed, 2 Apr 2025 12:49:08 +0100	[thread overview]
Message-ID: <cdcf14f6-76e2-4895-b85e-cef0439a30cc@yahoo.com> (raw)
In-Reply-To: <CANiq72mysmMph1zGAxPKDY_FixbRRa0kS3pSqj4Qhq6Yjqq2AA@mail.gmail.com>



On 4/2/25 12:26, Miguel Ojeda wrote:
> On Wed, Apr 2, 2025 at 12:48 PM Igor Korotin <igor.korotin@yahoo.com> wrote:
>>
>> +``PATH`` needs to be set when installing rust 1.80 with apt, e.g.::
>> +
>> +       PATH=/usr/lib/rust-1.80/bin:$PATH
> 
> Why does it need to be set? i.e. why not `RUSTC=...` for that one too?
> 
> In other words, why are we mixing the approaches? We can explain both,
> but mixing them seems confusing.

I checked what happens with other tools(For example rustdoc) if I define 
only
`RUSTC=rustc-1.80`. Unsurprisingly `rustdoc` remains 1.75, which is 
installed from `rustc` package, which in its turn is dependency for the 
package `bindgen-0.65`. Though I see that this mix works fine, it seems 
a little bit weird when you have one tool of version 1.80 another 1.75, 
etc. Without a doubt one can define each tool explicitly using `RUSTC`, 
`RUSTDOC`, etc. On the other hand defining `PATH` to 
`/usr/lib/rust-1.80/bin/` automatically makes build to use rust-1.80 
tools.

>> +Deb package bindgen-0.65 does not set itself as a default, thus it should be set
>> +explicitly, e.g.::
>> +
>> +       BINDGEN=bindgen-0.65
> 
> I don't think this example adds much, since we already show it below.

This was intention to explain each additional environment part of the 
overall command.

>> +       make LLVM=1 PATH=/usr/lib/rust-1.80/bin:$PATH \
>> +               RUST_LIB_SRC=/usr/src/rustc-$(rustc-1.80 --version | cut -d' ' -f2)/library \
> 
> Note that `RUST_LIB_SRC` (and `PATH`) are not needed there, i.e. those
> two can be set as environment variables.
> 
> Perhaps we could just add something like this to the existing paragraph:
> 
>      ``RUST_LIB_SRC`` needs to be set (possibly as an environment variable) ...

By adding these as part of the overall build command, I was going by 
your earlier statement that you prefer setups that minimize global changes.

> 
> Also, weren't we going to mention `RUSTDOC`, `RUSTFMT` and `CLIPPY_DRIVER`?

This one was supposed to be covered by `PATH=/usr/lib/rust-1.80/bin:$PATH`

Thanks for the review

Best Regards
Igor



  reply	other threads:[~2025-04-02 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250402104759.1764282-1-igor.korotin.ref@yahoo.com>
2025-04-02 10:47 ` [PATCH v2] docs: rust: quick-start: update Ubuntu instructions Igor Korotin
2025-04-02 11:26   ` Miguel Ojeda
2025-04-02 11:49     ` Igor Korotin [this message]
2025-04-02 16:06       ` Miguel Ojeda
2025-04-02 13:52     ` Igor Korotin
2025-04-02 16:06       ` 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=cdcf14f6-76e2-4895-b85e-cef0439a30cc@yahoo.com \
    --to=igor.korotin@yahoo.com \
    --cc=a.hindborg@kernel.org \
    --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=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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