Skip to content

Commit

Permalink
Create empty zip files (#61828)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak authored Nov 19, 2021
1 parent 6d9edd4 commit 4e2d3a6
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 4e2d3a6

Please sign in to comment.