Skip to content

Don't clone submodules for tools that aren't being built #76653

Closed
@jyn514

Description

@jyn514

Right now, this is the first thing you see on a fresh clone:

$ python x.py check
Updating only changed submodules
Updating submodule src/tools/rust-installer
Submodule 'src/rust-installer' (https://github.com/rust-lang/rust-installer.git) registered for path 'src/tools/rust-installer'
Cloning into '/home/joshua/src/rust/rust/src/tools/rust-installer'...
remote: Enumerating objects: 30, done.        
remote: Counting objects: 100% (30/30), done.        
remote: Compressing objects: 100% (26/26), done.        
remote: Total 799 (delta 9), reused 11 (delta 3), pack-reused 769        
Receiving objects: 100% (799/799), 246.22 KiB | 4.83 MiB/s, done.
Resolving deltas: 100% (486/486), done.
Submodule path 'src/tools/rust-installer': checked out 'd66f476b4d5e7fdf1ec215c9ac16c923dc292324'
Updating submodule src/doc/nomicon
...

This can go on for many minutes, especially on a slow connection. Instead, x.py should only clone the submodules when they're actually needed.

I think cargo build requires having the Cargo.toml of the submodules to work, which might be tricky ... maybe x.py could default to a shallow clone? The main thing I'd love to have is for x.py check to not have to download LLVM.

Thanks to @Lokathor and @thomcc for encouraging me to throw away my clone and start from scratch ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions