As I am investigating a potential version dependency resolution issue from nimble, I started to wonder the expected behaviour of nimble in relation to packages locally presents.
AFAIK, nimble pulls dependency in ~/.nimble/pkgs2:
▶ ls ~/.nimble/pkgs2 -1 | head
bearssl-0.2.6-7e068f119664cf47ad0cfb74ef4c56fb6b616523
bearssl_pkey_decoder-0.1.0-21b42e2e6ddca6c875d3fc50f36a5115abf51714
chronicles-0.11.0-e5be8a1a1d79df93be25d7f636d867c70e4ab352
chronicles-0.12.2-02febb20d088120b2836d3306cfa21f434f88f65
chronos-4.0.4-455802a90204d8ad6b31d53f2efff8ebfe4c834a
confutils-0.1.0-a26438274bd33da733aa06ef50090c61e51403f9
db_connector-0.1.0-b20053975976f94afac253d67cc6ef9200b32d02
dnsclient-0.3.4-65262c7e533ff49d6aca5539da4bc6c6ce132f40
dnsdisc-0.1.0-5a3791c9e31660712eb6b53f9b3785a50b99e080
eth-0.9.0-2e01b0cfff9523d110562af70d19948280f8013e
When running nimble --verbose install -d, we can see that its checks said folder to know whether dependencies are already resolved:
▶ nimble --verbose install -d | grep -v "Reading official package list"
Info: Package cache path /home/fryorcraken/.nimble/pkgcache
Info: Nimble data file "/home/fryorcraken/.nimble/nimbledata2.json" has been loaded.
Info: Dependency on nim@>= 1.6 already satisfied
Info: Dependency on nim@>= 1.6.0 already satisfied
Finally, by default, nimble pulls the latest tag from the GitHub repo of a dependency.
My question: Does nimble:
try to satisfy all dependencies using local cache, without network call. And only check the GitHub repo if a dependency is not present locally
Yes. This is the case for both vnext and legacy versions. Notice though, the "local cache" used is not the actual cache but where the packages are installed (pkgs2 folder). Which when in local mode (new default) are independent for each project. There is the global cache in pkgcache. An important distinction into vnext and legacy is that vnext builds the package in the installation folder whereas the legacy builds it in the cache.