@@ -714,12 +714,29 @@ def download_llvm(rctx):
714
714
if not urls :
715
715
urls , sha256 , strip_prefix = _distribution_urls (rctx )
716
716
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
+ )
723
740
724
741
if rctx .attr .libclang_rt :
725
742
clang_versions = rctx .path ("lib/clang" ).readdir ()
@@ -832,9 +849,9 @@ def _write_distributions_impl(ctx):
832
849
for prefix in ["LLVM-" , "clang+llvm-" ]:
833
850
if name .startswith (prefix ):
834
851
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
838
855
for version in _llvm_distributions_base_url .keys ():
839
856
if not _version_ge (version , MIN_VERSION ):
840
857
continue
0 commit comments