Skip to content

Option for local dependencies

Problem to solve

It sometimes happens that you need to fix a bug / add a feature in a dependency. Currently, the easiest is to edit the files in nitrile-packages, and when you're done copy them to the actual repo and commit. This is cumbersome and error-prone (you may forget a file).

Proposal

Add an option --local-dependency DEP PATH. This uses PATH for the dependency DEP, instead of nitrile-packages/TARGET/DEP. PATH/nitrile.yml should exist.

  • The dependencies of ./nitrile.yml and PATH/nitrile.yml should be merged. The installed versions of dependencies should be fetched from lockfiles. Z3 should be invoked to find a set of installed packages that satisfies the merged dependencies, and these should be used as include paths (some of these will come from ./nitrile-packages, others from PATH/nitrile-packages).
  • An option --verbose should be used to output the choices here: which version of which package is taken?
  • If there is no set of installed packages that satisfies the constraints, we can just error (even if it's possible to satisfy the constraints with _un_installed packages), and the user should run fetch or otherwise fix constraints.
  • The include paths are taken from: (i) src of the current project; (ii) src of the local dependencies; (iii) dependencies, build_dependencies, test_dependencies of the current project; (iv) the same fields dependencies of the local dependencies.
  • It should be possible to specify --local-dependency multiple times.
  • NB: build steps of local dependencies are not taken into account. If you rely on this, you need to run nitrile build in the local dependency manually before invoking nitrile build in the main project.

We can additionally allow paths in which no nitrile.yml exists. These would then simply be added to the include paths (without dependencies or constraints check). This makes it possible to use the same option for Nix (see #15 (closed)).

Documentation

  • Short description on --help
  • Elaborate description in the documentation pages
Edited by Camil Staps