diff --git a/setup/wincross.py b/setup/wincross.py index f02502f26f..251b33259c 100644 --- a/setup/wincross.py +++ b/setup/wincross.py @@ -182,7 +182,15 @@ def download(dest_dir, manifest_version=17, manifest_type='release', manifest_pa manifest = open(manifest_path, 'rb').read() else: url = f'https://aka.ms/vs/{manifest_version}/{manifest_type}/channel' - manifest = urlopen(url).read() + print('Downloading top-level manifest from', url) + tm = json.loads(urlopen(url).read()) + print("Got toplevel manifest for", (tm["info"]["productDisplayVersion"])) + for item in tm["channelItems"]: + if item.get('type') == "Manifest": + url = item["payloads"][0]["url"] + print('Downloading actual manifest...') + manifest = urlopen(url).read() + pkgs = Packages(manifest, crt_variant, arch) os.makedirs(dest_dir, exist_ok=True) total = sum(x.size for x in pkgs.files_to_download) diff --git a/setup/xwin.py b/setup/xwin.py index f9328d395f..b14219ea38 100644 --- a/setup/xwin.py +++ b/setup/xwin.py @@ -14,13 +14,13 @@ class XWin(Command): def run(self, opts): if not shutil.which('msiextract'): raise SystemExit('No msiextract found in PATH you may need to install msitools') - base = os.path.join(os.path.dirname(self.SRC), 'setup') - m = runpy.run_path(os.path.join(base, 'wincross.py')) - cache_dir = os.path.join(base, '.build-cache/xwin') + base = os.path.dirname(self.SRC) + m = runpy.run_path(os.path.join(base, 'setup', 'wincross.py')) + cache_dir = os.path.join(base, '.build-cache', 'xwin') if os.path.exists(cache_dir): shutil.rmtree(cache_dir) os.makedirs(cache_dir) - m.main(['--dest', cache_dir]) + m['main'](['--dest', cache_dir]) for x in os.listdir(cache_dir): if x != 'root': - shutil.rmtree(f'{cache_dir}/{x}') + shutil.rmtree(os.path.join(cache_dir, x))