Circular dependency between scheduler unit tests and cost models
ms705 opened this issue · comments
We still have a circular dependency in the build system, unfortunately: the cost_models
target depends on scheduling
, but scheduling
contains some unit tests that require libfirmament_cost_models.a
.
To reproduce, do a make clean
and build:
[...]
TESTLNK /home/malte/Projects/firmament/build/tests/scheduling/dimacs_exporter_test
TESTLNK /home/malte/Projects/firmament/build/tests/scheduling/flow_graph_test
clang: error: no such file or directory: '/home/malte/Projects/firmament/build/scheduling/cost_models/libfirmament_cost_models.a'
clang: error: no such file or directory: '/home/malte/Projects/firmament/build/scheduling/cost_models/libfirmament_cost_models.a'
[...]
Possible solutions:
- Bring cost models back to
scheduling
(not really a good answer) - Break out the parts of
scheduling
thatcost_models
depends on and build them as a separate module. - Explicitly specify the .o files that the unit tests depend on, rather than going via
libfirmament_cost_models.a
.
Having looked at this a bit more, I think the dependency issue is as follows:
scheduling
builds the flow graph components, which the cost model interface depends on (via FlowGraphNode
and similar types), but the scheduling
unit tests (DIMACSExporterTest
and FlowGraphTest
) in turn depend on the trivial cost model.
The right answer to me seems to be to break out the flow graph stuff into its own module (and possibly the flow scheduler more generally), merge this module with the cost models and move the offending tests in there (since they're both related to the flow scheduler).
Thoughts? This is obviously a fairly invasive change to the tree, so we may want to background it until outstanding merges have happened.
(This is on hold until #17 is merged, as it will otherwise trigger lots of tree conflicts.)
This is fixed in #22. Sent to @ICGog for review: https://review.gerrithub.io/#/c/234885/.
Resolved in #22 (merged).