DUB: Only fetch and cache packages in dub.json without running build

rikki cattermole rikki at cattermole.co.nz
Tue Apr 10 13:56:13 UTC 2018


On 11/04/2018 1:50 AM, Clinton wrote:
> Hi all,
> 
> I'm setting up a CircleCI config for my project. Right now I'm trying to 
> cache dependencies before running builds. This way I can run "dub build 
> --nodeps" immediately after the packages are cached to avoid extra 
> network calls and speed it up.
> 
> I'm wondering if there's a way to isolate the part that downloads and 
> caches all of the dependencies in dub.json without running the build.
> 
> Right now I have to run the build twice. First one, for the sake of 
> downloading the dependencies and later for running if the cache exists. 
> Having the build run the first time takes up a lot of time. I'm going 
> for the "npm install" type of effect.
> 
> The reason the cache needs to be rebuilt each time is because CircleCI 
> runs docker images. Once the deployment is finished, the image fs is 
> destroyed so there's no way to hold onto the cache for future builds.

You should be able to do this by using ``dub describe`` and ``dub 
fetch`` with a simple script.

But a reasonable feature request to make it default for fetch command.


More information about the Digitalmars-d mailing list