Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsdownload: Handle machineArch dependency constraint #140

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

huangqinjin
Copy link
Contributor

Closes #135
Closes #138

Copy link
Owner

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks reasonable, but I'd like to understand the roles of these fields a little better (it's been ages since I looked closer at the package trees).

vsdownload.py Outdated Show resolved Hide resolved
vsdownload.py Show resolved Hide resolved
@mstorsjo
Copy link
Owner

Does this change mean that we'll only end up downloading one of the Hostx86, Hostx64 and Hostarm64 directories for the compiler? That'd be a large size saving.

@hacksysteam
Copy link
Contributor

Hi @huangqinjin , We need to add/handle constraints to few more places, because it was passing None

diff --git a/vsdownload.py b/vsdownload.py
index 0e8e021..0f2852d 100755
--- a/vsdownload.py
+++ b/vsdownload.py
@@ -63,7 +63,7 @@ def getArgsParser():
     return parser
 
 def setPackageSelectionMSVC16(args, packages, userversion, sdk, toolversion, defaultPackages):
-    if findPackage(packages, "Microsoft.VisualStudio.Component.VC." + toolversion + ".x86.x64", None, warn=False):
+    if findPackage(packages, "Microsoft.VisualStudio.Component.VC." + toolversion + ".x86.x64", {}, warn=False):
         if sdk.startswith("10.0.") and int(sdk[5:]) >= 22000:
             sdkpkg = "Win11SDK_" + sdk
         else:
@@ -82,8 +82,9 @@ def setPackageSelectionMSVC16(args, packages, userversion, sdk, toolversion, def
         print("Didn't find exact version packages for " + userversion + ", assuming this is provided by the default/latest version")
         args.package.extend(defaultPackages)
 
+
 def setPackageSelectionMSVC15(args, packages, userversion, sdk, toolversion, defaultPackages):
-    if findPackage(packages, "Microsoft.VisualStudio.Component.VC.Tools." + toolversion, None, warn=False):
+    if findPackage(packages, "Microsoft.VisualStudio.Component.VC.Tools." + toolversion, {}, warn=False):
         args.package.extend(["Win10SDK_" + sdk, "Microsoft.VisualStudio.Component.VC.Tools." + toolversion])
     else:
         # Options for toolchains for specific versions. The latest version in
@@ -699,7 +700,7 @@ if __name__ == "__main__":
         sys.exit(0)
 
     if not args.accept_license:
-        response = input("Do you accept the license at " + findPackage(packages, "Microsoft.VisualStudio.Product.BuildTools", None)["localizedResources"][0]["license"] + " (yes/no)? ")
+        response = input("Do you accept the license at " + findPackage(packages, "Microsoft.VisualStudio.Product.BuildTools", {})["localizedResources"][0]["license"] + " (yes/no)? ")
         while response != "yes" and response != "no":
             response = input("Do you accept the license? Answer \"yes\" or \"no\": ")
         if response == "no":

@huangqinjin
Copy link
Contributor Author

Does this change mean that we'll only end up downloading one of the Hostx86, Hostx64 and Hostarm64 directories for the compiler? That'd be a large size saving.

No, this change just gives "chip", "machineArch", "productArch" a better default if they are not explicitly specified in dependencies.

@huangqinjin
Copy link
Contributor Author

Hi @huangqinjin , We need to add/handle constraints to few more places, because it was passing None

Thanks. Amended.

hacksysteam added a commit to hacksysteam/msvc-wine that referenced this pull request Sep 24, 2024
* Added colors to output messages to highlight important information.
* Switched from multiprocessing to ThreadPoolExecutor for downloads.
* Added tree like structure to --print-deps, --print-reverse-deps and --print-selection.
* Merged mstorsjo#140
* Merged mstorsjo#144
vsdownload.py Outdated Show resolved Hide resolved
@mstorsjo
Copy link
Owner

mstorsjo commented Oct 5, 2024

Thanks, let's merge this now!

@mstorsjo mstorsjo merged commit 612aeda into mstorsjo:master Oct 5, 2024
4 checks passed
@huangqinjin huangqinjin deleted the host-arch branch October 6, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RecursionError: maximum recursion depth exceeded while calling a Python object wrong arch of some packages
3 participants