fury-old
fury-old copied to clipboard
The graph of dependencies should belong to the layer instead of the compilation object
A layer can yield a set of build targets and dependencies between these targets, which constitute a directed acyclic graph. This graph does not change unless the layer is modified, but each particular build target needs only a certain part of this graph.
If such graph were associated with the layer object, this could save some work during creation of the compilation objects, as well as eliminate the situations with build notifications for missing build targets (and hopefully solve #1077).
We have the possibility of inconsistent layers, though, which may have broken dependencies or project name conflicts, and in those cases, the Universe won't exist, and hence the Compilation object doesn't exist. The Compilation is also dependent on the choice of project and module that's being built.
Yes, the compilation object is indeed dependent on the choice of project and module, but it is also dependent on the work directory. As I understand it, the combination of these three values is sufficient to identify any build target, since there can be no two projects with the same name.
This follows as well from the format of URIs Bloop uses internally to identify the targets (they consist of the work directory and the project-module combination). If it were possible to have two different targets with the same work directory, project and module, the build server would be unable to tell them apart.
I'm not sure about broken dependencies, but my suggestion doesn't change the way name conflicts would be handled. If there is a name conflict anywhere in the dependency graph, it should be impossible to start any compilation at all.
What's the state of this issue at the moment, @odisseus?