Skip to content

Commit bd618f1

Browse files
authored
Merge pull request #66573 from kimdv/kimdv/migrate-swift-syntax-build-script-to-swift
2 parents 12ef619 + e9b316e commit bd618f1

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

utils/swift_build_support/swift_build_support/products/swiftsyntax.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ def is_swiftpm_unified_build_product(cls):
5050
return True
5151

5252
def run_swiftsyntax_build_script(self, target, command, additional_params=[]):
53-
script_path = os.path.join(self.source_dir, 'build-script.py')
53+
script_path = os.path.join(self.source_dir, 'SwiftSyntaxDevUtils')
5454

5555
build_cmd = [
56-
script_path,
56+
os.path.join(self.install_toolchain_path(target), "bin", "swift"),
57+
'run',
58+
'--package-path', script_path,
59+
'swift-syntax-dev-utils',
5760
command,
5861
'--build-dir', self.build_dir,
5962
'--multiroot-data-file', MULTIROOT_DATA_FILE_PATH,
@@ -74,21 +77,33 @@ def run_swiftsyntax_build_script(self, target, command, additional_params=[]):
7477

7578
build_cmd.extend(additional_params)
7679

77-
shell.call(build_cmd)
80+
env = dict(os.environ)
81+
env["SWIFTCI_USE_LOCAL_DEPS"] = "1"
82+
83+
shell.call(build_cmd, env=env)
7884

7985
def should_build(self, host_target):
8086
return True
8187

8288
def build(self, host_target):
8389
if self.args.swiftsyntax_verify_generated_files:
90+
script_path = os.path.join(self.source_dir, 'SwiftSyntaxDevUtils')
91+
8492
build_cmd = [
85-
os.path.join(self.source_dir, 'build-script.py'),
93+
os.path.join(self.install_toolchain_path(host_target), "bin", "swift"),
94+
'run',
95+
'--package-path', script_path,
96+
'swift-syntax-dev-utils',
8697
'verify-source-code',
8798
'--toolchain', self.install_toolchain_path(host_target)
8899
]
89100
if self.args.verbose_build:
90101
build_cmd.append('--verbose')
91-
shell.call(build_cmd)
102+
103+
env = dict(os.environ)
104+
env["SWIFTCI_USE_LOCAL_DEPS"] = "1"
105+
106+
shell.call(build_cmd, env=env)
92107

93108
self.run_swiftsyntax_build_script(target=host_target,
94109
command='build')

0 commit comments

Comments
 (0)