move icon indicating copy to clipboard operation
move copied to clipboard

[Feature Request] Optimize fetching git repo dependencies

Open mkurnikov opened this issue 1 year ago • 0 comments

🚀 Feature Request

Let's optimize the behaviour of git dependency fetching.

Motivation

The current behavior for the

[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-core.git"
subdir = "aptos-move/framework/aptos-framework/"
rev = "a1dc2e66e49ded056c10318f476e0096d0d17a6f"

is:

  1. git clone https://github.com/aptos-labs/aptos-core.git
  2. git checkout a1dc2e66e49ded056c10318f476e0096d0d17a6f

Those clone operations never cached. So, every time the revision changes, it's another clone of potentially very chunky repo.

There's also no progress feedback in the console, and for the big repos (or slow network connection) compilation seems stuck at times.

Pitch

I'd propose instead to add special $MOVE_HOME/repos directory and:

  1. If no desired repo in the directory, clone the whole thing. If there is, just pull the latest commits.
  2. Checkout to the desired commit.
  3. Copy the desired subdirectory into the $MOVE_HOME/$DEP_ROOT.

It'll make the compilations much faster, and also make $MOVE_HOME take less space.

mkurnikov avatar Aug 02 '22 11:08 mkurnikov