Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/coreclr/scripts/superpmi_asmdiffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def copy_dasm_files(spmi_location, upload_directory, tag_name):
if not os.path.isdir(upload_directory):
os.makedirs(upload_directory)

dasm_file_present = False
# Create temp directory to copy all issues to upload. We don't want to create a sub-folder
# inside issues_directory because that will also get included twice.
with TempDir() as prep_directory:
Expand All @@ -98,9 +99,18 @@ def copy_dasm_files(spmi_location, upload_directory, tag_name):
os.makedirs(dst_directory)
try:
shutil.copy2(dasm_src_file, dasm_dst_file)
dasm_file_present = True
except PermissionError as pe_error:
print('Ignoring PermissionError: {0}'.format(pe_error))

# If there are no diffs, create an zip file with single file in it.
# Otherwise, Azdo considers it as failed job.
# See https://github.com/dotnet/arcade/issues/8200
if not dasm_file_present:
no_diff = os.path.join(prep_directory, "nodiff.txt")
with open(no_diff, "w") as no_diff_file:
no_diff_file.write("No diffs found!")

# Zip compress the files we will upload
zip_path = os.path.join(prep_directory, "Asmdiffs_" + tag_name)
print("Creating archive: " + zip_path)
Expand Down