* [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC
@ 2024-09-13 18:06 Masahiro Yamada
2024-09-14 7:14 ` Nicolas Schier
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Masahiro Yamada @ 2024-09-13 18:06 UTC (permalink / raw)
To: linux-kbuild, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
rust-for-linux
Cc: Finn Behrens, linux-kernel, Masahiro Yamada, Alice Ryhl,
Andreas Hindborg, Benno Lossin, Björn Roy Baron, Boqun Feng,
Gary Guo, Nathan Chancellor, Nicolas Schier
If RUST_LIB_SRC is defined in the top-level Makefile (via an environment
variable or command line), it is already exported.
The only situation where it is defined but not exported is when the
top-level Makefile is wrapped by another Makefile (e.g., GNUmakefile).
I cannot think of any other use cases.
I know some people use this tip to define custom variables. However,
even in that case, you can export it directly in the wrapper Makefile.
Example GNUmakefile:
export RUST_LIB_SRC = /path/to/your/sysroot/lib/rustlib/src/rust/library
include Makefile
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
This code was added by this commit:
https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
Please me know if I am missing something.
Makefile | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Makefile b/Makefile
index d57cfc6896b8..b194b7702a2e 100644
--- a/Makefile
+++ b/Makefile
@@ -578,10 +578,6 @@ else
RUSTC_OR_CLIPPY = $(RUSTC)
endif
-ifdef RUST_LIB_SRC
- export RUST_LIB_SRC
-endif
-
# Allows the usage of unstable features in stable compilers.
export RUSTC_BOOTSTRAP := 1
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC
2024-09-13 18:06 [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC Masahiro Yamada
@ 2024-09-14 7:14 ` Nicolas Schier
2024-09-23 9:17 ` Alice Ryhl
2024-09-24 18:42 ` Miguel Ojeda
2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Schier @ 2024-09-14 7:14 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
rust-for-linux, Finn Behrens, linux-kernel, Alice Ryhl,
Andreas Hindborg, Benno Lossin, Björn Roy Baron, Boqun Feng,
Gary Guo, Nathan Chancellor
On Sat, Sep 14, 2024 at 03:06:20AM +0900, Masahiro Yamada wrote:
> If RUST_LIB_SRC is defined in the top-level Makefile (via an environment
> variable or command line), it is already exported.
>
> The only situation where it is defined but not exported is when the
> top-level Makefile is wrapped by another Makefile (e.g., GNUmakefile).
> I cannot think of any other use cases.
>
> I know some people use this tip to define custom variables. However,
> even in that case, you can export it directly in the wrapper Makefile.
>
> Example GNUmakefile:
>
> export RUST_LIB_SRC = /path/to/your/sysroot/lib/rustlib/src/rust/library
> include Makefile
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> This code was added by this commit:
>
> https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
>
> Please me know if I am missing something.
Looks good to me.
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC
2024-09-13 18:06 [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC Masahiro Yamada
2024-09-14 7:14 ` Nicolas Schier
@ 2024-09-23 9:17 ` Alice Ryhl
2024-09-24 18:42 ` Miguel Ojeda
2 siblings, 0 replies; 5+ messages in thread
From: Alice Ryhl @ 2024-09-23 9:17 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
rust-for-linux, Finn Behrens, linux-kernel, Andreas Hindborg,
Benno Lossin, Björn Roy Baron, Boqun Feng, Gary Guo,
Nathan Chancellor, Nicolas Schier
On Fri, Sep 13, 2024 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> If RUST_LIB_SRC is defined in the top-level Makefile (via an environment
> variable or command line), it is already exported.
>
> The only situation where it is defined but not exported is when the
> top-level Makefile is wrapped by another Makefile (e.g., GNUmakefile).
> I cannot think of any other use cases.
>
> I know some people use this tip to define custom variables. However,
> even in that case, you can export it directly in the wrapper Makefile.
>
> Example GNUmakefile:
>
> export RUST_LIB_SRC = /path/to/your/sysroot/lib/rustlib/src/rust/library
> include Makefile
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC
2024-09-13 18:06 [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC Masahiro Yamada
2024-09-14 7:14 ` Nicolas Schier
2024-09-23 9:17 ` Alice Ryhl
@ 2024-09-24 18:42 ` Miguel Ojeda
2024-09-24 19:23 ` Fiona Behrens
2 siblings, 1 reply; 5+ messages in thread
From: Miguel Ojeda @ 2024-09-24 18:42 UTC (permalink / raw)
To: Masahiro Yamada, Fiona Behrens
Cc: linux-kbuild, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
rust-for-linux, linux-kernel, Alice Ryhl, Andreas Hindborg,
Benno Lossin, Björn Roy Baron, Boqun Feng, Gary Guo,
Nathan Chancellor, Nicolas Schier
On Fri, Sep 13, 2024 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> This code was added by this commit:
>
> https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
>
> Please me know if I am missing something.
I think it is OK -- unless Fiona recalls something:
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Thanks Masahiro for the simplification!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC
2024-09-24 18:42 ` Miguel Ojeda
@ 2024-09-24 19:23 ` Fiona Behrens
0 siblings, 0 replies; 5+ messages in thread
From: Fiona Behrens @ 2024-09-24 19:23 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Masahiro Yamada, Fiona Behrens, linux-kbuild, Miguel Ojeda,
Alex Gaynor, Wedson Almeida Filho, rust-for-linux, linux-kernel,
Alice Ryhl, Andreas Hindborg, Benno Lossin, Björn Roy Baron,
Boqun Feng, Gary Guo, Nathan Chancellor, Nicolas Schier
On 24 Sep 2024, at 20:42, Miguel Ojeda wrote:
> On Fri, Sep 13, 2024 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> This code was added by this commit:
>>
>> https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
>>
>> Please me know if I am missing something.
>
> I think it is OK -- unless Fiona recalls something:
As long as the export to rustc and the rust analyzer script works this looks good.
Acked-by: Fiona Behrens <me@kloenk.dev>
>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>
> Tested-by: Miguel Ojeda <ojeda@kernel.org>
>
> Thanks Masahiro for the simplification!
>
> Cheers,
> Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-24 19:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 18:06 [PATCH] kbuild: remove unnecessary export of RUST_LIB_SRC Masahiro Yamada
2024-09-14 7:14 ` Nicolas Schier
2024-09-23 9:17 ` Alice Ryhl
2024-09-24 18:42 ` Miguel Ojeda
2024-09-24 19:23 ` Fiona Behrens
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).