dub
dub copied to clipboard
Central build cache
Add support for storing cached build artefacts in a central directory instead of in each package's ".dub" directory.
Thanks for your pull request, @s-ludwig!
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
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.
Agreed, let's make it the default.
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).
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.
Closing in favor of https://github.com/dlang/dub/pull/2542