Skip to content

Commit c4dda9c

Browse files
authored
Merge pull request intel#942 from myler/shliclew610-mainline-topic
CMPLRTOOLS-26045: workaround rmtree permission issue on Windows
2 parents 25bc886 + d12d5f1 commit c4dda9c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm_test_suite_sycl.pl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,16 @@ sub run_cmake
908908
close $out;
909909
}
910910

911-
sleep(30) if (is_windows()); # CMPLRTOOLS-26045: sleep for 30 second to correctly remove the folder
912-
rmtree($build_dir); # Clean build folder
911+
if (-d $build_dir) {
912+
execute( "rm -rf $build_dir" );
913+
if ($command_status != $PASS) {
914+
sleep(30) if (is_windows()); # CMPLRTOOLS-26045: sleep for 30 second to correctly remove the folder
915+
execute( "rm -rf $build_dir" ); # Device or resource busy, rm again.
916+
if ($command_status != $PASS) {
917+
$build_dir = $build_dir . "_" . int(rand(~0));
918+
}
919+
}
920+
}
913921
safe_Mkdir($build_dir); # Create build folder
914922
chdir_log($build_dir); # Enter build folder
915923
execute( "cmake -G Ninja ../ -DTEST_SUITE_SUBDIRS=$subdir -DTEST_SUITE_LIT=$lit"

0 commit comments

Comments
 (0)