diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 56f731e650f..a2adb000e58 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,7 @@ # Upcoming +- fix: No output when compiling to JavaScript on Windows (https://github.com/dafny-lang/dafny/pull/1824) + # 3.4.1 diff --git a/Scripts/package.py b/Scripts/package.py index 78a9090c7f5..5e7545cafcb 100755 --- a/Scripts/package.py +++ b/Scripts/package.py @@ -24,6 +24,8 @@ Z3_RELEASES_URL = "https://api.github.com/repos/Z3Prover/z3/releases/tags/Z3-4.8.5" ## How do we extract info from the name of a Z3 release file? Z3_RELEASE_REGEXP = re.compile(r"^(?Pz3-[0-9a-z\.]+-(?Px86|x64)-(?P[a-z0-9\.\-]+)).zip$", re.IGNORECASE) +## How many times we allow ourselves to try to download Z3 +Z3_MAX_DOWNLOAD_ATTEMPTS = 5 ## Allowed Dafny release names DAFNY_RELEASE_REGEX = re.compile("\\d+\\.\\d+\\.\\d+(-[\w\d_-]+)?$") @@ -106,10 +108,17 @@ def download(self): print("cached!") else: flush("downloading {:.2f}MB...".format(self.MB), end=' ') - with request.urlopen(self.url) as reader: - with open(self.z3_zip, mode="wb") as writer: - writer.write(reader.read()) - flush("done!") + for currentAttempt in range(Z3_MAX_DOWNLOAD_ATTEMPTS): + try: + with request.urlopen(self.url) as reader: + with open(self.z3_zip, mode="wb") as writer: + writer.write(reader.read()) + flush("done!") + break + except http.client.IncompleteRead as e: + if currentAttempt == Z3_MAX_DOWNLOAD_ATTEMPTS - 1: + raise + @staticmethod def zipify_path(fpath):