Rust Build Process

Hi all! I wonder that rust build commend and process.

I progress the rust compiler build(GitHub - rust-lang/rust: Empowering everyone to build reliable and efficient software.) and modify the compiler source code to analyze. And I used the binary rustc in rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc. Here, I have some questions about rustc build.

  1. When I modify rustc again and proceed with the build, I always delete the build folder that came out during build and build again. If build process proceed without deleting the build folder, the modified code does not seem to be applied. I think this process is inefficient because it takes a long time in build time. Is there a way to generate binary code by building only the modified part without deleting the build folder?

  2. If the above method exists, does the process apply even if the forked llvm-project is modified?

Thank you! Have a nice day :slight_smile:

Comprehensive documentation for building rustc can be found in the dev guide. If you just follow the steps there, you should not need to delete the build folder every time.

2 Likes

Also, if there are instructions that were hard to follow, or things that you are still unclear about, this is the right place to ask and filing a ticket to improve the docs would be appreciated.

1 Like

Thank you for your comment!

Then, I wonder that llvm-project directory in rust repository. According to the guide, when i modify the source code in llvm-project, it needs to build again after deleting the build folder. Is there a command or option to build only the modified part without deleting the build folder?

Have a nice day :slight_smile: