Skip to content

Commit 94856df

Browse files
authored
[HIP] Only remove build dir if exists (#406)
1 parent 7ce8260 commit 94856df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

zorg/buildbot/builders/annotated/hip-tpl.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
def main(argv):
1414
source_dir = os.path.join("..", "llvm-project")
1515
test_suite_source_dir = os.path.join("/opt/botworker/llvm", "llvm-test-suite")
16+
test_suite_build_dir = "TS-build"
1617

1718
offload_base_dir = os.path.join(source_dir, "offload")
1819
of_cmake_cache_base_dir = os.path.join(offload_base_dir, "cmake/caches")
@@ -60,7 +61,7 @@ def main(argv):
6061
clang_binary = os.path.join(compiler_bin_path, "clang")
6162
clangpp_binary = os.path.join(compiler_bin_path, "clang++")
6263

63-
test_suite_cmake_args = ["-GNinja", "-B", "TS-build", "-S", "."]
64+
test_suite_cmake_args = ["-GNinja", "-B", test_suite_build_dir, "-S", "."]
6465
test_suite_cmake_args.append("-DTEST_SUITE_EXTERNALS_DIR=/opt/botworker/llvm/External")
6566
# XXX: Use some utility to determine arch?
6667
test_suite_cmake_args.append("-DAMDGPU_ARCHS=gfx90a")
@@ -74,7 +75,8 @@ def main(argv):
7475

7576
old_cwd = os.getcwd()
7677
os.chdir(test_suite_source_dir)
77-
util.rmtree("TS-build")
78+
if os.path.isdir(test_suite_build_dir):
79+
util.rmtree(test_suite_build_dir)
7880

7981
cmake_command = ["cmake"]
8082
cmake_command.extend(test_suite_cmake_args)
@@ -87,13 +89,13 @@ def main(argv):
8789
old_cwd = os.getcwd()
8890
os.chdir(test_suite_source_dir)
8991

90-
run_command(["cmake", "--build", "TS-build", "--parallel", "--target", "build-kokkos"])
92+
run_command(["cmake", "--build", test_suite_build_dir, "--parallel", "--target", "build-kokkos"])
9193

9294
os.chdir(old_cwd)
9395

9496
with step("run kokkos test suite", halt_on_fail=True):
9597
os.chdir(test_suite_source_dir)
96-
run_command(["cmake", "--build", "TS-build", "--target", "test-kokkos"])
98+
run_command(["cmake", "--build", test_suite_build_dir, "--target", "test-kokkos"])
9799

98100

99101
@contextmanager

0 commit comments

Comments
 (0)