Skip to content

Commit e54fe2c

Browse files
committed
Issue build commands to current working directory
1 parent daf15e8 commit e54fe2c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ def build(self, host_target):
3434
llvm_build_dir = join_path(self.build_dir, '../llvm-' + host_target)
3535
libdispatch_path = join_path(self.args.install_destdir, 'usr')
3636

37-
cmd = [
37+
config_cmd = [
3838
'cmake',
3939
'-GNinja',
40-
'-B%s' % self.build_dir,
4140
'-DCMAKE_PREFIX_PATH=%s' % llvm_build_dir,
4241
'-DCMAKE_C_COMPILER=clang',
4342
'-DCMAKE_CXX_COMPILER=clang++',
@@ -47,13 +46,20 @@ def build(self, host_target):
4746
'-DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON',
4847
'-DCOMPILER_RT_LIBDISPATCH_INSTALL_PATH=%s' % libdispatch_path,
4948
rt_source_dir]
50-
shell.call(cmd)
49+
build_cmd = ['ninja', 'tsan']
5150

52-
cmd = ['cmake', '--build', self.build_dir, '--target', 'tsan']
53-
shell.call(cmd)
51+
# Always rebuild TSan runtime
52+
shell.rmtree(self.build_dir)
53+
shell.makedirs(self.build_dir)
54+
55+
with shell.pushd(self.build_dir):
56+
shell.call(config_cmd)
57+
shell.call(build_cmd)
5458

5559
def test(self, host_target):
5660
"""Run check-tsan target with a LIT filter for libdispatch."""
57-
cmd = ['cmake', '--build', self.build_dir, '--target', 'check-tsan']
61+
cmd = ['ninja', 'check-tsan']
5862
env = {'LIT_FILTER': 'libdispatch'}
59-
shell.call(cmd, env=env)
63+
64+
with shell.pushd(self.build_dir):
65+
shell.call(cmd, env=env)

0 commit comments

Comments
 (0)