dub icon indicating copy to clipboard operation
dub copied to clipboard

Central build cache

Open s-ludwig opened this issue 6 years ago • 6 comments

Add support for storing cached build artefacts in a central directory instead of in each package's ".dub" directory.

s-ludwig avatar Feb 14 '19 12:02 s-ludwig

Thanks for your pull request, @s-ludwig!

dlang-bot avatar Feb 14 '19 12:02 dlang-bot

I added auto-merge to it as its a very straight-forward change and the master/stable branch-off will likely happen tomorrow. If there are any controversies with this, we can always temporarily revert this and include it in 2.086

wilzbach avatar Feb 14 '19 12:02 wilzbach

I didn't want to do this in the first step, but I think we should probably eventually make this behavior the default, allowing to opt-out by setting the configuration field to an empty/null entry. Especially for single-file packages it is much nicer than polluting the parent directory or performing an uncached temp-build.

s-ludwig avatar Feb 14 '19 19:02 s-ludwig

Agreed, let's make it the default.

PetarKirov avatar Feb 15 '19 08:02 PetarKirov

This is a great feature. The behavior of dub is not compatible with e.g. Docker and path dependency. In our use case, we have submodules as path dependencies, and we had to add a few special cases to our Dockerfile to prevent long build (otherwise we were sending > 1 GB of data to the container, instead of ~50 mbs).

Geod24 avatar Dec 18 '19 18:12 Geod24

In general, I'd like us to be able to express the default behavior using the configuration. Meaning that there could be a configuration the user can enter that allows them to do exactly what no configuration would do. It's IMO important to avoid building special case, and it usually leads to cleaner code as you can then set a default value as field initializer and things just work.

In this case, I think we should take into account environment / package variable. The user should IMO be able to use DUB_PACKAGE_DIR and DUB_ROOT_PACKAGE_DIR to accomplish what the default is doing.

Geod24 avatar Aug 29 '22 09:08 Geod24

Closing in favor of https://github.com/dlang/dub/pull/2542

Geod24 avatar Dec 05 '22 13:12 Geod24