Partially revert dep changes in #5651
authorAlex Crichton <alex@alexcrichton.com>
Wed, 11 Jul 2018 16:27:08 +0000 (09:27 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 13 Jul 2018 20:13:10 +0000 (13:13 -0700)
commitbb9ff3d1c422dea9edd67547c8c8a5b0831b2474
treed0a0cb8bff49a42a8df267a9f45defef9d287a2e
parentcb019b621ba10009f634350337d7456ad75364b9
Partially revert dep changes in #5651

Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.

The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.

Closes #5708
src/cargo/core/compiler/context/unit_dependencies.rs
tests/testsuite/build_script.rs
tests/testsuite/test.rs