Skip to content

Change *.rsi targets to *.expanded.rs #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
y86-dev opened this issue Apr 19, 2025 · 4 comments
Open

Change *.rsi targets to *.expanded.rs #1158

y86-dev opened this issue Apr 19, 2025 · 4 comments
Assignees
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers • kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options...

Comments

@y86-dev
Copy link
Member

y86-dev commented Apr 19, 2025

The build system has support for expanding a Rust file path/to/file.rs by way of the .rsi target: make path/to/file.rsi. The extension .rsi comes AFAIK from the C/assembly world and doesn't make much sense for Rust, since it isn't recognized as a Rust file. It also makes it hard to remember how it is named. Thus let's rename the extension to .expanded.rs, that way it's clear what it does and it still has a .rs extension.


This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag, and a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

@y86-dev y86-dev added good first issue Good for newcomers easy Expected to be an easy issue to resolve. • kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options... labels Apr 19, 2025
@xizheyin
Copy link

I'd like to claim this task.

@JCKeep
Copy link

JCKeep commented Apr 19, 2025

@xizheyin If possible, fix make LLVM=1 CLIPPY=1 rust/kernel/lib.rsi command to expand the rust kernel's code would be better. see the conversation. Just my recommendation, feel free to.

@y86-dev
Copy link
Member Author

y86-dev commented Apr 19, 2025

@JCKeep feel free to open a separate issue about that, as that task is significantly harder than to just rename the extension.

xizheyin added a commit to xizheyin/linux that referenced this issue May 13, 2025
The build system currently uses .rsi as the extension for expanded
Rust files. This extension comes from the C/assembly world and is not
recognized as a Rust file, making it both unintuitive and hard to
remember.

Rename the extension to .expanded.rs, which clearly indicates the file
contains expanded Rust code. Use source file basename for --crate-name
to prevent rustc from treating .expanded as part of the crate name.

Link: Rust-for-Linux#1158
Closes: Rust-for-Linux#1158
Suggested-by: Benno Lossin <[email protected]>
Signed-off-by: xizheyin <[email protected]>
@xizheyin
Copy link

If you submit an issue, I'd be happy to continue that task. :)

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue May 13, 2025
The build system currently uses .rsi as the extension for expanded
Rust files. This extension comes from the C/assembly world and is not
recognized as a Rust file, making it both unintuitive and hard to
remember.

Rename the extension to .expanded.rs, which clearly indicates the file
contains expanded Rust code. Use source file basename for --crate-name
to prevent rustc from treating .expanded as part of the crate name.

Link: Rust-for-Linux#1158
Closes: Rust-for-Linux#1158
Suggested-by: Benno Lossin <[email protected]>
Signed-off-by: xizheyin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Expected to be an easy issue to resolve. good first issue Good for newcomers • kbuild Related to building the kernel, `make`, `Kbuild`, `Kconfig` options...
Development

No branches or pull requests

3 participants