[build] shallow clone of llvm-project


I don't have the ability to do a complete git clone of the LLVM project (1.4GB) due to an internet connection.

Is the shallow clone is possible?

I know this command is possible
git submodule update --init --depth 1
but I don't know the behavior of ./x.py build.


I believe you can build rustc against a locally-installed LLVM (e.g. whatever your package manager gives you) instead of compiling LLVM yourself. Or you can put

download-ci-llvm = true

in rustc's config.toml to make the build download a prebuilt LLVM from rustc's CI instead of cloning the llvm-project repo and compiling that.

You will probably get more useful advice about building the compiler by asking on internals.rust-lang.org or Zulip instead of on users.rust-lang.org (which is focused on questions about using Rust).

1 Like

Thank you very much @cole-miller :smiley:! Your advice was very helpful, I finally build the rust compiler.

Also thanks for suggesting communication channels, I will remember from next time.

1 Like