Skip to content
Sönke Ludwig edited this page Jul 9, 2017 · 1 revision

Frequently asked questions

This is a page meant to collect frequent questions and answers about DUB

Why are dependencies downloaded that belong to configurations that are not being built?

The dependency resolution process is independent of the configuration resolution process. The upgrade process that is responsible for resolving and downloading dependencies does not know which configuration will be built later on. For an explanation why the system works this way, see the next question about dependencies and platform specifiers.

Why don't dependencies support platform specifications?

There are two independent resolution processes when building a DUB project:

  1. A valid dependency graph is computed. This makes sure that all direct and indirect dependencies are use with versions that adhere to the version specifications by which they are referenced.

  2. The second step is to compute a valid set of configurations for the current platform and build configuration. Depending on this set of configurations, the set of dependencies that actually need to be built is then determined.

This dependency resolution process is designed to be independent of any platform specifics not only because it greatly simplifies the logic to reason about conflicts, as well as the implementation, but most importantly it means that the result can be used independently of the chosen platform or build configuration.

Especially the dependency version selection feature (dub.selections.json) that is used to guarantee repeatable builds, would not work in a meaningful way if dependencies, platforms and configurations would be intertwined. Possibly every possible combination would result in a different set of selected dependency versions and the contents would be meaningless when building on a different platform.