rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: "Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Matthew Maurer" <mmaurer@google.com>,
	"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 v2] Kbuild: fix issues with rustc-option
Date: Wed, 9 Oct 2024 13:32:38 +0200	[thread overview]
Message-ID: <CAH5fLgh9t7=1sTwWWJHLtDxaaZYZAjLC8h_jVvC809hpqJz07g@mail.gmail.com> (raw)
In-Reply-To: <CAK7LNAS_22jQzsWDswChAMaE3GhT-1eqE9ngj61NeFz40SNxGw@mail.gmail.com>

On Wed, Oct 9, 2024 at 12:32 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Wed, Oct 9, 2024 at 4:42 AM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > On Tue, Oct 8, 2024 at 9:00 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > On Wed, Oct 9, 2024 at 2:32 AM Alice Ryhl <aliceryhl@google.com> wrote:
> > > > diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler
> > > > index 057305eae85c..08d5b7177ea8 100644
> > > > --- a/scripts/Makefile.compiler
> > > > +++ b/scripts/Makefile.compiler
> > > > @@ -21,6 +21,7 @@ TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
> > > >  # automatically cleaned up.
> > > >  try-run = $(shell set -e;              \
> > > >         TMP=$(TMPOUT)/tmp;              \
> > > > +       export RUSTC_BOOTSTRAP=1;       \
> > >
> > >
> > > try-run is not Rust-specific.
> > >
> > > Is there any reason why you did not add it
> > > to __rustc-option?
> > >
> > >
> > > __rustc-option = $(call try-run,\
> > >        RUSTC_BOOTSTRAP=1 $(1) $(2) $(3) --crate-type=rlib
> > > $(srctree)/rust/probe.rs --out-dir=$$TMP,$(3),$(4))
> >
> > I had an explanation for this in the commit message, but it looks like
> > it got lost when I rewrote it for v2. Anyway, the reason is that I'd
> > have to modify both __rustc-option and rustc-option-yn to do that, and
> > putting it here seemed more future-proof against making the same
> > mistake in any rustc-* commands added in the future.
>
>
> One solution is to delete rustc-option-yn since there are no users of it.
>
> Another solution is to refactor the code.
>
> Either way, there is no good reason for code duplication.
>
>
> If you keep rustc-option-yn, you can rebased v3 on top of this patch:
> https://lore.kernel.org/lkml/20241009102821.2675718-1-masahiroy@kernel.org/T/#u

I'll rebase on top of that. If we choose to delete rustc-option-yn
then I think we should first merge the refactor and then delete it in
a follow-up. That way, when someone does need it, they will find the
refactored implementation in the git history.

Alice

  reply	other threads:[~2024-10-09 11:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 17:32 [PATCH v2] Kbuild: fix issues with rustc-option Alice Ryhl
2024-10-08 17:43 ` Matthew Maurer
2024-10-08 18:25   ` Matthew Maurer
2024-10-08 19:25     ` Alice Ryhl
2024-10-08 20:21     ` Miguel Ojeda
2024-10-08 20:22       ` Matthew Maurer
2024-10-08 20:52         ` Miguel Ojeda
2024-10-09  9:23           ` Alice Ryhl
2024-10-09 10:01             ` Miguel Ojeda
2024-10-09 10:06               ` Masahiro Yamada
2024-10-09 10:43               ` Masahiro Yamada
2024-10-08 18:59 ` Masahiro Yamada
2024-10-08 19:42   ` Alice Ryhl
2024-10-09 10:32     ` Masahiro Yamada
2024-10-09 11:32       ` Alice Ryhl [this message]
2024-10-08 20:21 ` Miguel Ojeda
2024-10-09 11:43 ` Alice Ryhl

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='CAH5fLgh9t7=1sTwWWJHLtDxaaZYZAjLC8h_jVvC809hpqJz07g@mail.gmail.com' \
    --to=aliceryhl@google.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.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=mmaurer@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).