Skip to content

Commit 3f9f16f

Browse files
committed
[Build] Work around build-scripts single-root requirement.
Replace the correct Swift -> EarlySwiftSyntax dependency with an EarlySwiftDriver -> EarlySwiftSyntax dependency, to keep a linear dependency order in this part of the build graph.
1 parent 6854355 commit 3f9f16f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

utils/swift_build_support/swift_build_support/products/earlyswiftdriver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import os
1414

15+
from . import earlyswiftsyntax
1516
from . import product
1617
from .. import shell
1718
from .. import toolchain
@@ -57,7 +58,11 @@ def should_build(self, host_target):
5758

5859
@classmethod
5960
def get_dependencies(cls):
60-
return []
61+
# FIXME: This isn't a real dependency, but is necessary to linearize the
62+
# dependency graph from Swift to EarlySwiftSyntax. If we properly
63+
# express the dependency from Swift -> EarlySwiftSyntax, build_graph.py
64+
# asserts that there are multiple roots to the graph.
65+
return [earlyswiftsyntax.EarlySwiftSyntax]
6166

6267
def should_clean(self, host_target):
6368
return self.args.clean_early_swift_driver

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from . import cmark
1616
from . import earlyswiftdriver
17-
from . import earlyswiftsyntax
1817
from . import libcxx
1918
from . import llvm
2019
from . import product
@@ -214,6 +213,5 @@ def _swift_tools_ld64_lto_codegen_only_for_supporting_targets(self):
214213
def get_dependencies(cls):
215214
return [cmark.CMark,
216215
earlyswiftdriver.EarlySwiftDriver,
217-
earlyswiftsyntax.EarlySwiftSyntax,
218216
llvm.LLVM,
219217
libcxx.LibCXX]

0 commit comments

Comments
 (0)