Skip to content

Commit ef52c5a

Browse files
Remove fixes for Windows release artifacts
1 parent 4508fc5 commit ef52c5a

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

PCbuild/get_external.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import argparse
44
import os
55
import pathlib
6+
import shutil
67
import sys
7-
import tarfile
88
import time
99
import urllib.error
1010
import urllib.request
@@ -56,8 +56,7 @@ def fetch_release(tag, tarball_dir, *, org='python', verbose=False):
5656

5757
def extract_tarball(externals_dir, tarball_path, tag):
5858
output_path = externals_dir / tag
59-
with tarfile.open(tarball_path) as tf:
60-
tf.extractall(os.fspath(externals_dir))
59+
shutil.unpack_archive(os.fspath(tarball_path), os.fspath(output_path))
6160
return output_path
6261

6362

@@ -116,23 +115,21 @@ def main():
116115
verbose=args.verbose,
117116
)
118117
extracted = extract_zip(args.externals_dir, zip_path)
119-
120-
if extracted != final_name:
121-
for wait in [1, 2, 3, 5, 8, 0]:
122-
try:
123-
extracted.replace(final_name)
124-
break
125-
except PermissionError as ex:
126-
retry = f" Retrying in {wait}s..." if wait else ""
127-
print(f"Encountered permission error '{ex}'.{retry}", file=sys.stderr)
128-
time.sleep(wait)
129-
else:
130-
print(
131-
f"ERROR: Failed to rename {extracted} to {final_name}.",
132-
"You may need to restart your build",
133-
file=sys.stderr,
134-
)
135-
sys.exit(1)
118+
for wait in [1, 2, 3, 5, 8, 0]:
119+
try:
120+
extracted.replace(final_name)
121+
break
122+
except PermissionError as ex:
123+
retry = f" Retrying in {wait}s..." if wait else ""
124+
print(f"Encountered permission error '{ex}'.{retry}", file=sys.stderr)
125+
time.sleep(wait)
126+
else:
127+
print(
128+
f"ERROR: Failed to extract {final_name}.",
129+
"You may need to restart your build",
130+
file=sys.stderr,
131+
)
132+
sys.exit(1)
136133

137134

138135
if __name__ == '__main__':

Tools/jit/_llvm.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ async def _find_tool(tool: str, llvm_version: str, *, echo: bool = False) -> str
8383
# PCbuild externals:
8484
externals = os.environ.get("EXTERNALS_DIR", _targets.EXTERNALS)
8585
path = os.path.join(externals, _EXTERNALS_LLVM_TAG, "bin", tool)
86-
# On Windows, executables need .exe extension
87-
if os.name == "nt" and not path.endswith(".exe"):
88-
path_with_exe = path + ".exe"
89-
if os.path.exists(path_with_exe):
90-
path = path_with_exe
9186
if await _check_tool_version(path, llvm_version, echo=echo):
9287
return path
9388
# Homebrew-installed executables:

0 commit comments

Comments
 (0)