Skip to content

Commit f8ebf12

Browse files
committed
Extraxt exe with 7zip since msiexe does not work.
1 parent feeadc7 commit f8ebf12

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

toolchain/internal/llvm_distributions.bzl

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,29 @@ def download_llvm(rctx):
714714
if not urls:
715715
urls, sha256, strip_prefix = _distribution_urls(rctx)
716716

717-
res = rctx.download_and_extract(
718-
urls,
719-
sha256 = sha256,
720-
stripPrefix = strip_prefix,
721-
auth = _get_auth(rctx, urls),
722-
)
717+
filename = urls[0].split("?")[0]
718+
basename = filename.split("/")[-1]
719+
if urls[0].endswith(".exe"):
720+
res = rctx.download(
721+
urls,
722+
sha256 = sha256,
723+
auth = _get_auth(rctx, urls),
724+
output = basename,
725+
)
726+
rctx.execute(
727+
arguments = [
728+
"C:/Program Files/7-Zip7z.exe",
729+
"x",
730+
basename,
731+
],
732+
)
733+
else:
734+
res = rctx.download_and_extract(
735+
urls,
736+
sha256 = sha256,
737+
stripPrefix = strip_prefix,
738+
auth = _get_auth(rctx, urls),
739+
)
723740

724741
if rctx.attr.libclang_rt:
725742
clang_versions = rctx.path("lib/clang").readdir()
@@ -832,9 +849,9 @@ def _write_distributions_impl(ctx):
832849
for prefix in ["LLVM-", "clang+llvm-"]:
833850
if name.startswith(prefix):
834851
version = name.split("-", 2)[1]
835-
if not _version_ge(version, MIN_VERSION):
836-
continue
837-
version_list.append(version)
852+
if _version_ge(version, MIN_VERSION):
853+
version_list.append(version)
854+
break
838855
for version in _llvm_distributions_base_url.keys():
839856
if not _version_ge(version, MIN_VERSION):
840857
continue

0 commit comments

Comments
 (0)