# Rust Build Process

**URL:** <https://internals.rust-lang.org/t/rust-build-process/17458>\
**Category:** internals\
**Created:** [September 27, 2022, 1:41am UTC](https://internals.rust-lang.org/t/rust-build-process/17458 "2022-09-27T01:41:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJU](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/mju/32/9772_2.png) [@MJU](https://internals.rust-lang.org/u/MJU)\
**Post date:** [September 27, 2022, 1:41am UTC](https://internals.rust-lang.org/t/rust-build-process/17458/1 "2022-09-27T01:41:22Z")

</div>

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.](https://github.com/rust-lang/rust)) 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 🙂

---

<div class="post-metadata">

**Author:** ![Jules-Bertholet](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jules-bertholet/32/10671_2.png) [@Jules-Bertholet](https://internals.rust-lang.org/u/Jules-Bertholet)\
**Post date:** [September 27, 2022, 2:09am UTC](https://internals.rust-lang.org/t/rust-build-process/17458/2 "2022-09-27T02:09:22Z")

</div>

Comprehensive documentation for building `rustc` can be found in the [dev guide](https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html). If you just follow the steps there, you should not need to delete the build folder every time.

---

<div class="post-metadata">

**Author:** ![ekuber](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ekuber/32/1646_2.png) [@ekuber](https://internals.rust-lang.org/u/ekuber)\
**Post date:** [September 27, 2022, 12:18pm UTC](https://internals.rust-lang.org/t/rust-build-process/17458/3 "2022-09-27T12:18:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MJU](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/mju/32/9772_2.png) [@MJU](https://internals.rust-lang.org/u/MJU)\
**Post date:** [September 28, 2022, 7:13am UTC](https://internals.rust-lang.org/t/rust-build-process/17458/4 "2022-09-28T07:13:56Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [December 27, 2022, 7:14am UTC](https://internals.rust-lang.org/t/rust-build-process/17458/5 "2022-12-27T07:14:07Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
