mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alice Ryhl <alice@ryhl.io>
To: Alice Ryhl <aliceryhl@google.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas@fjasle.eu>,
	Miguel Ojeda <ojeda@kernel.org>
Cc: "Alex Gaynor" <alex.gaynor@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@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] Kbuild: add RUSTC_BOOTSTRAP to rustc-option
Date: Tue, 8 Oct 2024 20:59:31 +0200	[thread overview]
Message-ID: <e4a8e9c5-8c74-4fa3-87de-db25356e450b@ryhl.io> (raw)
In-Reply-To: <CAH5fLgieyO79OnLbFik5awASQub0VDErZmbrcQECDr-e41_ohg@mail.gmail.com>

On 10/8/24 4:24 PM, Alice Ryhl wrote:
> On Tue, Oct 8, 2024 at 3:49 PM Alice Ryhl <aliceryhl@google.com> wrote:
>>
>> When using unstable features with the Rust compiler, you must either use
>> a nightly compiler release or set the RUSTC_BOOTSTRAP environment
>> variable. Otherwise, the compiler will emit a compiler error. This
>> environment variable is missing when rustc-option is executed, so add
>> the environment variable.
>>
>> This change is necessary to avoid two kinds of problems:
>>
>> 1. When using rustc-option to test whether a -Z flag is available, the
>>     check will always fail, even if the flag is available.
>> 2. If KBUILD_RUSTFLAGS happens to contain any -Z flags from the
>>     environment, even if unrelated to the flag being tested, then all
>>     invocations of rustc-option everywhere will fail.
>>
>> I was not actually able to trigger the second kind of problem with the
>> makefiles that exist today, but it seems like it could easily start
>> being a problem due to complicated interactions between changes. It is
>> better to fix this now so it doesn't surprise us later.
>>
>> I added the flag under try-run as this seemed like the easiest way to
>> make sure that the fix applies to all variations of rustc-option,
>> including new ones added in the future.
>>
>> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> 
> It should be "export". Also, this doesn't seem to be sufficient at
> all. Now I'm running into this error:
> 
> make[1]: Entering directory '/home/aliceryhl/lout'
> warning: ignoring --out-dir flag due to -o flag
> 
> error[E0463]: can't find crate for `std`
>    |
>    = note: the `aarch64-unknown-none` target may not be installed
>    = help: consider downloading the target with `rustup target add
> aarch64-unknown-none`
>    = help: consider building the standard library from source with
> `cargo build -Zbuild-std`
> 
> error: aborting due to 1 previous error; 1 warning emitted
> 
> For more information about this error, try `rustc --explain E0463`.
> 
> I think this patch is going to need more work. Sorry for sending it prematurely.
v2 is here:
https://lore.kernel.org/all/20241008-rustc-option-bootstrap-v2-1-e6e155b8f9f3@google.com/

  reply	other threads:[~2024-10-08 18:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 13:49 Alice Ryhl
2024-10-08 14:24 ` Alice Ryhl
2024-10-08 18:59   ` Alice Ryhl [this message]
2024-10-08 14:25 ` Miguel Ojeda
2024-10-08 18:44   ` Masahiro Yamada
2024-10-08 20:05     ` Miguel Ojeda
2024-10-08 20:17       ` Masahiro Yamada

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=e4a8e9c5-8c74-4fa3-87de-db25356e450b@ryhl.io \
    --to=alice@ryhl.io \
    --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=gary@garyguo.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    --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

all inboxes | Powered by JetHome®