Module Dependencies

Dependency types

Apps/modules can depend on other modules. There are multiple dependency types:

  1. "depends" -> hard depend on another module, import env

    This module won't work unless the dependency is usable (not disabled, not conflicted by another module and its own dependencies can be resolved). It is pulled in and the dependency's exported environment will be imported.

    "depends" is equivalent to specifying both "selects" "uses".

  2. "selects" -> hard depend on another module, don't import env

    like 1.), the dependency will be pulled in, but the dependency's exported environment will not be imported.

  3. "uses" -> don't depend on module, but import env if module is part of build

    The dependency will not be pulled in by this module, but if it is part of the build through other means (e.g., another module depends on it), this module will import the dependency's exported environment.

  4. "conflicts" -> the modules cannot be used together in the same build.

  5. "optionally depends" -> soft depend on another module

    If the dependency is usable (not disabled, not conflicted by another module and its own dependencies can be resolved), it will be pulled in and its exported environment will be imported. If the dependency is not usable, the build continues as if the dependency was not specified at all.

  6. "optionally select" -> soft depend on another module (without importing env)

    If the dependency is usable (not disabled, not conflicted by another module and its own dependencies can be resolved), it will be pulled in, but its exported environment will not be imported.

  7. "if this than that" -> if "this" is part of the dependency tree, "depend" on "that"

  8. "optional if this than that" -> same as 6.) but as soft dependency.